6

Is it possible to change the line spacing within a colchunk in a parcolumns environment? I tried the following without success:

\documentclass{article}
\usepackage{parcolumns}       
\begin{document}

\renewcommand{\baselinestretch}{1.5}\normalsize

\begin{parcolumns}[nofirstindent]{2}
\colchunk[1]{bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla}
\colchunk[2]{\renewcommand{\baselinestretch}{1.1}\footnotesize This works not. This works not. This works not. This works not. This works not. This works not. This works not. This works not. This works not. This works not. \par}
\colplacechunks
\end{parcolumns}

{\renewcommand{\baselinestretch}{1.1}\footnotesize This works fine. This works fine. This works fine. This works fine. This works fine. This works fine. This works fine. This works fine. This works fine. This works fine. \par}

\end{document}
3
  • It would have been better, if you had pointed to your question Page breaks in table rows or stated, that you are interested in more than two columns with different column sizes.
    – Speravir
    May 8, 2012 at 19:48
  • @Speravir Since multiple columns or different column sizes aren't an issue in the parcolumnsenvironment, all this was irrelevant for the original question. It is only relevant for Keks Dose's recommendation of the paracol package.
    – Dieter
    May 8, 2012 at 21:45
  • But Keks ;-) would have known before, so you misleaded him.
    – Speravir
    May 8, 2012 at 22:25

3 Answers 3

11
+100

What the package is doing is splitting each column up line by line and then re-assembling the page a line at a time constructing each line out of the lines from the columns, so the final result is even line spacing and the line spacing in the original column settings is necessarily lost

If you don't do that then you have to work a lot harder if you want to allow page breaks at arbitrary points mid-paragraph as if the columns have different line spacing there may not be any feasible break points in general.

So while it is possible to devise a parallel markup system that allows different spacing, probably parcolumns should not be your starting point for that as you would have to change almost the entire package.


It seems that the OP wants columns of different sizes. It seems that the paracol package supports that so long as you don't try to be too tricky with floating environments (which would need to be restricted to columns of the same width)

enter image description here

\documentclass{article}
\usepackage{paracol, blindtext, setspace}
\begin{document}

% EDIT: Space between columns:
\setlength{\columnsep}{24pt}
\renewcommand{\baselinestretch}{1.5}\normalsize

\begin{paracol}{2}
\showthe\columnwidth
\advance\columnwidth 5em \hsize\columnwidth
  \blindtext
\switchcolumn
\advance\columnwidth-10em \hsize\columnwidth
\begin{spacing}{1}
  \blindtext
\end{spacing}

\end{paracol}

\begin{paracol}{2}
\showthe\columnwidth
\advance\columnwidth 5em \hsize\columnwidth
  a a a a a a a\blindtext
\switchcolumn
\advance\columnwidth-10em \hsize\columnwidth
\begin{spacing}{1}
  b b b b b b b \blindtext
\end{spacing}

\end{paracol}
\end{document} 
2
  • 2
    If nobody comes up with a better answer, David deserves the bounty -- at least (Thank you, David) -- he had a look into the source code!
    – Keks Dose
    May 14, 2012 at 16:18
  • I don't understand your edited version, but it works and I will test it during the next months. I hope, Dieter, who asked, is as content as I am. Thank you very much!
    – Keks Dose
    May 18, 2012 at 8:45
3

You are right, it does not work with parcolumn. I did not check using the parallel-package, however, it works this way using the paracol-package:

\documentclass{article}
\usepackage{paracol, blindtext, setspace}
\begin{document}

% EDIT: Space between columns:
\setlength{\columnsep}{24pt}
\renewcommand{\baselinestretch}{1.5}\normalsize

\begin{paracol}{2}
  \blindtext
\switchcolumn
%\renewcommand{\baselinestretch}{1}%
\begin{spacing}{1}
  \blindtext
\end{spacing}

\end{paracol}
\end{document} 

WIZARD NEEDED!

As the comments below show, there is no easy way to change the width of the columns! The maintainer of paracol has documented the implementation broadly, but I fail to understand it. Regarding the columnwidth he says in section 2.1.3:

\hsize is TEX’s primitive register to have the width of a page or a column-page being built. It is let be \columnwidth by \paracol, while \pcol@mctext and \endparacol let it be \textwidth.

Äh, hmpf, whut? Would anybody else give us a hand?

8
  • The paracol package would be fine for me if a method exists to assign different width to the columns. Alas, skimming over the manual I couldn't find a hint that this is possible. Any ideas? The parallel package is no alternative for me, because I might need more than two columns.
    – Dieter
    May 8, 2012 at 12:46
  • @Dieter I've amendet my example: you can alter the length \columnsep.
    – Keks Dose
    May 8, 2012 at 12:56
  • Is it also possible to change the width of the two columns? At the moment their width is equal. I need a smaller left column.
    – Dieter
    May 8, 2012 at 13:16
  • @Dieter No idea, we need a wizard here who implements the function, or you ask the maintainer of paracol by email.
    – Keks Dose
    May 8, 2012 at 13:53
  • Where did you read the cited phrase? It’s not part of paracol-man.pdf for version 1.0, which now is in MiKTeX and AFAIS in TeXlive, too.
    – Speravir
    May 8, 2012 at 20:23
0

The answer Keks Dose posted doesn't work for me on LuaLaTeX or LaTeX (dvi or pdf). The right column narrows (like you'd expect from reducing the \columnwidth), but it doesn't actually move to the right, so the output overlaps with the left column. I managed to get it working using \leftskip and \rightskip instead of adjusting the \columnwidth primitive directly.

You pretty much have to invoke the \leftskip and \rightskip macros each time you use \switchcolumn unless they're both set to zero, or you won't get the correct result.

A much simplified example is posted below.

\documentclass{article}
\usepackage{paracol, blindtext}

\setlength{\columnsep}{2em}

\begin{document}
  \begin{paracol}{2}

    \leftskip=0em \rightskip=-5em
      WIDENED LEFT COLUMN \blindtext

    \switchcolumn

    \leftskip=5em \rightskip=0em
      NARROWED RIGHT COLUMN \blindtext

    \switchcolumn* % To keep paragraphs vertically aligned

    \leftskip=0em \rightskip=0em
      NORMAL LEFT COLUMN \blindtext

    \switchcolumn

    \leftskip=0em \rightskip=0em
      NORMAL RIGHT COLUMN \blindtext

  \end{paracol}    
\end{document}

I would have made an edit or a comment, but I don't have enough reputation. :\

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .