billwarrior
billwarrior copied to clipboard
Category names containing LaTeX control characters blows up invoice generation
Using billwarrior from master on Manjaro Linux stable. And pdfTeX 3.14159265-2.6-1.40.21 (TeX Live 2020/Arch Linux).
Example billwarrior.ini
:
[categories]
logistics.text = This & That
logistics.tags = stuff
logistics.rate = 12345
Resulting billwarrior_items.tex
:
...
\feetype{This & that}
\hourrow{November 20, 2020}{1.0}{12345.00}
...
Resulting pdflatex
error:
! Argument of \check@nocorr@ has an extra }.
<inserted text>
\par
l.23 \feetype{This & that}
The problem is that the &
character is significant to LaTeX and interpreted as a control character unless it's escaped.
In terms of potential solutions, escaping the category name in Python as per one of these answers might solve the problem: https://stackoverflow.com/questions/16259923/how-can-i-escape-latex-special-characters-inside-django-templates