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.

\includepdf from the pdfpages package messes up the margin placement for this MWE:

\documentclass[10pt,a4paper,twoside,twocolumn]{article}

\usepackage[outer=6cm,
        inner=2.5cm,
        top=2cm,
        marginparwidth=3cm,
        marginparsep=1mm,
        twoside=true
        ]{geometry}
\usepackage{lipsum}
\usepackage{pdfpages}

\begin{document}

\includepdf{cover.pdf}

\lipsum
\marginpar{margin note}
\lipsum

\end{document}

where cover.pdf is a full one page pdf. What I mean by messing up is that the margin note is placed in the inner margin and not the outer one. I assume this is something along the lines of \includepdf not changing the odd/even counters correctly? Is there a better way to do what I am after?

share|improve this question
    
pdfpages isn't necessary. I can reproduce the problem without it. Any marginpar on an odd page is affected. –  cfr Mar 2 at 23:17
    
I am guessing that the thought is that a marginal note in two column mode should appear in the margin of that column and not in the margin of the other column on the page. –  cfr Mar 2 at 23:27

1 Answer 1

up vote 8 down vote accepted

From marginnote documentation:

At double side layout (e.g. using class option twoside) \marginnote needs to know the number of the current page to decide wether the page is odd or even and so wether to use left or right margin. L A T E X uses an asynchronous output. Because of this counter page should not be used to get the number of the current page unless you are at page head or foot. To solve the problem marginnote uses a mechanism similar to labels. But this means, that the correct margin won’t be known at this L A T E X run but only at the next. So after adding or deleting a margin note or after each change of page break you need two L A T E X runs to get all margins right.

The even and odd pages numbers are not properly fetched by the marginpar when \includepdf is used.

A possible solution will be to use marginnote package.

\documentclass[10pt,a4paper,twoside,twocolumn]{article}

\usepackage[outer=6cm,
        inner=2.5cm,
        top=2cm,
        marginparwidth=3cm,
        marginparsep=1mm,
        twoside=true
        ]{geometry}
\usepackage{lipsum}
\usepackage{pdfpages}
\usepackage[fulladjust]{marginnote}

\begin{document}

\includepdf{pgfmanual.pdf}
\lipsum
\marginnote{margin note}
\lipsum

\end{document}

enter image description here

share|improve this answer
    
Much obliged, works as advertised. –  phaebz Mar 2 at 23:38
    
@phaebz Glad it helped :) –  Harish Kumar Mar 2 at 23:44

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.