1

In my document I use 2 columns and 3 columns. I want to change only the width of the 3 columns with \setcolumnwith{}. The 2 columns should be unaffected.

\documentclass[parskip=full]{scrartcl}

\usepackage{blindtext}

\usepackage{paracol}

\begin{document}

  \begin{paracol}{2} % this is what I want
      \Blindtext[1]
    \switchcolumn
      \Blindtext[1]
  \end{paracol}

\setcolumnwidth{2cm,3cm,4cm} % this should only affect the 3 column

  \begin{paracol}{3} % this is what I want
      \blindtext
    \switchcolumn[1]
      \blindtext
    \switchcolumn[2]
      \blindtext
  \end{paracol}

  \begin{paracol}{2} % WRONG!
      \Blindtext[1]
    \switchcolumn
      \Blindtext[1]
  \end{paracol}

  \begin{paracol}{3} % this is what I want
      \blindtext
    \switchcolumn[1]
      \blindtext
    \switchcolumn[2]
      \blindtext
  \end{paracol}

\end{document}
2

It's possible to switch temporarily to a two-column mode by setting \columnratio{0.5} in a group.

\documentclass[parskip=full]{scrartcl}

\usepackage{blindtext}
\usepackage{xcolor}
\usepackage{paracol}

\begin{document}

  \begin{paracol}{2} % this is what I want
      \Blindtext[1]
    \switchcolumn
      \Blindtext[1]
  \end{paracol}

\setcolumnwidth{2cm,3cm,4cm} % this should only affect the 3 column


\begin{paracol}{3} % this is what I want
  \blindtext
  \switchcolumn[1]
  \blindtext
  \switchcolumn[2]
  \blindtext
\end{paracol}

\begingroup
\columnratio{0.5}
\begin{paracol}{2} % WRONG!
  \color{red}
  \Blindtext[1]
  \switchcolumn
  \Blindtext[1]
\end{paracol}
\endgroup

\begin{paracol}{3} % this is what I want
  \blindtext
  \switchcolumn[1]
  \blindtext
  \switchcolumn[2]
  \blindtext
\end{paracol}

\end{document}

enter image description here

Update

\documentclass[parskip=full]{scrartcl}

\usepackage{blindtext}
\usepackage{xcolor}
\usepackage{paracol}

\makeatletter
\newcommand{\setlocalcolumnwidth}[1]{%
  \let\oldratio\pcol@columnratioleft
  \setcolumnwidth{#1}%
}
\newcommand{\restorelocalcolumnwidth}{%
  \let\pcol@columnratioleft\oldratio%
}
\makeatother

\begin{document}

\columnratio{0.5}% Explicitly store the 0.5 ratio
\begin{paracol}{2} % this is what I want
  \Blindtext[1]
  \switchcolumn
  \Blindtext[1]
\end{paracol}


\setlocalcolumnwidth{2cm,3cm,4cm} % this should only affect the 3 column
\begin{paracol}{3} % this is what I want
  \blindtext
  \switchcolumn[1]
  \blindtext
  \switchcolumn[2]
  \blindtext
\end{paracol}
\restorelocalcolumnwidth


\begin{paracol}{2} % Works
  \color{red}
  \Blindtext[1]
  \switchcolumn
  \Blindtext[1]
\end{paracol}

\begin{paracol}{3} % this is what I want
  \blindtext
  \switchcolumn[1]
  \blindtext
  \switchcolumn[2]
  \blindtext
\end{paracol}

\begin{paracol}{2} % Works
  \color{red}
  \Blindtext[1]
  \switchcolumn
  \Blindtext[1]
\end{paracol}


\end{document}
  • Is it in my case also possible to switch temporarily to a three-column mode? (I have more two-columns than three-columns.) – Sr. Schneider Jun 5 '16 at 8:39
  • @Sr.Schneider: I'll take a look – user31729 Jun 5 '16 at 8:56
  • @Sr.Schneider: See the update please – user31729 Jun 5 '16 at 9:20
  • Exactly what I was looking for. Great answer! – Sr. Schneider Jun 5 '16 at 9:24
  • @Sr.Schneider: You're welcome. – user31729 Jun 5 '16 at 9:33

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.