7

With the following code...

\documentclass[draft,10pt,a5paper]{article}
\usepackage[margin=2cm]{geometry}
\usepackage{fontspec}
\setmainfont{TeX Gyre Pagella}
\usepackage{parallel}
\setlength\parindent{0pt}

\begin{document}

\section{My Section}  % kill this line and the result is OK

BAD: % or kill this line and the result is ok

\begin{Parallel}{.47\textwidth}{.47\textwidth}
\ParallelLText{Lorem ipsum dolor sit amet.}
\ParallelRText{Sed do eiusmod tempor incididunt ut labore et dolore.}
\end{Parallel}

\bigskip

GOOD:

\begin{Parallel}{.47\textwidth}{.47\textwidth}  % same as above...
\ParallelLText{Lorem ipsum dolor sit amet.}
\ParallelRText{Sed do eiusmod tempor incididunt ut labore et dolore.}
\end{Parallel}

\end{document}

I get this result:

enter image description here

See the blank line between "BAD" and "Lorem ipsum"?

To me, it seems like a parallel bug. I know there are other package for typesetting parallel text, such as paracol or parcolumns, but usually I have better results with parallel (fewer widows for instance).

BertS
  • 415
  • Placing ~\par\vskip -\baselineskip before the BAD line provides a workaround, but not really a fix. – Steven B. Segletes Jun 03 '13 at 13:09
  • 2
    parallel overwrites the \everypar set by \@afterheading and so \clubpenalty is not reset correctly after the first paragraph ("BAD"). You could add \makeatletter\clubpenalty \@clubpenalty\makeatother before \begin{parallel}. – Ulrike Fischer Jun 03 '13 at 13:14
  • My code for the parallel text is actually inside a macro and the command you mentioned failed with a "spacefactor" error, because of the "@". So I added \clubpenalty=500 before \begin{parallel} (inside the macro), and this fixes the bug. Thanks a lot for your hint, Ulrike! – BertS Jun 03 '13 at 14:42

1 Answers1

3

Package parallel overwrites the \everypar set by \@afterheading and so \clubpenalty is not reset correctly after the first paragraph ("BAD"). You could add \makeatletter\clubpenalty \@clubpenalty\makeatother before \begin{parallel}.

Heiko Oberdiek
  • 271,626
Ulrike Fischer
  • 327,261