This commit is contained in:
√(noham)²
2025-04-14 00:46:41 +02:00
parent 1135b4ddac
commit 85b53eda9d
57 changed files with 138 additions and 23 deletions

40
gen.sh Executable file
View File

@@ -0,0 +1,40 @@
#!/bin/bash
# Configuration
DUMP_DIR="dump"
OUTPUT_DIR="output"
TEX_CMD="pdflatex"
# Create output directory if it doesn't exist
mkdir -p "$OUTPUT_DIR"
# Check if dump directory exists
if [ ! -d "$DUMP_DIR" ]; then
echo "Error: $DUMP_DIR directory does not exist"
exit 1
fi
# Process all .tex files in the dump directory
echo "Processing .tex files from $DUMP_DIR..."
for tex_file in "$DUMP_DIR"/*.tex; do
# Check if there are any .tex files
if [ ! -f "$tex_file" ]; then
echo "No .tex files found in $DUMP_DIR"
exit 0
fi
filename=$(basename "$tex_file")
echo "Processing $filename..."
# Run pdflatex
$TEX_CMD -output-directory="$OUTPUT_DIR" "$tex_file"
# Check if successful
if [ $? -eq 0 ]; then
echo "Successfully generated PDF for $filename"
else
echo "Error generating PDF for $filename"
fi
done
echo "All processing complete. Output files are in $OUTPUT_DIR"