Simple, didactic TeX
miniTeX is a simple text formatting language intended to illustrate the basics of languages such as TeX. This repository contains the code for the compiler of the language. The grammar can be found in notes.md
.
Example source file:
Corresponding output file:
My code is written in C11. I have made use of the Flex and Bison tools for lexical analysis and parser generation.
The instructions below are for the GCC C compiler.
The example input file is example_source_file.txt
and the output file is output1.txt
.
It is assumed that environment variables for make, Flex, Bison and GCC are configured correctly and that the programs can be called from within the command line.
Linux & macOS:
Use the shell to navigate to the miniTeX directory then execute the following commands…
make # generate miniTeX.exe
make clean # delete auto-generated files
miniTeX ExampleSourceFile.txt output.txt
Windows:
The makefile runs shell commands. This is not supported by Microsoft’s “nmake” nor by MinGW’s make. Make sure that you use MSYS’s make instead.
(To download MSYS, visit https://www.msys2.org/)
Open cmd and navigate to the directory with the miniTeX files then execute the following commands…
make # generate miniTeX.exe
make clean # delete auto-generated files
miniTeX ExampleSourceFile.txt output.txt
- 1.1
- Made miniTeX cross-platform
- 1.0
- The first working release