chirun-ncl / chirun

A Python package providing the command line interface for building flexible and accessible content with Chirun.
https://chirun.org.uk/
Other
30 stars 4 forks source link

LatexSplitter.toc_from_aux doesn't cope with @ commands whose names are shorter than 'writefile' #257

Closed christianp closed 2 months ago

christianp commented 2 months ago

In a document whose content is split across several files, included with \input, the .aux file produced by pdflatex has lines of the form \@input{otherfile.aux} for each of the input files.

The code which looks for \@writefile commands expects everything to be a string, so the argument to \@input causes an error because it's a bgroup object.

We should cope with non-string elements following the @, and also parse the input .aux files because that's where the table of contents entries are.