Graphics, Figures & TablesGraphic full page width?

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
shellcoder50
Posts: 4
Joined: Thu Sep 03, 2009 3:11 am

Graphic full page width?

Post by shellcoder50 »

Hello,

I am trying to find a way to make an image span the full page width but have been unable to do so. Is this possible? I have been trying variations on the following, even with \oddsidemargin set to 0 but I cannot get it to span the full page width:

Code: Select all

\begin{figure}[t] \centering
  \begin{tabular}{cc}
    \includegraphics[width=210mm]{data.jpg}\\
  \end{tabular}
  \label{fig1}
\end{figure}
Thank you for your time.

Recommended reading 2024:

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

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

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Graphic full page width?

Post by gmedina »

Hi,

you could use a \makebox, as described here.

Another approach, this time using the chngpage package:

Code: Select all

\documentclass{article}
\usepackage{graphicx}
\usepackage{chngpage}
\usepackage{calc}

\begin{document}

\begin{figure}[!ht]
  \begin{adjustwidth}{-\oddsidemargin-1in}{-\rightmargin}
    \centering
    \includegraphics[width=\paperwidth]{data}
    \caption{a page width figure}
    \label{fig:fig1}
  \end{adjustwidth}
\end{figure}

\end{document}
On a side note: I see that you are using a \label command inside a figure environment without the corresponding \caption command; this will produce undesired results when referencing the figure. Inside floats (figure, table) the \label command must be placed after the corresponding \caption command.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
shellcoder50
Posts: 4
Joined: Thu Sep 03, 2009 3:11 am

Re: Graphic full page width?

Post by shellcoder50 »

You, sir, are a master. Thank you very much for your response. I used chngpage and it did exactly what I wanted. Thank you again for your informative reply.

by the way, is it possible for chngpage to modify \voffset?

Thanks
-D
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Graphic full page width?

Post by localghost »

shellcoder50 wrote:[...] by the way, is it possible for chngpage to modify \voffset? [...]
You don't need to modify this length unless you are running into trouble with your printer hardware.


Best regards and welcome to the board
Thorsten
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Graphic full page width?

Post by gmedina »

Just to complement the answer given by localghost, if you really need to modify \voffset, then you can use the geometry package.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
shellcoder50
Posts: 4
Joined: Thu Sep 03, 2009 3:11 am

Re: Graphic full page width?

Post by shellcoder50 »

Thank you very much, looking at geometry now. This modification of \voffset is, in this case, for the first page only as I am trying to place an image just a little bit higher than "top". I don't intend for this change to propagate to subsequent pages.

Thank you again.
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Graphic full page width?

Post by gmedina »

Then, you don't need to change \voffset; you need to change the value of topmargin; to do this, don't use the geometry package (the changes made using geometry will affect all the document) and use in its stead some of the features of the chngpage package to achive the desired result. You can find a description of the commands and environments in the file chngpage.sty itself.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
shellcoder50
Posts: 4
Joined: Thu Sep 03, 2009 3:11 am

Graphic full page width?

Post by shellcoder50 »

gmedina, I see you made the same argument over at http://www.latex-community.org/forum/vi ... f=5&t=4051, sorry for not finding that... and thank you again very much for your help.
Post Reply