# Can't get ledpar to work with section headings

I'm trying to create a bilingual critical edition with Latin on the left page and English on the right. I'm trying to figure out ledpar and I can't get the following example to compile. It compiles just fine if I comment out the two section headings, but with the section headings LaTeX throws the error on line 19 (which calls the \Pages macro) that says

You can't use \lastbox in vertical mode.


Here is the code I'm using:

\documentclass[10pt]{article}
\usepackage{ledmac, ledpar}
\begin{document}
\begin{pages}
\begin{Leftside}
\beginnumbering
\pstart
\section{blah}
lorem ipsum\pend
\end{Leftside}
\begin{Rightside}
\beginnumbering
\pstart
\section{blerg}
asdf.
\pend
\end{Rightside}
\Pages
\end{pages}
\end{document}

-
This compiles for me and produces output with a few overfull warnings. Do you perhaps have some auxiliary files left over from a previous run? –  Peter Grill Dec 6 '11 at 1:07

Hmm, I actually don't use ledpar very often; I thought it was much more similar to ledmac. There are a few things wrong with the code you have above, but they are not the problem. This should work:

\documentclass[10pt]{article}
\usepackage{ledmac, ledpar}
\begin{document}
\begin{pages}
\begin{Leftside}
\beginnumbering
\pstart
\leavevmode\section{blah}% <--
lorem ipsum
\pend
\endnumbering% <--
\end{Leftside}
\begin{Rightside}
\beginnumbering
\pstart
\leavevmode\section{blerg}
asdf.
\pend
\endnumbering% <--
\end{Rightside}
\Pages
\end{pages}
\end{document}


My earlier comment was wrong: the \section commands do need to be inside the \pstart ... \pend (unlike in ledmac), but the \leavevmode will get rid of your error messages if you are using older versions of these packages; e.g.:

ledmac.sty    2005/03/24 v0.7 LaTeX port of EDMAC
ledpar.sty    2005/04/08 v0.3b ledmac extension for parallel texts


Note that newer versions are available on CTAN: ledmac; ledpar. It is possible they have fixed this issue.

Edit:

Now that I have both old and new (June 2012) versions of the packages, I can confirm that the \leavevmode is no longer necessary. (Though nothing changes if you leave it in.)

-

The new version of eledmac (1.1) provides commands for sectioning inside numbered text (and with critical notes)

-
I'm not clear on the link between eledmac and ledpar: could you explain this? –  Joseph Wright Sep 28 '12 at 6:06
Ledmac is the basis, which allows line numbering and critical comments; –  Maïeul Sep 28 '12 at 12:17
and ledpar is an extension which allows parallel typesetting –  Maïeul Sep 28 '12 at 12:17

The new version of eledmac/eledpar (1.12 / 1.8) which will be released soon provide better tool to manage your case. It provides eledsection.

That is a MWE

\documentclass[10pt]{article}
\usepackage{ledmac, ledpar}
\begin{document}
\begin{pages}
\begin{Leftside}
\beginnumbering
\pstart
\eledsection{blah}
\pend
\pstart
lorem ipsum\pend
\end{Leftside}
\begin{Rightside}
\beginnumbering
\pstart
\eledsection{blerg}
\pend
\pstart
asdf.
\pend
\end{Rightside}
\Pages
\end{pages}
\end{document}


I invite you to wait some time the new version be posted on CTAN

-