Finally fixed pdf build script?
This commit is contained in:
@@ -1,23 +1,16 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Check if necessary packages are installed
|
|
||||||
necessary_packages=("pdflatex")
|
|
||||||
|
|
||||||
for package in "${necessary_packages}"; do
|
|
||||||
if ! [dpkg -l "${package}" > /dev/null]; then
|
|
||||||
echo "Error: ${package} is not installed."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# Build all directories
|
# Build all directories
|
||||||
subdirectory_file_name=main
|
subdirectory_file_name=main
|
||||||
|
|
||||||
|
cd assignments
|
||||||
|
|
||||||
for D in *; do
|
for D in *; do
|
||||||
if [ -d "${D}" ]; then
|
if [ "${D}" != "template" ] && [ -d "${D}" ]; then
|
||||||
echo "Building ${D}..."
|
echo "Building ${D}..."
|
||||||
cd "${D}"
|
cd "${D}"
|
||||||
pdflatex -interaction=nonstopmode -halt-on-error "${subdirectory_file_name}.tex"
|
pdflatex -interaction=nonstopmode -halt-on-error "${subdirectory_file_name}.tex"
|
||||||
|
pdflatex -interaction=nonstopmode -halt-on-error "${subdirectory_file_name}.tex"
|
||||||
cd ..
|
cd ..
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@@ -27,6 +20,14 @@ main_file_name=main_text
|
|||||||
|
|
||||||
echo "Building main PDF..."
|
echo "Building main PDF..."
|
||||||
pdflatex -interaction=nonstopmode -halt-on-error "${main_file_name}.tex"
|
pdflatex -interaction=nonstopmode -halt-on-error "${main_file_name}.tex"
|
||||||
|
pdflatex -interaction=nonstopmode -halt-on-error "${main_file_name}.tex"
|
||||||
|
|
||||||
# Clean up
|
# Clean up
|
||||||
rm -rf *.aux *.log *.out *.toc
|
rm -rf *.aux *.log *.out *.toc
|
||||||
|
for D in *; do
|
||||||
|
if [ "${D}" != "template" ] && [ -d "${D}" ]; then
|
||||||
|
cd "${D}"
|
||||||
|
rm -rf *.aux *.log *.out *.toc
|
||||||
|
cd ..
|
||||||
|
fi
|
||||||
|
done
|
||||||
Reference in New Issue
Block a user