In my document I have couple of tables which are too wide to fit between margins – that is why my tables go beyond the text. I think that it looks quite ugly so I was wondering if it is possible to change margins only for specific pages in a document? Thanks to this my tables would be able to fit between margins and the text and tables' length would be the same
-
2I'd advise against this, because then text margins will be inconsistent in your document. Have a look at this question for available options -- my tip is to rotate the table.– lockstepAug 31, 2011 at 11:42
-
And you can still use the wide table directly in tight pages without changing the margins. Some tricks can be used to avoid the annoying compile warnings, if you wish.– Leo LiuAug 31, 2011 at 12:29
2 Answers
You're saying
Thanks to this [...] the text and tables' length would be the same
I'd say it's more important to have a consistent line length in your document. There's a reason why the standard LaTeX margins are quite wide. There's a rule of thumb that goes something like "Don't put more than 66 characters in one line" (otherwise it gets harder for readers to jump from the end of the line to the beginning of the next line).
So instead of making the margins of the entire page smaller, which yields undesirably long lines in normal paragraphs, you could just set the table a bit wider, as shown for figures in Center figure that is wider than \textwidth. Here's an adaption of Martin Scharrer's solution:
\documentclass{article}
\usepackage{lipsum}% just for filler text
\usepackage[pass,showframe]{geometry}% just to show the margin borders
\begin{document}
\begin{table}
\makebox[\textwidth][c]{
\begin{tabular}{p{0.6\textwidth}p{0.6\textwidth}}
\lipsum[1] & \lipsum[1]
\end{tabular}
}
\caption{Extra-wide table}
\end{table}
\lipsum[1]
\end{document}
use package geometry
, then you can define new layouts with saving the old ones. Run
from the command line texdoc geometry
. There are good examples