mirror of
https://github.com/NohamR/Bibmath2Tex.git
synced 2026-05-24 19:58:43 +00:00
40 lines
968 B
Bash
Executable File
40 lines
968 B
Bash
Executable File
#!/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" |