Discussion:
Minipage, side by side in tabular??
(too old to reply)
Martin Jørgensen
2004-10-24 13:52:41 UTC
Permalink
Hello everybody.

I´m trying to learn a bit of Latex from time to time. I´m getting an
error message, which appeared when I tried to experiment with the
example in the lshort2e.pdf, page 88 (I´m trying to extend the example
with minipages, side by side). Please explain to me what I´m doing wrong.

The error says:

l.73 \fbox
{\parbox[c][\height+\baselineskip][s]{40mm}{
?

! LaTeX Error: Illegal character in array arg.


It worked before I tried to add the minipage side-by-side-code.

I found something on google with minipages in a tabular environment, but
that lead to the parbox error (which wasn´t there before).

I have this:


\documentclass{article}
\usepackage{amsmath,verbatim,calc}
\begin{document}
.....


\begin{table}

% MINIPAGE LEFT

\begin{minipage}[t]{\textwidth/2-1cm}
\caption{Left table. Compare with the other one.}

\begin{tabular}
\fbox{\parbox[c][\height+\baselineskip][s]{40mm}{
%\raisebox{0pt}[0pt][0pt]{\Large%
\textbf{Aaaa\raisebox{-0.3ex}{a}%
\raisebox{-0.7ex}{aa}%
\raisebox{-1.2ex}{r}%
\raisebox{-2.2ex}{g}%
\raisebox{-4.5ex}{h}}%}
he shouted but not even the next
one in line noticed that something
terrible had happened to her.
}}
\end{tabular}

\end{minipage}


\hfill


% MINIPAGE RIGHT

\begin{minipage}[t]{\textwidth/2-5ex}
\caption{Right table. Compare with the first one.}

\begin{tabular}
\fbox{\parbox[c][\height+\baselineskip][s]{40mm}{
\raisebox{0pt}[0pt][0pt]{\Large%
\textbf{Aaaa\raisebox{-0.3ex}{a}%
\raisebox{-0.7ex}{aa}%
\raisebox{-1.2ex}{r}%
\raisebox{-2.2ex}{g}%
\raisebox{-4.5ex}{h}}}
he shouted but not even the next
one in line noticed that something
terrible had happened to her.
}}
\end{tabular}

\end{minipage}


\end{table}


\end{document}


How do I make the two boxes appear side by side??? I´m not even sure
that the table/tabular environment is the right thing to do but without
it, the minipages were on top of each other...


Regards,
Martin Jørgensen
--
---------------------------------------------------------------------------
Home of Martin Jørgensen - http://www.martinjoergensen.dk
Herbert Voss
2004-10-24 14:29:18 UTC
Permalink
Post by Martin Jørgensen
\documentclass{article}
\usepackage{amsmath,verbatim,calc}
\begin{document}
.....
\begin{table}
% MINIPAGE LEFT
\begin{minipage}[t]{\textwidth/2-1cm}
\caption{Left table. Compare with the other one.}
\begin{tabular}
\begin{tabular}{c} % the columns are defined in the second argument
Post by Martin Jørgensen
\fbox{\parbox[c][\height+\baselineskip][s]{40mm}{
nonsense here together with a one column tabular
Post by Martin Jørgensen
%\raisebox{0pt}[0pt][0pt]{\Large%
\textbf{Aaaa\raisebox{-0.3ex}{a}%
\raisebox{-0.7ex}{aa}%
\raisebox{-1.2ex}{r}%
\raisebox{-2.2ex}{g}%
\raisebox{-4.5ex}{h}}%}
he shouted but not even the next
one in line noticed that something
terrible had happened to her.
}}
\end{tabular}
\end{minipage}
\hfill
and empty line starts a new paragraph.

Herbert



\begin{table}
% MINIPAGE LEFT
\begin{minipage}[t]{\textwidth/2-1cm}
\caption{Left table. Compare with the other one.}
\fbox{\parbox[c][\height+\baselineskip][s]{40mm}{
%\raisebox{0pt}[0pt][0pt]{\Large%
\textbf{Aaaa\raisebox{-0.3ex}{a}%
\raisebox{-0.7ex}{aa}%
\raisebox{-1.2ex}{r}%
\raisebox{-2.2ex}{g}%
\raisebox{-4.5ex}{h}}%}
he shouted but not even the next
one in line noticed that something
terrible had happened to her.
}}
\end{minipage}
\hfill
% MINIPAGE RIGHT
\begin{minipage}[t]{\textwidth/2-5ex}
\caption{Right table. Compare with the first one.}
\fbox{\parbox[c][\height+\baselineskip][s]{40mm}{
\raisebox{0pt}[0pt][0pt]{\Large%
\textbf{Aaaa\raisebox{-0.3ex}{a}%
\raisebox{-0.7ex}{aa}%
\raisebox{-1.2ex}{r}%
\raisebox{-2.2ex}{g}%
\raisebox{-4.5ex}{h}}}
he shouted but not even the next
one in line noticed that something
terrible had happened to her.
}}
\end{minipage}
\end{table}
--
http://TeXnik.de/
http://PSTricks.de/
ftp://ftp.dante.de/tex-archive/info/math/voss/Voss-Mathmode.pdf
http://www.dante.de/faq/de-tex-faq/
http://www.tex.ac.uk/cgi-bin/texfaq2html?introduction=yes
Martin Jørgensen
2004-10-24 19:47:58 UTC
Permalink
Herbert Voss wrote:

-snip-
Post by Martin Jørgensen
}}
\end{minipage}
\end{table}
Cool, thanks a lot (especially for the complete working code).

Now, I think the caption text is a bit too close to the fbox or
parbox... How do I add some extra space here?

As you can see, I don´t have much experience with Latex...


Regards,
Martin Jørgensen
--
---------------------------------------------------------------------------
Home of Martin Jørgensen - http://www.martinjoergensen.dk
Herbert Voss
2004-10-24 20:08:52 UTC
Permalink
Post by Martin Jørgensen
Now, I think the caption text is a bit too close to the fbox or
parbox... How do I add some extra space here?
after \begin{minipage}

\addtolength\belowcaptionskip{5pt}

and in the second one

\addtolength\belowcaptionskip{15pt}


Herbert
--
http://TeXnik.de/
http://PSTricks.de/
ftp://ftp.dante.de/tex-archive/info/math/voss/Voss-Mathmode.pdf
http://www.dante.de/faq/de-tex-faq/
http://www.tex.ac.uk/cgi-bin/texfaq2html?introduction=yes
Martin Jørgensen
2004-10-25 18:59:53 UTC
Permalink
Post by Herbert Voss
Post by Martin Jørgensen
Now, I think the caption text is a bit too close to the fbox or
parbox... How do I add some extra space here?
after \begin{minipage}
\addtolength\belowcaptionskip{5pt}
and in the second one
\addtolength\belowcaptionskip{15pt}
Hey, thanks a lot... It works like a charm.


Med venlig hilsen / Best regards
Martin Jørgensen
--
---------------------------------------------------------------------------
Home of Martin Jørgensen - http://www.martinjoergensen.dk
Loading...