CC: | moritz [...] faui2k3.org, allison [...] parrot.org |
Subject: | Markup in verbatim environment isn't translated correctly |
With the $parser->codes_in_verbatim(1) option active,
Pod::PseudoPod::LaTeX should render markup like B<...> in =begin
programlisting ... =end programlisting blocks. However it currently
translates that to
\begin{verbatim}
some code with \textbf{bold} text
\begin{verbatim}
where latex renders the \textbf verbatim.
The fancyvrb allows rendering of arbitrary commands inside verbatim
environments, so the emitter should produce this instead:
\begin{Verbatim}[commandchars=\\\{\}]
some code with \textbf{bold} text
\begin{Verbatim}
(yes, ucfirst Verbatim)
Inside such an environment, a backslash should be escaped as
\textbackslash{}, { and } as \{ and \}
The attached file is a complete, working latex document which shows
markup in verbatim environments, including a prelude which these
Verbatim environments need.
Subject: | verb.tex |
\NeedsTeXFormat{LaTeX2e}
\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{fancyvrb}
% the normal 'Computer Modern' font doesn't have a bold monospace variant,
% so we need another font, which in turn needs fontenc. See
% http://wbillingsley.blogspot.com/2008/06/latex-monospace-bold-computer-modern.html
% for details
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage[scaled]{beramono}
\author{Moritz Lenz}
\title{Control sequences in Verbatim environments}
\begin{document}
\maketitle
\begin{Verbatim}[commandchars=\\\{\}]
This is a Verbatim environment
With some \fbox{boxed} and \textbf{bold} text
When you want to write a literal backslash,
use \textbackslash{}for it.
Braces \{need to be backslash-escaped\} too
\end{Verbatim}
\end{document}
% vim: ts=4 sw=4 expandtab spell spelllang=en_us