2

I'm using \href (from the hyperref package) to put some links into a document which is being typeset in two languages using the paracol package and XeTeX.

To compile it, I'm using

texify -p --engine=xetex paramin.tex

If in column one, I have a link that crosses a page boundary, the first paragraph containing a link after a \switchcolumn command gets linked to the target of the \href that crosses the page boundary.

Here's an example (as minimal as I could make it):

\documentclass[12pt]{article}
\usepackage{paracol}
\usepackage{hyperref}
\begin{document}
\begin{paracol}{2}
I see a strange phenomenon regarding the behaviour of \verb+\href+ and page breaks when using the \textit{paracol} package. This document is designed to show the behaviour. This paragraph contains a \href{http://tex.stackexchange.com}{link} to some website, this one works as expected.
\switchcolumn
This paragraph contains a link at the end that should actually point to the same website as the one in the left column, but it gets messed up by the link in column one which crosses a page boundary. Updating the MiKTeX packaged didn't help. \href{http://tex.stackexchange.com}{link}.
\switchcolumn
Here's a few empty lines to save me writing more text. As an example, I include a link to \href{http://www.brockhaus.de/}{my favourite search engine}.

~

~

~

~

~

~

~

~

~

~

~

~

~

~

~

~

~

~

~

~

~

~

~

~

Now we're all set I think. The link contained in this paragraph \href{http://www.error.com/}{is slightly longer than normal and crosses a page boundary}. This will result in it being repeated in the wrong place in column two on page one.
\switchcolumn
This again points to \href{http://www.brockhaus.de/}{my favourite search engine}. As only the first link in a column gets messed up, this one behaves as it should.
\end{paracol}
\end{document}

And here's an elaborately illustrated screenshot of the resulting document:

screenshot of the resulting document

Any idea how to fix this? I have some control over the content, so I may be able to avoid a page break within a link.

Adding or removing just one empty line in this example fixes the resulting document, so I'm pretty sure the page break within the link in combination with paracol is the culprit.

takrl
  • 471
  • 1
    As it stands your minimal example compiles with an error under the minimal document class. Switching to the article document class doesn't produce an error, but the layout has changed. Are you using the minimal document class for a particular reason/purpose? See Why should the minimal class be avoided? – Werner Dec 21 '15 at 19:24
  • @Werner Sorry, I've made two schoolboy errors. One, I probably tried to over-simplify the minimal example by using minimal. Two, I failed to mention that I compile this using the --engine=xetex switch. I changed the document class to article now. This also fails using pdfLaTeX, but 'succeeds' with XeTeX and produces the invalid pdf shown. Thanks for the hint re. minimal, I wasn't aware of that. – takrl Dec 22 '15 at 06:08

0 Answers0