## LaTeX forum ⇒ Text Formatting ⇒ Escape Character in custom Python Code Block

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
geolykos
Posts: 1
Joined: Thu Aug 15, 2013 6:33 pm

### Escape Character in custom Python Code Block

Hello,

I wanted to put some Python code in my text so I found a custom made Python highlighting file from here. It works great and I even changed most colors etc. but I have a problem with the escape character ($). Some code I need in my report is a template code which means I use Python for reference plus other commands. An example: \begin{python}% if interface.exists:ip route${interface.loopback} ${interface.subnet}${interface.destination}\end{python}

In this code the % and $ symbols declare Python references but the problem is that the $ are 3 so the rest of my text from there on becomes green like in escape mode. I tried \$ but this custom file is like verbatim and everything you type is shown as normal. It should ore look like this. % if interface.exists:ip route${interface.loopback} ${interface.subnet}${interface.destination}
Last edited by cgnieder on Fri Aug 16, 2013 5:08 pm, edited 1 time in total.

Tags:

### Who is online

Users browsing this forum: No registered users and 6 guests