[texhax] 'verbatim' inside 'raisebox'?

tom sgouros tomfool at as220.org
Thu Jun 11 05:30:17 CEST 2009


Tom:

The short answer is that nothing involving verbatim is simple, because
verbatim sneaks around all the other rules.  I remember there are some
tricks to getting verbatim text into a box, but I don't remember what
they are, though I think they involve some inside hooks into the
verbatim package.  

However poor my memory, I did once know this in order to modify a
package to put verbatim text in a box, and apparently I wrote docstrip
comments in a dtx file to explain it all.  You can get the files at
http://sgouros.com/vcode.dtx and http://sgouros.com/vcode.ins.

Hope this helps, 

 -Tom


T Ziomek <ctz001 at email.mot.com> wrote:

> I need to put pre-formatted text (ala HTML <PRE> or <CODE>) within
> a 'raisebox'.  AFAICT the Tex way to do this is via 'verbatim'
> (though I'd welcome alternative suggestions).  But Tex (specific-
> ally, pdfeTeX, Version 3.141592-1.21a-2.2) fails on the 2nd clos-
> ing '}'.
> 
> My simplest test case:
>   \documentclass{article}
>   \begin{document}
>   \raisebox
>      {-1.5 cm}
>      {
>         \begin{verbatim}
>            Some text
>         \end{verbatim}
>      }
>   \end{document}
> 
> Output:
>   % latex t2.tex
>   This is pdfeTeX, Version 3.141592-1.21a-2.2 (Web2C 7.5.4)
>   entering extended mode
>   (./t2.tex
>   LaTeX2e <2003/12/01>
>   Babel  and hyphenation patterns for american, french, german,
>   ngerman, b ahasa, basque, bulgarian, catalan, croatian, czech,
>   danish, dutch, esperanto, e stonian, finnish, greek, icelandic,
>   irish, italian, latin, magyar, norsk, polis h, portuges,
>   romanian, russian, serbian, slovak, slovene, spanish, swedish,
>   tur kish, ukrainian, nohyphenation, loaded.
>   (/usr/share/texmf/tex/latex/base/article.cls
>   Document Class: article 2004/02/16 v1.4f Standard LaTeX document class
>   (/usr/share/texmf/tex/latex/base/size10.clo))
>   No file t2.aux.
>   
>   ! LaTeX Error: Something's wrong--perhaps a missing \item.
>   
>   See the LaTeX manual or LaTeX Companion for explanation.
>   Type  H   for immediate help.
>    ...                                              
>                                                     
>   l.9    }
>            
>   ? 
> 
> 
> I see the same issue if I include "\usepackage{verbatim}".
> 
> Any suggestions?  Thanks,
> Tom
> 
> 
> I don't think my larger use case matters, but just in case:  I'm using
> the message sequence chart package from
> <http://www.ctan.org/tex-archive/macros/latex/contrib/msc/>.  Some of
> my MSC message flows require formatted text, and 'raisebox' so the
> message line/arrow doesn't overlap the text, so it's on a '\mess' that
> I'm trying to use 'raisebox' and within that 'verbatim'.
> -- 
>   /"\  ASCII Ribbon Campaign   |
>   \ /                          |   Email to user 'CTZ001'
>    X        Against HTML       |             at 'email.mot.com'
>   / \     in e-mail & news     |
> _______________________________________________
> TeX FAQ: http://www.tex.ac.uk/faq
> Mailing list archives: http://tug.org/pipermail/texhax/
> More links: http://tug.org/begin.html
> 
> Automated subscription management: http://tug.org/mailman/listinfo/texhax
> Human mailing list managers: postmaster at tug.org
> 


-- 
 ------------------------
 tomfool at as220 dot org
 http://sgouros.com  
 http://whatcheer.net


More information about the texhax mailing list