Finally fixed pdf build script?
This commit is contained in:
@@ -1,23 +1,16 @@
|
||||
#!/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
|
||||
subdirectory_file_name=main
|
||||
|
||||
cd assignments
|
||||
|
||||
for D in *; do
|
||||
if [ -d "${D}" ]; then
|
||||
if [ "${D}" != "template" ] && [ -d "${D}" ]; then
|
||||
echo "Building ${D}..."
|
||||
cd "${D}"
|
||||
pdflatex -interaction=nonstopmode -halt-on-error "${subdirectory_file_name}.tex"
|
||||
pdflatex -interaction=nonstopmode -halt-on-error "${subdirectory_file_name}.tex"
|
||||
cd ..
|
||||
fi
|
||||
done
|
||||
@@ -27,6 +20,14 @@ main_file_name=main_text
|
||||
|
||||
echo "Building main PDF..."
|
||||
pdflatex -interaction=nonstopmode -halt-on-error "${main_file_name}.tex"
|
||||
pdflatex -interaction=nonstopmode -halt-on-error "${main_file_name}.tex"
|
||||
|
||||
# Clean up
|
||||
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