Skip to content

Energieeffizienz

Energieeffizienz #26

Workflow file for this run

name: LaTeX Build
on:
push:
paths:
- '**/*.tex'
pull_request:
paths:
- '**/*.tex'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Install LaTeX
run: sudo apt-get install texlive-full
- name: Compile LaTeX Documents
run: |
for file in $(find . -name '*.tex'); do
# Check if the file contains \documentclass (indicating a standalone document)
if grep -q '\\documentclass' "$file"; then
# Change directory to the file's location
cd "$(dirname "$file")"
# Compile the LaTeX document
xelatex -halt-on-error "$(basename "$file")"
if [ $? -ne 0 ]; then
echo "Compilation failed for $file"
exit 1
fi
# Return to the root directory
cd - > /dev/null
else
echo "Skipping $file as it is not a standalone document."
fi
done