General ⇒ Table Size and Figure Spacing in LaTex
Table Size and Figure Spacing in LaTex
I am having trouble w. my table and figure. Hope you can help:
1.
I created a table in Latex, but currently it is too big. I would like to make the fonts of my table values smaller compared to the rest of my document. How can I do that?
2.
I uploaded .pdf graphics files into my MikTex project for various figures. But for each figure, there is alot of spacing that is put between the graph and my caption. The spacing is at least 1/3 of my 8x11 page. Does anyone know why that occurs and how to fix that?
Thank you in advance!
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
Table Size and Figure Spacing in LaTex
There are several tips to reduce the width of a table:
- Reduce the fontsize in the whole table. For this, put before the table a suitable declaration command as \small or \scriptsize. To limit the effect of this declaration to a specific table, add after it the \normalsize command, put the table in an environment (center, for example), or enclose the table with \begingroup and \endgroup.
- Reduce the space between columns, varying the \tabcolsep length.
- Scale down the table with \scale or resize it with \resizebox. Both commands are defined in the graphicx package
- Reduce the fontsize of some columns with the help of the array package. A command like >{\small} before a column descriptor writes all elements in that column in small size.
Code: Select all
\documentclass[a4paper]{article}
\usepackage{graphicx}
\usepackage{array}
\begin{document}
\noindent Left margin here \hfill right margin here.
\begin{center}
\begin{tabular}{|c|c|c|c|c|c|c|c|}
\hline \multicolumn{8}{|c|}{A wide table} \\ \hline
One.One & One.Two & One.Three & One.Four & One.Five
& One.Six & One.Seven & One.Eight \\
Two.One & Two.Two & Two.Three & Two.Four & Two.Five
& Two.Six & Two.Seven & Two.Eight \\ \hline
\end{tabular}
\end{center}
\begin{center}
\small\addtolength{\tabcolsep}{-5pt}
\begin{tabular}{|c|c|c|c|c|c|c|c|}
\hline \multicolumn{8}{|c|}{A (not so) wide table} \\ \hline
One.One & One.Two & One.Three & One.Four & One.Five
& One.Six & One.Seven & One.Eight \\
Two.One & Two.Two & Two.Three & Two.Four & Two.Five
& Two.Six & Two.Seven & Two.Eight \\ \hline
\end{tabular}
\end{center}
\begin{center}
\scalebox{0.7}{%
\begin{tabular}{|c|c|c|c|c|c|c|c|}
\hline \multicolumn{8}{|c|}{A (not so) wide table} \\ \hline
One.One & One.Two & One.Three & One.Four & One.Five
& One.Six & One.Seven & One.Eight \\
Two.One & Two.Two & Two.Three & Two.Four & Two.Five
& Two.Six & Two.Seven & Two.Eight \\ \hline
\end{tabular}}
\end{center}
\begin{center}
\resizebox{\textwidth}{!}{%
\begin{tabular}{|c|c|c|c|c|c|c|c|}
\hline \multicolumn{8}{|c|}{A (not so) wide table} \\ \hline
One.One & One.Two & One.Three & One.Four & One.Five
& One.Six & One.Seven & One.Eight \\
Two.One & Two.Two & Two.Three & Two.Four & Two.Five
& Two.Six & Two.Seven & Two.Eight \\ \hline
\end{tabular}}
\end{center}
\begin{center}
\addtolength{\tabcolsep}{-3pt}
\begin{tabular}{|>{\tiny}c|c|>{\tiny}c|c|>{\tiny}c|c|>{\tiny}c|c|}
\hline \multicolumn{8}{|c|}{A (not so) wide table} \\ \hline
One.One & One.Two & One.Three & One.Four & One.Five
& One.Six & One.Seven & One.Eight \\
Two.One & Two.Two & Two.Three & Two.Four & Two.Five
& Two.Six & Two.Seven & Two.Eight \\ \hline
\end{tabular}
\end{center}
\end{document}
You can eliminate superfluous space by means of the trim option of \includegraphics. Please, take a look at this topic and this document.
Merry Christmas!
Re: Table Size and Figure Spacing in LaTex

Re: Table Size and Figure Spacing in LaTex

\begin{table}
\begin{center}
\small\addtolength{\tabcolsep}{-5pt}
\begin{tabular}{c||c|c|c||c|c||c}
X& x1 & $x2$ & x3 & x4 & x5&x6\\\hline
I & 1& 2& 3 & 4 & 5& 6\\
& (.46) & & & (.16)&&\\
II&1&2&3 & 4&5&6\\
& (.82) & & & (.28)&&\\
III &1&2 &3& 4&5&6\\
& (.63) & & & (.24)&&\\
IV & 1& 2& 3& 4&5& 6\\
& (.39) & & & (.14)&&\\
V & 1& 2& 3& 4&5& 6\\
& (.82) & & & (.39)&&\\
VI & 1& 2& 3& 4&5& 6\\
& (1.15) & & & (2.65)&&\\
\end{tabular}
\end{center}
}
\caption{My caption} \label{tab:mytab}
\end{table}
Re: Table Size and Figure Spacing in LaTex
\begin{figure}[t]
\centering
\includegraphics[width=1.00\textwidth]{Fiigure3.pdf}
\caption{Y(STUDENT'S T) minus Y(GSHD) matched by kurtosis}
\label{fig:Fiigure3}
\end{figure}\begin{figure}[t]
\centering
\includegraphics[width=1\textwidth]{secondgraph.pdf}
\caption{N(0,1) in black, Standardized t(5) in green and GHSD(lambda(5) in blue)}
\label{fig:secondgraph}
\end{figure}
Many thanks
Table Size and Figure Spacing in LaTex
Code: Select all
\end{tabular}
\end{center}
}
\caption{My caption}\label{tab:mytab}
Code: Select all
\begin{table}
\centering
\small\addtolength{\tabcolsep}{-5pt}
\begin{tabular}{c||c|c|c||c|c||c}
X& x1 & $x2$ & x3 & x4 & x5&x6\\\hline
I & 1& 2& 3 & 4 & 5& 6\\
& (.46) & & & (.16)&&\\
II&1&2&3 & 4&5&6\\
& (.82) & & & (.28)&&\\
III &1&2 &3& 4&5&6\\
& (.63) & & & (.24)&&\\
IV & 1& 2& 3& 4&5& 6\\
& (.39) & & & (.14)&&\\
V & 1& 2& 3& 4&5& 6\\
& (.82) & & & (.39)&&\\
VI & 1& 2& 3& 4&5& 6\\
& (1.15) & & & (2.65)&&\\
\end{tabular}
\caption{My caption} \label{tab:mytab}
\end{table}
* It seems you want both graphics in the same page. However, in both figure environments you use the t descriptor, which forces LaTeX to put the graphic at the top of a page. It is better to use the default option (tbp descriptors), so LaTeX have more chances to place both graphics in the same page. You can even include both graphics with a unique figure environment:
Code: Select all
\begin{figure}
\centering
\includegraphics{firstgraphicfile}
\caption{A suitable graphic} \label{fig:one}
\bigskip
\includegraphics{secondgraphicfile}
\caption{Another interesting graphic} \label{fig:two}
\end{figure}
* You can also improve control over the dimensions of the area covered by the graphics. To this end, use the optional argument of \includegraphics. For example, the command
Code: Select all
\includegraphics[width=4cm,height=5cm,keepaspectratio]{graphicsfile}
Code: Select all
\includegraphics[width=0.4\textwidth,height=0.3\textheight,keepaspectratio]{graphicsfile}
Please, read the epslatex document. You will find there many more tips and hints about managing graphics in LaTeX.
Re: Table Size and Figure Spacing in LaTex

-
- Posts: 3
- Joined: Wed Oct 26, 2016 11:42 am
Table Size and Figure Spacing in LaTex

Thanks a lot
Table Size and Figure Spacing in LaTex
\usepackage{longtable}
for long tables had problems with some of your suggestions, but reducing the space between columns worked great. You have to compile the .tex file a couple of times to get the headings and data to all line up. This saves me a lot of headache.
- Stefan Kottwitz
- Site Admin
- Posts: 10359
- Joined: Mon Mar 10, 2008 9:44 pm
Table Size and Figure Spacing in LaTex
welcome to the forum! And thanks for sharing your experience!
Stefan