name: Generate LaTeX Diff with flatex on: workflow_dispatch: inputs: base_branch: description: 'Base branch (older version)' required: true default: 'main' compare_branch: description: 'Compare branch (new version)' required: true default: 'dev' jobs: latexdiff: runs-on: ubuntu-latest steps: - name: Checkout base branch uses: actions/checkout@v4 with: ref: ${{ github.event.inputs.base_branch }} path: base - name: Checkout compare branch uses: actions/checkout@v4 with: ref: ${{ github.event.inputs.compare_branch }} path: compare - name: Install TeX Live and flatex run: | sudo apt-get update sudo apt-get install -y texlive-full pip install flatex - name: Create output directory run: mkdir -p diff_output - name: Flatten base/main.tex run: | flatex base/latex/main.tex > diff_output/base_flat.tex - name: Flatten compare/main.tex run: | flatex compare/latex/main.tex > diff_output/compare_flat.tex - name: Generate diff.tex run: | latexdiff diff_output/base_flat.tex diff_output/compare_flat.tex > diff_output/diff.tex - name: Compile diff.tex to PDF working-directory: diff_output run: | xelatex -interaction=nonstopmode diff.tex xelatex -interaction=nonstopmode diff.tex - name: Upload all diff artifacts uses: actions/upload-artifact@v4 with: name: latex-diff-output path: diff_output/