Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

verbatim in tabular

548 views
Skip to first unread message

achin

unread,
Aug 4, 2004, 11:36:26 PM8/4/04
to
i'm transcribing a text document into a LaTeX document, and in this
document there are bit and chunks of code in boxes. i'm trying to get
this verbatim code to be surounded by a box in my LaTeX document.

right now, i'm trying to use a table. for short pieces of code, i can
\verb each line:

\begin{tabular}{|l|}
\hline
\verb|code line 1...| \\
\verb|code line 2...| \\
\verb|etc. etc| \\
\hline
\end{tabular}

that's fine with short pieces of code, but i a several longer pieces. i
would like to be able to do this:

\begin{tabular}{|l|}
\hline
\begin{verbatim}
code 1
code 2
\end{verbatim} \\
\hline
\end{tabular}

but LaTeX won't let me do that.

Can i do that, or should i not being using a tabular for this?
any suggestions?

Thanks

--
Andrew Chin | ac...@eminence32.cjb.net | GPG key DF5F2015

Ulrike Fischer

unread,
Aug 5, 2004, 4:01:24 AM8/5/04
to
achin <ac...@eminence32.cjb.net> schrieb:

> i'm transcribing a text document into a LaTeX document, and in this
> document there are bit and chunks of code in boxes. i'm trying to get
> this verbatim code to be surounded by a box in my LaTeX document.
>
> right now, i'm trying to use a table.
>

> Can i do that, or should i not being using a tabular for this?
> any suggestions?
>

package boxedminipage, package fancyvrb, package listings

http://www.tex.ac.uk/cgi-bin/texfaq2html?label=verbwithin


--
Ulrike Fischer
e-mail: zusätzlich meinen Vornamen vor dem @ einfügen.
e-mail: add my first name between the news and the @.

Saravanan,M.

unread,
Aug 5, 2004, 8:01:42 AM8/5/04
to
Hi

Try with the following command instead of using verbatim

\usepackage{alltt}

\begin{alltt}
...
\end{alltt}

Best of Luck
Saravanan,M.


achin <ac...@eminence32.cjb.net> wrote in message news:<Pine.LNX.4.60.04...@bigbox.home>...

0 new messages