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.

I'm writing a text where I have some figures that need to be wider than the text width, and I want then to spill out into the outer (in my text, rather wide) margin. I have tried a solution which I found in a previous question here, but I can't make it work.

I copied the code in Place figures side by side, spill into outer margin

and modified it to:

\usepackage{ifoddpage}

\begin{figure}
  \checkoddpage
  \edef\side{\ifoddpage l\else r\fi}%
  \makebox[\textwidth][\side]{\includegraphics[width=1.4\textwidth]{wide_image}}
     \caption{xxx}
  \label{fig:1}
\end{figure}

This makes figures behave the correct way on odd pages (they are left-aligned with text), but not on even pages (where they are still left-aligned with the text, making them spill into the inner margin instead)?

I'm using the "report" class.

share|improve this question
1  
Welcome to TeX.sx! Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. –  Benedikt Bauer Jan 7 '13 at 8:24
    
Ok, it is not so minimal, unfortunately, and now playing around I noticed that the error may appear on odd or even pages... –  carina Jan 7 '13 at 8:57
    
@carina Well, the problem is that your code is not a full document, so we cannot copy it into our TeX editors and compile it. If you need some "dummy text", you can use the package \usepackage{lipsum} and the command \lipsum[1-5]. If you change [1-5] to something else (up to 40), you get a text of different length. This would allow you to move the figures on odd or even page as needed. –  yo' Jan 7 '13 at 9:04
    
yes, I see that, I'll try to make an example which shows the error. In short documents it seems to work for me, I notice now, but I'll see if I can reproduce it. –  carina Jan 7 '13 at 9:09
    
As well, you have to run it twice! to get the correct result. –  yo' Jan 7 '13 at 9:14

2 Answers 2

(Too long for a comment.)

There is a comment by Konrad Rudolph to the first answer in the question you linked:

Place figures side by side, spill into outer margin

Small precaution for other users of this solution: sometimes it won’t work. To fix this, pass the option strict to the package or put \strictpagecheck before the \checkoddpage.

Maybe this is the reason why it doesn't work for you?

share|improve this answer

I cannot see any problem here:

\documentclass[twoside]{report}
\usepackage{geometry,caption}
\geometry{showframe=true,includemp,marginparwidth=5cm,marginparsep=1em}
\captionsetup{singlelinecheck=false,width=\textwidth}
\usepackage{ifoddpage}
\begin{document}

\begin{figure}
\checkoddpage
\makebox[\textwidth][\ifoddpage l\else r\fi]{\rule{1.4\textwidth}{3cm}}
\caption{xxx} \label{fig:1}
\end{figure}
\clearpage%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{figure}
  \checkoddpage
  \makebox[\textwidth][\ifoddpage l\else r\fi]{\rule{1.4\textwidth}{3cm}}
     \caption{xxx}\label{fig:2}
\end{figure}
\end{document}

even page

odd page

share|improve this answer

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.