4

I'm using paracol to build a document composed by a header, followed by text in two columns, as in the example:

\documentclass[11pt, a4paper]{article}
\usepackage{paracol,lipsum}

\begin{document}

\lipsum[1]
\vspace{1cm}

\columnratio{0.29,0.69}
\begin{paracol}{2}

\setlength{\columnseprule}{0.4pt}
\setlength{\columnsep}{2em}


\begin{leftcolumn}
  \section{Section One}
  \lipsum [1-2]
\end{leftcolumn}

\begin{rightcolumn}
  \section{section two}
  \lipsum[3-4]
\end{rightcolumn}

\end{paracol}


\end{document}

which gives:

enter image description here

How can I remove the excess in the rule length above the section titles, but keeping the rule in the rest of the text? In other words: how can I set the rule length?

6

First I fixed the line-breaking problem with \sloppy (SOP for narrow columns). Next I used \globalcounter{section} to fix the section numbers. Finally I erased the top part of the line between the columns with white-out.

\documentclass[11pt, a4paper]{article}
\usepackage{paracol,lipsum}
\usepackage{xcolor}

\globalcounter{section}

\begin{document}

\lipsum[1]
\vspace{1cm}

\setcolumnwidth{0.29\textwidth,0.69\textwidth}
\begin{paracol}{2}

\setlength{\columnseprule}{0.4pt}
\setlength{\columnsep}{2em}

\begin{leftcolumn}
  \sloppy
  \section{Section One}
  \lipsum [1-2]
\end{leftcolumn}

\begin{rightcolumn}
  \section{section two}
  \leavevmode\llap{\smash{\color{white}\rule[\ht\strutbox]{\columnsep}{2cm}}}% erase top
  \lipsum[3-4]
\end{rightcolumn}

\end{paracol}

\end{document}

full page

  • Under both MacTeX 2016 and 2017 (pretest) your code does not compile: Undefined control sequence. l.12 \columnratio {0.29,0.69}. Odd. I checked the documentation and everything looks right... – sgmoye May 24 '17 at 13:52
  • @sgmoye - In any case, it was being used incorrectly. – John Kormylo May 24 '17 at 14:06
  • My bad. I found an old copy of paracol in my ~/texmf directory. Sorry for the noise. – sgmoye May 24 '17 at 14:07
  • I had to change the size of white thing covering the rule, but it worked well. Thanks! – Julia Roquette May 25 '17 at 16:35

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.