0

I have a document with margin notes in which \cite commands are used. I have the problem that the first line of the margin note does not match the line in the text if the margin note starts with \cite and the option backref is used in hyperref.

MWE:

\documentclass{article}
\setlength{\textwidth}{12cm} % to have enough space for margin notes
\setlength{\marginparwidth}{8cm} % ditto
\usepackage{natbib}
\usepackage[backref]{hyperref}
\bibliographystyle{chicago}

\begin{document}

Note \marginpar{See \cite{Other1980}} that this margin 
comment should start on this line and it does.  

\vspace{\baselineskip}

Note \marginpar{\cite{Other1980}} that this margin 
comment should start on this line but it does not.    

\bibliography{refs} 
\end{document}

with refs.bib containing

@article{Other1980,
        Author = {A. N. Other},
        Title = {1 + 1 = 3},
        Journal = {J. Irreproducible Results},
        Year = 1980}}

The output is:

enter image description here

Note how 'Other (1980)' is below the corresponding line of text if the margin note starts with \cite whereas it is correctly aligned if the margin comments starts with text. On the other hand, if I comment out the option \backref, I get both margin notes correctly aligned:

enter image description here

Now 'Other (1980)' is correctly aligned with the second line of text.

How can I get proper alignment with \backref even if the margin note does start with \cite? Am I doing something wrong or is this a bug?

  • 2
    \marginpar{\leavevmode\cite{moore}} gives the expected results with both backref settings. I assume with backref hyperref adds code before the actual \cite and confuses the boxing... – moewe Mar 16 at 12:12
  • That solved the problem, thanks. – user1362373 Mar 19 at 5:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.