# Tag Info

22

The tcolorbox package can nicely display literal LaTeX code and its output when being called in a very configurable manner, depending on the argument of the tcblisting environment. This environment displays by default LaTeX code literally but the coding/scripting etc. language can be changed to anything known to the underlying listings package too. (or ...

7

If it is Document type definitions that you want, Pygments has support for it and produces a very neat output imo. For LaTeX documents you can harness it easily with the minted-package, e.g.: \documentclass{article} \usepackage{minted} \usemintedstyle{autumn} \begin{document} \begin{minted}{dtd} <!-- TEI P4 DTD. Generated 2004-07-15T16:23:29-04:00 ...

6

biblatex has the aptly named field type verbatim that might fit the bill here. The documentation states (p. 14) Verbatim fields are processed in verbatim mode and may contain special characters. Typical examples of verbatim fields are file and doi. So all we need to do is make title a verbatim field via ...

5

Here is a version with tcbverbatimwrite from tcolorbox -- there's no need to load another verbatim package, since tcolorbox is already active. Inside of \AD the \end{tcbverbatimwrite} should be a string rather than the token \end{tcbverbatimwrite}, so \scantokens{...} is necessary. This code does not work however for the VerbatimOut approach. ...

3

Here is an alternative approach to answer the question. The tcolorbox package supports the saving of lower box parts into files. So, here the answers are written after \tcblower. For this, an environment should be used. The saving is done by savelowerto=answer_document_\thetcbcounter.tex, To hide the lower part use lowerbox=ignored, As a further ...

3

I'd recommend using the listings package for this; it's considerably more flexible. For example, you can specify \lstset{breaklines=true} in the preamble to prevent lines from overrunning the margins. Here's a basic way to do it. \documentclass{article} \usepackage{listings} \lstset{ basicstyle=\footnotesize\ttfamily, % specifies that lines ...

1

\end{frame} must start at the beginning of the line. You have \begin{document} \begin{frame}[fragile] Hello World \end{frame} \end{document} use \begin{document} \begin{frame}[fragile] Hello World \end{frame} \end{document}

1

As I mentioned in comments to Steven's answer, I ended up writing a program to transform for example \myVerb+abc$\+ into \myVerb{abc\$\textbackslash } that is, escape characters and use {} as delimiters. That way I can dispose of verbatim and use \newcommand{\myVerb}[1]{{\ttfamily\color{fgcolor}{\hl{#1}}}} i.e. the third "solution" in my question. ...

Only top voted, non community-wiki answers of a minimum length are eligible