Created
January 12, 2018 08:34
-
-
Save ivand58/c96b151e3ce7ecd8d6886629f575f2f7 to your computer and use it in GitHub Desktop.
Latex table shrinking
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%\title{LaTeX Table spacing example} | |
% Example by John Hammersley | |
\documentclass{article} | |
\usepackage[usenames,dvipsnames]{xcolor} | |
\begin{document} | |
\section*{Table with default spacings} | |
% A table with the default row and column spacings | |
\begin{tabular}{ c c c } | |
First Row & -6 & -5 \\ | |
Second Row & 4 & 10\\ | |
Third Row & 20 & 30\\ | |
Fourth Row & 100 & -30\\ | |
\end{tabular} | |
\section*{Table with adjusted spacings} | |
% A table with adjusted row and column spacings | |
% \setlength sets the horizontal (column) spacing | |
% \arraystretch sets the vertical (row) spacing | |
\begingroup | |
\setlength{\tabcolsep}{10pt} % Default value: 6pt | |
\renewcommand{\arraystretch}{1.5} % Default value: 1 | |
\begin{tabular}{ c c c } | |
First Row & -6 & -5 \\ | |
Second Row & 4 & 10\\ | |
Third Row & 20 & 30\\ | |
Fourth Row & 100 & -30\\ | |
\end{tabular} | |
\endgroup | |
% The \begingroup ... \endgroup pair ensures the separation | |
% parameters only affect this particular table, and not any | |
% sebsequent ones in the document. | |
\end{document} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment