Graphics, Figures & Tablestable experiments

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
hycheah
Posts: 1
Joined: Tue Nov 16, 2010 4:34 pm

table experiments

Post by hycheah »

Hi,

I am experimenting with tables in latex. But I can't figure out what is wrong here.

Code: Select all

\documentclass{article}

\usepackage{verbatim}

\begin{document}

\begin{center}
\begin{tabular}{| p{10cm} |}
\hline
\begin{verbatim}
Welcome to Boxy’s paragraph.
We sincerely hope you’ll
all enjoy the show.\\
\end{verbatim}
\hline
\end{tabular}
\end{center}

\end{document}
The error thrown in texworks is:
15 !Misplaced \noalign

Thanks!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
bev
Posts: 20
Joined: Wed Nov 10, 2010 10:02 am

table experiments

Post by bev »

I haven't double-checked, but I'm pretty sure that you can't use verbatim (which tells tex not do do any aligning) in a tabular env (which is all about aligning).

Try this:

Code: Select all

\parbox{10cm}{%
\hrule
\begin{verbatim}
Welcome to Boxy’s paragraph.
We sincerely hope you’ll
all enjoy the show.\\
\end{verbatim}
\hrule
}
Post Reply