mirror of
https://github.com/kuhyx/engineer-thesis-WUT.git
synced 2026-07-04 13:23:09 +02:00
17 lines
426 B
Bash
Executable File
17 lines
426 B
Bash
Executable File
#!/bin/bash
|
|
|
|
if [ "$#" -ne 2 ]; then
|
|
echo "Usage: ./latex_transform.sh <input_file.tex> <output_file.tex>"
|
|
exit 1
|
|
fi
|
|
|
|
input_file=$1
|
|
output_file=$2
|
|
|
|
# First, transform subsections
|
|
sed -E 's/^([0-9]+\.[0-9]+\.[0-9]+) (.*)/\\subsection{\2}/' $input_file > $output_file
|
|
|
|
# Then, transform sections (note the use of `-i` to modify the output file in place)
|
|
sed -i -E 's/^([0-9]+\.[0-9]+) (.*)/\\section{\2}/' $output_file
|
|
|