GeneralFull page figure, image at top margin, caption on bottom mar

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
runderwo
Posts: 3
Joined: Thu Aug 23, 2007 8:58 pm

Full page figure, image at top margin, caption on bottom mar

Post by runderwo »

Is there a way to automatically insert space into a float such that the image begins at the top margin and the caption appears at the bottom margin? The best I can do is \vspace*{1.4in} inside the float between the image and caption, but this requires manual calculation for every image, and becomes invalid if I update the image or change its scale.

I hoped I would make \vfill work somehow. \vfill by itself doesn't work inside the float, I guess it's the wrong environment for it. I then made a \vbox to \textheight{\vfill\caption{...}}, but this pushed the caption off the end of the page...

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

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

Full page figure, image at top margin, caption on bottom mar

Post by gmedina »

I've found a provisional solution, but I don't like it too much. Add in the preamble:

Code: Select all

\newlength{\mylen}
\addtolength{\mylen}{\textheight}
\addtolength{\mylen}{-16pt}
Include your images like this:

Code: Select all

\newpage

\begin{figure}[!ht]
 \parbox[t][\mylen]{\textwidth}{%
 \centering
 \includegraphics[<options>]{<your_image>}

 \vfill
 \caption{<image_caption>}
 }
\end{figure}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
juliette
Posts: 75
Joined: Thu Nov 20, 2008 10:15 pm

Re: Full page figure, image at top margin, caption on bottom mar

Post by juliette »

Is there not a way to make the image take up the ENTIRE page ?? including the top, bottom, left and right margins?
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Full page figure, image at top margin, caption on bottom mar

Post by gmedina »

Hi,

one posible solution is to use the \changetext command provided by the changepage package (documentation at the end of the changepage.sty file itself) to change the page layout for the page that will contain the image and then restoring the original layout with the same command. Take a look at the following example:

Code: Select all

\documentclass{article}
\usepackage{changepage}
\usepackage{graphicx}
\usepackage{lipsum}% just to automatically generate some text 

\begin{document}

\lipsum[1-4]

\newpage

%changing the page design temporarily
\changepage{9cm}{9.4cm}{-4.7cm}{-4.7cm}{}{-4.5cm}{}{}{}
\noindent\rule{\textwidth}{\textheight}

\newpage

%restoring the standard settings
\changepage{-9cm}{-9.4cm}{4.7cm}{4.7cm}{}{4.5cm}{}{}{}
\lipsum[1-4]

\end{document}
I used \rule to simulate an image; in its stead, you can use the standard \includegraphics command (having loaded the graphicx package, of course).
1,1,2,3,5,8,13,21,34,55,89,144,233,...
juliette
Posts: 75
Joined: Thu Nov 20, 2008 10:15 pm

Re: Full page figure, image at top margin, caption on bottom mar

Post by juliette »

Thank you,
I downloaded changepage.sty, but TeXnicCenter can't find it .. usually TeXnicCenter automatically locates new packages for me at compile time, but it doesn't seem to do anything right now. Do I need anything other than changepage.sty?? Or could I specify where I want it to look ??
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Full page figure, image at top margin, caption on bottom mar

Post by gmedina »

Did you installed it manually? If so, you will have to refresh the File Name Database:
MikTeX->Settings
and ckick on the Refresh FNDB button.

As far as I now, the MiKTeX Package Manager should do the installation for you. Anyway, a quick "dirty" fix is to save the file changepage.sty in the same folder that contains your .tex file.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
juliette
Posts: 75
Joined: Thu Nov 20, 2008 10:15 pm

Re: Full page figure, image at top margin, caption on bottom mar

Post by juliette »

Should I be able to see the MiKTeX tab in TeXnicCenter ?? along the row with the tabes "File" , "edit" "view " ... ??

I prefer not to put the .sty file in the same folder as my .tex file
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Full page figure, image at top margin, caption on bottom mar

Post by gmedina »

juliette wrote:Should I be able to see the MiKTeX tab in TeXnicCenter ?? along the row with the tabes "File" , "edit" "view " ... ??
No. Assuming you are on Windows XP with MiKTeX 2.7, go to
Start->All Programs->MiKTeX2.7->Settings
1,1,2,3,5,8,13,21,34,55,89,144,233,...
juliette
Posts: 75
Joined: Thu Nov 20, 2008 10:15 pm

Re: Full page figure, image at top margin, caption on bottom mar

Post by juliette »

Hmm.. it doesn't work when I go to MiKTeX2.7->Settings->Refresh FNDB,
but it does work when I put the file in the same folder as the .tex file.

There's something strange here .. maybe I should post this on the TeXnicCentre forum.
Post Reply