# Latex: minipage for list and table side-by-side

1. ### gsal

Say, I am trying to learn how to use minipage but there is some space on top of the table that seems to be coming from nowhere...any idea what might be going on? The huge space is still there even when I remove vspace 10pt, besides, 10pt is not that much...anyway.

thanks,

gsal

Code (Text):

\begin{minipage}[b]{0.58\textwidth}
\begin{itemize}
\item Blower flow=1.951 $kg/s$ and uses profiles from equivalent blower model for velocities, temperatures, and turbulence quantities.  The resulting static pressure plus axial velocity head is 4599$Pa$.
\item Vent scoop flow=0.145 $kg/s$ at Tt=334.8$K$.
\item Rotor flow=0.45327 $kg/s$.
\item Static pressure in endbox=3848.7 $Pa$.
\item For stator finger and stator exhaust vents Ps=1051 $Pa$ (the value reported back is 1049.94).
\item For stator intake vents Pt=3741.92 $Pa$.
\item Sector angle for model is 20 deg.
\end{itemize}
\vspace*{10pt}
\end{minipage}
\hspace{0.5cm}
\begin{minipage}[b]{0.15\textwidth}
\begin{tabular}{|p{1.5cm}|p{2cm}|p{1.cm}|}
\hline
Rotor Vent No. & Radial mass flow ($kg/s$) & Tt ($K$) \\
\hline
1   & 0.014816  & 332.4 \\
2   & 0.014453  & 332.2 \\
3   & 0.013824  & 332.1 \\
4   & 0.013304  & 332.0 \\
5   & 0.012819  & 332.0 \\
6   & 0.012415  & 331.9 \\
7   & 0.012082  & 331.9 \\
8   & 0.011662  & 331.9 \\
9   & 0.011328  & 331.9 \\
10  & 0.011072  & 331.8 \\
11  & 0.010860  & 331.8 \\
12  & 0.010585  & 331.7 \\
13  & 0.010406  & 331.7 \\
14  & 0.010309  & 331.7 \\
15  & 0.010318  & 331.7 \\
16  & 0.010284  & 331.8 \\
17  & 0.010206  & 331.8 \\
18  & 0.010210  & 331.8 \\
19  & 0.010255  & 331.8 \\
20  & 0.010340  & 331.7 \\
21  & 0.010465  & 331.7 \\
22  & 0.010622  & 331.6 \\
23  & 0.010808  & 331.5 \\
24  & 0.010961  & 331.4 \\
25  & 0.011113  & 331.3 \\
26  & 0.011271  & 331.2 \\
27  & 0.011430  & 331.1 \\
\hline
\end{tabular}
\end{minipage}

File size:
43.1 KB
Views:
31
2. ### AlephZero

7,298
You need to understand how TeX builds a page from "boxes and glue".

For normal text, you don't need to bother much about that, because each letter in the font is enclosed by a box that is the right size and shape to fit together properly.

But effectively, you have a "line of text" consisting of a minipage, some space (\hspace), and another minipage. TeX treats each minipage as a single "box" when it is figuring out how to build the line.

Every box has a "baseline position" and TeX adjusts their vertical positions so the baselines match up.

You can set where the baseline is relative to the box with the [m] or [t] options of the minipage. These set the baseline to the bottom, middle, or top of the minipage. Probably you want both to be [t] or both [m], but play around with all the options to see what is going on.

While playing, replace the \hspace between the minipages by a bit of ordinary text, so you can see where TeX is putting the baseline of the complete line.

Your \vspace* inside the first minipage seems like a bad move, because it adds space to the bottom of the minipage and make the alignment even worse. A bigger amount of \vspace at the end of the second minipage might be a different way to fix the problem.

3. ### gsal

Thanks for the hints, they did help, including adding ordinary text to see how the minipages alignment relate to the line.

As you may have noticed, though, the second minipage contains a 'tabular' environment...I removed the table, put ordinary text, played around with widths and alignments and it seems to me that the "tabular" enviroment does not quite honor the minipage alignment option...the table seems to always be vertically centered with the line....

...is this clear? and most importantly...does it make sense to you?

4. ### AlephZero

7,298
Hm... I played around with your code before I made the post, and I didn't see anything strange from the tabular environment (nor did I expect to).

IIRC "tabular" also has an option to set its top/middle/bottom position, but that should be irrelevant because there is nothing else inside the minipage, and the tabular environment shouldn't leak "outside" the minipage whatever happens.

Try putting \hrule at the top and bottom of your minipages, to see where the space is coming from.

It's possible that "itemize" is adding some white space at the top and bottom, not "tabular".

If all else fails, "negative spaces" like \vspace*{-10pt} are legal.

Or, you could try something like
Code (Text):

begin{tabular}{@{}p{0.58\textwidth)@{\hspace{0.5cm}}p{0.15\textwidth}@{}}
\begin{itemize}
...
\end{itemize} &
{\begin{tabular}
...
\end{tabular}}
\end{tabular}

You can nest tabular environments, but note the extra pair of { } around the nested one. Mostly I use an document class that has its own version of the tabular environments, and I can't remember if the extra { } are needed with the "standard" tabular, but they won't do any harm.

5. ### gsal

Oh, just re-read your post and noticed the full contents of it...yes, I ended up "fixing" the problem by increasing vspace in the first minipage...in my case, the table is taller than my text, so...

thanks.

6. ### AlephZero

7,298
I noticed that as well. Plus, your OP didn't say exactly what you wanted the document to look like

7. ### gsal

It looks like I started my 12:30 post before seeing your 12:24...so, my answer still refers to your 9:49 post.

What I had tried was "table" and then the "minipages" inside of it and it did not make a difference...but I should give a try to your latest suggestion with "tabular" and see if things line up out of the box without having to play around with vspace.

Thanks again.

8. ### gsal

o.k., I checked. The outer "tabular" approach works better and honors the inner "tabular" request for top vertical alignment...no need for minipage and playing around with vspace.

Thanks, again.