6
votes
1answer
77 views

boxed verbatim environment disappears

I want to center a box containing a verbatim environment. The (almost)MWE below is my attempt to use the answer at center /verbatim text in /figure . \documentclass{article} \usepackage{verbatimbox} ...
2
votes
1answer
127 views

Handle % character in verbatim inside a grey box

I found this snippet on the internet which is used to produce a text area inside a greybox. \newcommand\greybox[1]{% \vskip\baselineskip% \par\noindent\colorbox{lightgray}{% ...
0
votes
0answers
16 views

Using \begin{verbatim} inside an fbox [duplicate]

I can't seem to be able to merge my fbox with my verbatim environment. This is the pseudo-code: \fbox{ \begin{verbatim} Some text other text here . \end{verbatim} }
5
votes
1answer
118 views

difficulties getting lrbox to cooperate with Verbatim environment

This is a follow up to an earlier question of mine: local commands are not recognized when trying to define a wrapper lrbox If I write \documentclass{article} \usepackage{fancyvrb} ...
4
votes
1answer
524 views

lstlisting in a box?

My problem is that I am trying to write a document with coloured sections for examples. Examples can contain code listings. Somehow I can't seem to combine a background colouring with a listing, or ...
10
votes
4answers
774 views

How can I have a verbatim text in specific sized box?

I am trying to typset the following \resizebox{0.95\textwidth}{!}{% \begin{verbatim} require( "lattice" ) require( "grid" ) \end{verbatim} } I have a lot more to add to this box, and it needs ...
3
votes
1answer
360 views

Color box with outline but some difference

\begin{boxedlaw}{6.4in} \colorbox[HTML]{F8E0E0}{ \begin{minipage}[c]{380px} \begin{center} \begine{verbatim} \# define LM_ENCA 18 //Port0 \# define LM_ENCB 17 ...
9
votes
3answers
4k views

How to box verbatim to prevent page break?

If I try \mbox{ \begin{verbatim} Some looooong text... \end{verbatim} } Then some compilation errors occur.
9
votes
2answers
1k views

How do I backcolor in verbatim?

I have some code I want to typeset as verbatim (lstlisting would be ok as well) - but I want to highlight some parts of it via a different background color, i.e. something like this: \begin{verbatim} ...