marinebiokitty / GL2020

Grand Larp 2020 for LRS
4 stars 4 forks source link

Gametex.pl doesn't work with \usepackage statements #10

Open APCBoston opened 1 year ago

APCBoston commented 1 year ago

The gametex.pl from Ken's GameTex doesn't work correctly when any of the individual {character,green,blue} sheets to be printed includes \usepackage statements. Because Ken constructs a single LaTeX file incorporating all of the individual sheets, LaTeX requires the \usepackage statements to be in the root document -- the one constructed by the script.

These can be identified globally with the following shell script:

do 
  for file in $(ls |grep \.tex)
  do 
    grep -P "\\\\usepackage" $directory/$file
  done
done 

One option is to rewrite gametex.pl to search as above for \usepackage statements and incorporate them into the generated LaTeX code. I will probably reproduce the relevant operation of gametex.pl in Python with the above inclusion rather than hacking the Perl script, for the sake of creating a single complete frontend.