This project provides a Python tool to automatically convert JFLAP (.jff) Turing Machine files into high-quality LaTeX (.tex) diagrams using TikZ. It also includes a collection of manually crafted Turing Machine examples.
Easily turn your JFLAP designs into publication-ready LaTeX diagrams.
- Prerequisite: Ensure you have Python installed.
- Run the script:
Example:
python3 converter.py <path_to_input.jff>
This generates apython3 converter.py src/test.jff
.texfile in the same directory as the input (e.g.,src/test.tex).
- Automatic Scaling: Converts pixel coordinates to LaTeX cm coordinates.
- Layout Preservation: Flips logic to match JFLAP's visual layout.
- Smart Edges: Automatically bends bidirectional edges to prevent overlap.
- Math Mode: Correctly formats symbols like
\square(blank).
A collection of handwritten examples is also available in src/.
| File | Description |
|---|---|
tm-example-template.tex |
Basic TM template with tape visualization |
tm-equal-ab-count.tex |
Decider TM for L = { w ∈ {a,b}* | nₐ(w) = n_b(w) } |
tm-unequal-ab.tex |
Decider TM for L = { aᵐbⁿ | m ≠ n } |
- Python 3.x (for the converter)
- LaTeX Distribution (TeX Live, MiKTeX, or MacTeX)
- LaTeX Packages:
tikz(libraries:automata,positioning,arrows,shapes,calc)amssymbgeometry
Compile any .tex file (generated or example) using:
pdflatex src/test.tex
For a small repo like this, the contribution process is intentionally lightweight:
- See CONTRIBUTING.md for focused PR guidance
- See SUPPORT.md for troubleshooting and FAQ notes
- See SECURITY.md for private vulnerability reporting
- See CODE_OF_CONDUCT.md for collaboration expectations
Issue forms and a pull request template are included under .github/ to keep reports reproducible without overcomplicating the project.
MIT License - see LICENSE for details.




