billwarrior icon indicating copy to clipboard operation
billwarrior copied to clipboard

Category names containing LaTeX control characters blows up invoice generation

Open witten opened this issue 3 years ago • 0 comments

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

witten avatar Nov 20 '20 20:11 witten