i have a little question about the verbatim environment in latex…..
my problem is how can i write “\end{verbatim}” inside of a verbatim environment, it supposed that everything inside a verbatim is written just like it looks but this is the string to end the environment, so how can i do this?
i have a little question about the verbatim environment in latex….. my problem is
Share
I think it might be impossible in a
verbatimenvironment — at least, that’s what Lamport says in the LaTeX book (first paragraph on pg. 64). However, you can do it with the\verbcommand:\verb+\end{verbatim}+works just fine (and in fact, you can use any character instead of+as long as you make them match).That said, the
listingspackage is smart enough to have an escape character. For example,does exactly what you’re looking for. (Again, pick a different character than
+if you’re already using that for something else.)