I thought I understood backslash escaping, but I don't get this behaviour:
foo = '\t'
gives the same string (i.e. \t
) when I type foo
in the Python interpreter, whereas
bar = '\i'
gives \\i
. What's happening? I want to have just \i
, because I'm writing it to a .tex
file that I'm then compiling, and this seems to mess up the LaTeX commands.
Edit: it was in fact not this that was messing up my latex, as the answers below show