[Tex/LaTex] Nested multicols with column separation line only in the most outer layer in LaTeX

multicol

I am using the multicols environment with 3 columns in my document (the main multicols). I managed to get the line separation between the columns with \setlength{\columnseprule}{0.4pt} inside the \begin{multicols*}{3}environment.

Now I need to use a nested multicols environment inside the main multicols that does not have the line separation. I tried to use \setlength{\columnseprule}{0pt} inside the nested multicols but there appears nevertheless a separation line in the nested multicols. How can I draw the separation line only in the main multicols but not in the nested ones?

I am using the following code:

\documentclass[a4paper, 6pt, landscape]{scrartcl}

\usepackage{multicol}


\begin{document}
\begin{multicols*}{3}
\setlength{\columnseprule}{0.4pt}
     Here follows some text with a separation line between the columns...
     \begin{multicols*}{2}
     \setlength{\columnseprule}{0pt}
       Text in the nested multicols that should be without separation lines...
     \setlength{\columnseprule}{0.4pt}
     \end{multicols*}
\end{multicols*}

\end{document}

Best Answer

It's not always easy to find out, when the columns of multicols environments are really set. Moving the \setlength commands outside the inner multicols environment solves your problem:

\documentclass[a4paper, 6pt, landscape]{scrartcl}

\usepackage{multicol}
\usepackage{lipsum}

\begin{document}
\setlength{\columnseprule}{0.4pt}
\begin{multicols*}{3}
     Here follows some text with a separation line between the columns...
     \setlength{\columnseprule}{0pt}
     \begin{multicols*}{2}
       Text in the nested multicols that should be without separation lines...
     \end{multicols*}
     \setlength{\columnseprule}{0.4pt}
     \lipsum
\end{multicols*}

\end{document}

enter image description here

Related Question