I’m using PGFPlotsX and LaTeXTabulars to generate PDF reports which include (amongst other things) string comments (user-input via some beyond-my-control GUI) that might contain any of these characters:
"""!@#$%^&*()_-+={[}]|\"':;?/>.<,~`""" # I basically went through the keyboard with/out pressing SHIFT
I need to be able to insert these comments without LaTeX crashing or misinterpreting them in math-mode. I honestly don’t care about how the text will look like (in terms of typography), I just want it to work. I thought about surrounding everything with
"\\detokenize{$x}"
where x contains the suspicious string, but I hear that might not cover all cases?
Is there a way to fix this
- from Julia?
- or if you know, from LaTeX? I couldn’t find anything definitive, but I imagined that warpping every such string in some protective environment might do?
Thanks in advance!