olivierverdier / python-latex-highlighting

LaTeX style for Python highlighting
BSD 3-Clause "New" or "Revised" License
453 stars 125 forks source link

Update pythonhighlight.sty #15

Closed albarron closed 6 months ago

albarron commented 6 months ago

adding \UseRawInputEncoding to prevent latex errors related to UTF-8 or the type:

! Package inputenc Error: Invalid UTF-8 byte sequence. This happens in the following snippet (inside of a beamer project with UTF8 encoding):

\begin{python}

define a function

def add_one(n): return n + 1

run the function specifying 41 as input

result = add_one(41)​

print the result stored in the variable result

print(result) \end{python}