I'm using verbatim to print directly a piece of code from input to output. I understand that the verbatim environment should process directly anything passed to it. But it seems it depends on the encoding used, both for input and output.
The problem arises with the symbol "¬" (logical negation), which makes LaTeX think a '$' is missing and tries to insert it, even though I'm in the verbatim environment. And it does print it, but the rest of the line looses it's typewriter font.
Later on, I discovered that not specifying an input encoding the problem disappeared (I was using
\usepackage[latin1]{inputenc}
, because the rest of the document is in Spanish). The compilation process ended successfully, but instead of printing de "¬" symbol, it printed a "ň" symbol (an "n" with a reversed circumflex accent). I think this is quite a strange behaviour for verbatim.Here is what I think could be a minimum working example for the problem:
Code: Select all
\documentclass[spanish]{report}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc} % Comment this line to see the other scenario.
\usepackage{babel}
\begin{document}
\begin{verbatim}
I'm typewrited.
¬ <- This is the problem. (And I am not typewrited).
I'm typewrited too.
\end{verbatim}
\end{document}
Thank you all in advance,
Ricardo Monascal