Latex - tables taking up too much room

  • LaTeX
  • Thread starter lavster
  • Start date
  • Tags
    Latex
In summary, the conversation discusses the issue of spacing between tables in LaTeX, which can be larger compared to Word due to different margin sizes and default spacing. The conversation suggests using floating tables to adjust the spacing, but also mentions the potential for spacing issues when using this method. The conversation also includes an example of how to use floating tables and discusses the use of the minipage environment. Overall, the conversation provides helpful tips for adjusting and managing spacing between tables in LaTeX.
  • #1
lavster
217
0
Hi,
when i have multiple tables together the spacing between them is large and takes up unnecessary room. I have 5 tables which span the entire width and are one ontop of the other. If i was to put these tables into word they would fit into the one page. However, on latex the are spread over two pages due to the huge gaps between them (they don't even make it look nice). How do i get around this issue and force them to be closer together?
Thanks in advance
 
Physics news on Phys.org
  • #2
Can you show us the tex?
I cannot tell what you've done from the description. We only need the bit with the tables and the header to support them.

Generally:

Word uses smaller margins than LaTeX defaults, so you can fit more horizontally across the page.

In LaTeX a table is an environment and so has the same external spacings as any environment (iirc: 0.5 line above and below). It also has internal padding.

It can be prettier if you float the tables - you can get into trouble if you try for too much fine control over how LaTeX places things.
 
  • #3
Okay thanks. here is an example of a table:


\begin{table}[htp]
\caption{Caption goes here}
\begin{center}
\begin{tabular}{c c c c c c}

\hline\hline
Plan (\%) & 1 & 2& 3 & 4 & 5\\
\hline
Max & 108.7 & 108.1 & 109.2 & 108.7 & 109 \\
Min & 86.2 & 88.4 & 91.6 & 92.3 & 89.6 \\
\end{tabular}
\label{p5}
\end{center}
\end{table}

I don't mind how many fit in one line - its how many fits in a page - i personally think it looks silly when there is huge gaps

Thanks
 
  • #4
Well I can fit six of those on one page of a standard A4 layout in the default article single-page style. They look OK to me - about 2.5-3 lines between them.

I can pack them closer by including more than one tabular environment inside a table environment.

[later] Hmmm ... fiddling around I managed to get BIG spaces so I only had four to a page. That was ugly! But I saw what happened - if there are few tables, they will get spaced out. If I add more floating tables they got packed together again. If there was text, it ended up shifting the tables around too. Maybe that's what happened with you?

If your tables have a natural grouping and you want them all together, try putting them all in the same table float.
 
  • #5
i didnt include all the info but you appear to see what my probem in anyway...

Do you mean do this:

\begin{table}[htp]
\caption{Caption goes here}
\begin{center}
\begin{tabular}{c c c c c c}

\hline\hline
Plan (\%) & 1 & 2& 3 & 4 & 5\\
\hline
Max & 108.7 & 108.1 & 109.2 & 108.7 & 109 \\
Min & 86.2 & 88.4 & 91.6 & 92.3 & 89.6 \\
\end{tabular}
\label{p5}
\end{center}

\caption{Caption goes here}
\begin{center}
\begin{tabular}{c c c c c c}

\hline\hline
Plan (\%) & 1 & 2& 3 & 4 & 5\\
\hline
Max & 108.7 & 108.1 & 109.2 & 108.7 & 109 \\
Min & 86.2 & 88.4 & 91.6 & 92.3 & 89.6 \\
\end{tabular}
\label{p5}
\end{center}
\end{table}

I tried to do the minipage environment thing but it didnt work for me. It just kind of did two tables side by side and overlapping. But yeah all my tables are connected so i want them to be all next to each other.

Thanks
 
  • #6
I think you need to put tex inside code tags - but you have the idea - except you only need one center environment inside the table environment.
Code:
\begin{table}[htp]
  \begin{center}
    \caption{Caption1 goes here}
    \begin{tabular}{c c c c c c}
\hline\hline
Plan (\%) &  1       &  2       &  3       & 	4      &  5     \\
\hline
Max &  108.7 &  108.1 &  109.2 &  108.7 &  109  \\
Min &  86.2   &  88.4  &  91.6   &  92.3  &  89.6 \\
    \end{tabular}
 
    \caption{Caption 2goes here}
    \begin{tabular}{c c c c c c}
\hline\hline
Plan (\%) &  1       &  2       &  3       & 	4      &  5     \\
\hline
Max         &  108.7 &  108.1 &  109.2 &  108.7 &  109  \\
Min          &  86.2   &  88.4  &  91.6   &  92.3  &  89.6 \\
    \end{tabular}
  \end{center}
\end{table}
... each environment starts and ends with a paragraph break, except tabular, they can add up. You can also create your own special table environment to tell it not to do this... for advanced users though, I've never needed to.
 
Last edited:
  • #7
Fantastic! this works exactly how i wanted it to! thanks :)
 
  • #8
No worries.

Of course you don't have to float the tables :)
 
  • #9
what do you mean by float the tables?
 
  • #10
"floating" is when the position of a page element is not fixed. You float a table with the \begin{table} ... the table won't always appear right where you insert the \begin.

This is useful because it allows LaTeX to adjust where it puts tables in the text for different page sizes, if you have 2 columns, if you add more text later, or whatever. With more wysiwyg publishing tools you fix the position of tables and graphics and "wrap" text around them, instead, but html prefers to use floats so, for eg, web pages can adjust to different screen sizes.

I suspect the floating algorithm is what has been messing with the spacing - I was getting 4 tables to a page: evenly spaced on the page. But it went compact when I changed the number of tables and/or the amount of additional text.
 

1. Why do my tables in Latex take up so much room?

Tables in Latex have a default width that can take up a lot of space on the page. This is because Latex tries to preserve the integrity of the table by making sure all the content is visible and formatted correctly.

2. How can I make my tables in Latex take up less room?

One way to reduce the size of tables in Latex is by adjusting the column widths. You can do this by specifying a specific width for each column or using the "tabularx" package to automatically adjust the column widths to fit the page.

3. Can I change the font size of my tables in Latex to make them smaller?

Yes, you can change the font size of your tables in Latex by using the "resizebox" command. This will allow you to scale the entire table to a smaller size, making it take up less room on the page. However, be careful not to make the font too small, as it may become difficult to read.

4. Is there a way to break up a large table in Latex to make it take up less room?

Yes, you can use the "longtable" package to break up a large table into multiple pages. This will allow you to fit the table on multiple pages, reducing the amount of space it takes up on each page.

5. Are there any other tips for reducing the size of tables in Latex?

In addition to adjusting column widths and using the "longtable" package, you can also consider reducing the spacing between rows and columns, using a smaller font size for the table content, or breaking up the table into multiple smaller tables. It may also be helpful to review the formatting of your table to ensure it is not unnecessarily large or complex.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
224
  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
11
Views
7K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
10
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
15K
Back
Top