Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Between sections/section or sections/subsection I have empty pages if a pre-section or pre-subsection does fill one page. My document class:

\documentclass[9pt]{article}

How can I avoid this? Thanks for help.

Here is the minimal example, which produces an emtpy page between chapter 1 and 2:

\begin{document}
\section{Chapter1}
\begin{table}[H]
\begin{tabular}{ll}
\hline
x & y  \\ 
\hline
1 & 2  \\ \hline
\end{tabular}
\end{table}

\section{Chapter2}
\begin{figure}[H]
\setkeys{Gin}{width=1.4\textwidth}
\includegraphics[angle=90]{figure.pdf}
\end{figure}
\end{document}

If I change width to 1.3 or change angle to 0 there is no empty page between chapter 1 and 2.

share|improve this question
    
What is a 'pre-section' exactly? \chapter{} <pre-section text> \section{} <non-presection text>? I suspect a complete minimal example showing the problem will facilitate quicker and better solutions. –  jon Jun 23 '12 at 22:08
    
if your previous page contains a picture at the bottom it might be too large... –  Martin H Jun 23 '12 at 22:57
    
@jon: Yes, I meant before section (=pre-sectino). Sorry for the confusion. I added my mininal example in the question. –  giordano Jun 24 '12 at 7:20
    
@Martin: Thanks for the hint. I suppose the problem is that the subsequent figure is too large. –  giordano Jun 24 '12 at 7:44
2  
With documentclass article you cannot have a \chapter command and also no 9pt. Please provide a complete and running example. –  Herbert Jun 24 '12 at 8:10
show 1 more comment

migrated from stackoverflow.com Jun 23 '12 at 20:43

This question came from our site for professional and enthusiast programmers.

1 Answer

up vote 3 down vote accepted

Using H as a float specifier implies you're using the float package, which causes floats to stop floating or "really means "here" (and starts a new page first if necessary)" (see How to influence the position of float environments like figure and table in LaTeX?). So, you have two options:

  1. Enlarge your document real estate using the geometry package. For example,

    \usepackage[margin=1cm]{geometry}% http://ctan.org/pkg/geometry
    

    would increase the text block as far as is needed (in all directions) and leave only a 1cm margin between the text block and the page boundary. This will allow you to fit more on a page, perhaps allowing the figure to be set where you want it to.

    Note that this option will have no effect if you're using a text block related length (like \textwidth), since the proportional modification would translate to the figure as well.

  2. Modify the image dimensions to make it fit on the page. For example,

    \usepackage{graphicx}% http://ctan.org/pkg/graphicx
    %...
    \resizebox{\textwidth}{!}{\includegraphics[angle=90]{figure}}
    

    would make sure that the resulting turned image fits within the \textwidth block. Of course, if it is taller than the text block, constraining the height would be more appropriate. Using

    \resizebox{!}{\textheight}{\includegraphics[angle=90]{figure}}
    

    in your case would not suffice, since the non-floating nature of an "H-figure" immediately after a \section causes LaTeX to keep them together. As such, you have less than \textheight to play with in terms of the figure height.

share|improve this answer
    
Many thanks for these intro to fit pages. –  giordano Jul 2 '12 at 19:14
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.