fixing builds of PDFs

This commit is contained in:
2025-11-04 19:31:11 +01:00
parent 84b600c13c
commit 3cf56cfcb9
2 changed files with 4 additions and 3 deletions

View File

@@ -15,7 +15,7 @@ on:
jobs: jobs:
test: test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.event_name != 'push' || github.event.pull_request == null if: github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/main')
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: actions/setup-python@v5 - uses: actions/setup-python@v5

View File

@@ -16,10 +16,11 @@ mkdir -p "$(dirname "$OUTPUT_FILE")"
add_file() { add_file() {
local filepath="$1" local filepath="$1"
local relpath="${filepath#$PROJECT_ROOT/}" local relpath="${filepath#$PROJECT_ROOT/}"
local escaped_path="${relpath//_/\\_}"
# Add section header and code listing (no language-specific highlighting) # Add section header and code listing (no language-specific highlighting)
echo "\\subsection{${relpath}}" >> "$OUTPUT_FILE" echo "\\subsection{${escaped_path}}" >> "$OUTPUT_FILE"
echo "\\begin{lstlisting}[caption={${relpath}}]" >> "$OUTPUT_FILE" echo "\\begin{lstlisting}[caption={${escaped_path}}]" >> "$OUTPUT_FILE"
cat "$filepath" >> "$OUTPUT_FILE" cat "$filepath" >> "$OUTPUT_FILE"
echo "" >> "$OUTPUT_FILE" echo "" >> "$OUTPUT_FILE"
echo "\\end{lstlisting}" >> "$OUTPUT_FILE" echo "\\end{lstlisting}" >> "$OUTPUT_FILE"