Overview
The IITJ MTP Template Generator includes automatic LaTeX compilation through GitHub Actions. When you push .tex files to your repository, they are automatically compiled to PDF and made available as downloadable artifacts.
How It Works
Automatic Compilation
The workflow triggers automatically when:
- You push changes to
.texfiles in theoutput/directory - Changes are pushed to the
mainormasterbranch
Supported Report Types
All three report types are automatically detected and compiled:
- Proposal Reports (
proposal.tex) - Major Project Reports (
main.tex) - Presentation Slides (
slides.tex)
Using Auto-Compilation
Setup (One-Time)
-
Fork or clone this repository to your GitHub account
-
Generate your report using the generator:
python scripts/generate.py --config my-config.yaml -
Commit and push the generated files:
git add output/ git commit -m "Add my project report" git push origin main -
Wait for compilation - GitHub Actions will automatically compile your LaTeX files
Downloading Compiled PDFs
- Go to your repository on GitHub
- Click the Actions tab
- Click on the latest “Compile LaTeX to PDF” workflow run
- Scroll down to Artifacts
- Download
compiled-pdfs-{number}.zip - Extract the ZIP file to get your PDFs
Manual Compilation
You can also trigger compilation manually:
- Go to Actions tab in your repository
- Click “Compile LaTeX to PDF” in the left sidebar
- Click “Run workflow” button
- Select the branch
- Click “Run workflow”
Workflow Details
Compilation Process
For each LaTeX file found, the workflow:
- First Pass:
pdflatex -interaction=nonstopmode file.tex - Bibliography:
bibtex file(if.bibfiles exist) - Second Pass:
pdflatex -interaction=nonstopmode file.tex - Third Pass:
pdflatex -interaction=nonstopmode file.tex(for references/TOC)
Artifact Retention
- Retention Period: 30 days
- Artifact Name:
compiled-pdfs-{run-number} - Contents: All PDF files from
output/directory
Troubleshooting
No PDFs Generated
Check the workflow logs:
- Go to Actions tab
- Click on the failed workflow run
- Expand the “Find and compile LaTeX files” step
- Look for compilation errors
Common issues:
- LaTeX syntax errors in your
.texfiles - Missing packages or dependencies
- Bibliography errors (missing
.bibfile or citations)
Compilation Warnings
Warnings are normal and don’t prevent PDF generation. The workflow uses -interaction=nonstopmode to continue compilation even with warnings.
Workflow Not Triggering
Verify:
- Changes are in
output/**/*.texfiles - Pushing to
mainormasterbranch - Workflow file exists at
.github/workflows/compile-latex.yml
Advanced Configuration
Customizing the Workflow
You can modify .github/workflows/compile-latex.yml to:
- Change artifact retention period (line with
retention-days) - Add additional LaTeX packages to install
- Modify compilation commands
- Add post-processing steps
Example: Adding Custom Packages
Edit the “Install LaTeX” step:
- name: Install LaTeX
run: |
sudo apt-get update
sudo apt-get install -y \
texlive-latex-base \
texlive-latex-extra \
texlive-bibtex-extra \
texlive-fonts-extra \ # Add this
texlive-science \ # Add this
biber
Status Badge
Add the compilation status badge to your README:
[](https://github.com/YOUR-USERNAME/YOUR-REPO/actions)
Replace YOUR-USERNAME and YOUR-REPO with your GitHub username and repository name.
Benefits
✅ Automatic PDF Generation - No need to install LaTeX locally
✅ Version Control - Every commit gets compiled
✅ Collaboration - Team members can download PDFs without LaTeX
✅ Consistent Environment - Same LaTeX version for everyone
✅ Free - GitHub Actions provides free minutes for public repositories
Limitations
- Build Time: Compilation takes 2-5 minutes depending on document complexity
- Free Tier: GitHub provides 2,000 minutes/month for free (public repos)
- File Size: Artifacts are limited to 2GB per repository
- Retention: Artifacts are deleted after 30 days (configurable)
FAQ
Q: Can I compile locally instead?
A: Yes! The workflow doesn’t replace local compilation. See the main README for local compilation instructions.
Q: How do I disable auto-compilation?
A: Delete or rename .github/workflows/compile-latex.yml
Q: Can I compile on pull requests?
A: Yes, modify the workflow’s on: section to include pull_request
Q: What if compilation fails?
A: Check the workflow logs for errors. The workflow continues even if one file fails, so other PDFs may still be generated.
Need Help? Open an issue on GitHub