6

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}
2
  • 3
    the column rule should be specified before you start multicols, but also please provide a proper test file yours is incomplete and has undefined commands such as \setlenght Jan 30, 2017 at 19:23
  • Sorry for the misstyping of the \setlengthcommand. I updated the code so it can be compiled.
    – paescu
    Jan 30, 2017 at 19:41

2 Answers 2

7

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

1
  • Thank you, exactely what I needed. This helped me a lot!
    – paescu
    Jan 30, 2017 at 20:02
1

Note that if you are doing this frequently it might be more convenient to create a custom environment that will automatically restore the outer rule length with a local group.

\newenvironment{innermulticol}[1]
    {\begingroup\setlength{\columnseprule}{0pt}\begin{multicols*}{#1}}
    {\end{multicols*}\endgroup}

You will have less trouble if you decide to change the rule length of the outer columns afterwards.

You must log in to answer this question.

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