I want to format a string using variables. I am aware of the %
and the .format()
options.
However, as the string I want to format is a piece of LaTeX
code, I chose to use the outdated %
-version since there are already {
and }
characters in my code. (And I don't want to escape them because the code will be frequently updated).
My issue is : when I run my code, I get this error :
TypeError: not enough arguments for format string
I use a dictionary to define the variables, and they are all defined. As far as I understood it, it might come from the %
character used for comments in LaTeX
and that could be mis-interpreted in python.
How could I manage this?