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.

If I start a new chapter or a new section, preceding it with \cleardoublepage command, which may or may not produce a blank page so that the new chapter or section starts on an odd numbered page (RHS), how can I put an image (with a caption) on that blank page (the LHS), where the numbering is still related to the new section that is starting on the RHS.

By numbering I mean if current chapter is Chapter 2 desired figure naming should be Fig 2.1, 2.2, 2.3.... etc. It would be quite easy to just insert the image, before the new chapter or section is issued, but then the numbering might be Fig 1.1, 1.2, 1.3 etc, since the new chapter hasn't been inserted yet.

If there is no blank page (ie already on a RHS), then the image should go on the next page.

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

\cleardoublepage is simply

\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else
    \hbox{}\newpage\if@twocolumn\hbox{}\newpage\fi\fi\fi}

so I think you want

\def\mycleardoublepage#1{%
\clearpage
\includegraphics{#1}%
\cleardoublepage}

or perhaps wrap the includegraphics in some positional code or a figure environment, depending on your needs.

share|improve this answer
add comment

A manual solution could look like:

\clearpage
\newcommand*{\mychaptertitle}{My Chapter}
\newcommand*{\myfigure}{%
  \begin{figure}
    ...
    \caption{...}
    ...
  \end{figure}%
}
\ifodd\value{page}% no empty page
\else % empty page
  \stepcounter{chapter}%
  \chaptermark{\mychaptertitle}%
  \myfigure
  \renewcommand*{\myfigure}{%
    \stepcounter{figure}%
  }%
  \addtocounter{chapter}{-1}%
  \clearpage
\fi
\chapter{\mychaptertitle}
...
\myfigure % first figure
...

Remarks:

  • Macros \myfigure and \mychaptertitle avoid duplicate data in the input.
  • In the empty page the settings for the next chapter needs to be setup (counter chapter and perhaps section, headings/footers via \chaptermark and perhaps \sectionmark) and restored afterwards.
  • Also several floats can be added, but the sum should not be larger than one page.
  • I had used \stepcounter to avoid duplicate destinations with the same name, if \refstepcounter is used.
share|improve this answer
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.