neldredge / mathgen

Generate random nonsense math papers
https://thatsmathematics.com/mathgen/
GNU General Public License v2.0
561 stars 72 forks source link

Make Latex Build in Code optional #12

Open AitzazImtiaz opened 2 years ago

AitzazImtiaz commented 2 years ago

To avoid user to download extra, un-necessary Latex packages, is it possible that MathGen just generates the Latex files with Perl and end the job? That'd be nice.

neldredge commented 2 years ago

You can run mathgen with the --dir=/foo/bar option, which will leave the source files in the /foo/bar directory (or --dir=. for the current directory). It will then attempt to run pdflatex on them, which will fail if you don't have it installed or are missing packages, but you could just ignore the error; the source files will still be there.

The option --mode=raw --output=file.tex will write the LaTeX source to file.tex and not attempt to run pdflatex at all, but it doesn't output the .bib file.

If you want to add such an option properly, it would just be a matter of having the program exit right after: https://github.com/neldredge/mathgen/blob/12f5e6056fd60fcfff530da8ffda846ee15f9549/mathgen.pl#L355

AitzazImtiaz commented 2 years ago

Ty 😃 it helps