Page LayoutHow to adjust margins where tables are too wide

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
mazatlanmexico
Posts: 10
Joined: Thu Jul 15, 2010 5:01 pm

How to adjust margins where tables are too wide

Post by mazatlanmexico »

Hi:
I wonder if someone can help me figure out how to adjust the margins of a page where tables are too wide. I tried the geometry package in the preamble:
\usepackage[hmargin=1in,vmargin=1in]{geometry}
Then I changed to:
\newgeometry{hmargin={1cm}} to try to fit the table but it has no effect
and besides the command gets printed when the pdf is generated.

Code: Select all

\documentclass[11pt]{article}
\usepackage{geometry}
\usepackage{pdflscape}
\usepackage{ctable}
\title{How to adjust margins where tables are too wide}
\usepackage{Sweave}
\begin{document}
\maketitle
\begin{quote}
I would like every page to have 1in margins except the page with a wide table.\\
Page with table should be 1cm horizontal margin.
\end{quote}
\newpage
\begin{landscape}
\ctable[caption={Preliminary }]{ccccccccc}{}
{\FL
\multicolumn{1}{c}{Date}&
\multicolumn{1}{c}{RFlows(cfs)}\tmark[1]&
\multicolumn{1}{c}{Temp(C)}&
\multicolumn{1}{c}{Turbs(NTU)}&
\multicolumn{1}{c}{BY09.Winter}&
\multicolumn{1}{c}{BY09.Spring}&
\multicolumn{1}{c}{BY09.Fall}&
\multicolumn{1}{c}{BY09.LateFall}&
\multicolumn{1}{c}{BY10.Steelhead}\tabularnewline
\hline
3/12/2010&6,780&12.8&4.2&33 (119 - 119)&33 (71 - 71)&890 (32 - 47)&0 ( - )&0 ( - ) \\
3/13/2010&11,400&13.4&-&-&-&-&-&- \\
\FL
}
\end{landscape}

\end{document}
Last edited by mazatlanmexico on Sat Jul 17, 2010 8:27 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

How to adjust margins where tables are too wide

Post by Stefan Kottwitz »

Hi,

you could use \makebox to put the wide table into a box fitting to the text width: Centering wide tables or figures.

Stefan
LaTeX.org admin
mazatlanmexico
Posts: 10
Joined: Thu Jul 15, 2010 5:01 pm

How to adjust margins where tables are too wide

Post by mazatlanmexico »

Thanks Stefan, I was able to figure it out with the geometry package.

Code: Select all

\newgeometry{vmargin={1cm}}
\restoregeometry
Last edited by mazatlanmexico on Sat Jul 17, 2010 9:17 pm, edited 1 time in total.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Re: How to adjust margins where tables are too wide

Post by localghost »

Now that the problem is solved, please mark the topic accordingly as described in Section 3 of the Board Rules (last two paragraphs).


Best regards and welcome to the board
Thorsten
Post Reply