3

My question is a dual to This one. In a pair of nested multicols environments, I want the inner one to have separation rules, i.e. the "checks" in the following mwe:

\documentclass{article}
\usepackage{multicol}

\begin{document}
\begin{multicols}{2} 
Test Test   Test Test Test Test Test Test Test Test

\begin{multicols}{2}\setlength{\columnseprule}{0.4pt}
Check Check Check Check Check Check Check Check 
\end{multicols} 
Test Test   Test Test   Test Test Test Test Test Test 
\end{multicols}
\end{document}

I tried to dualize the above post and remove the outside \setlength, as the above code. But then no separation ruler appears at all.

2 Answers 2

4

Just as in the earlier posting to which you provided a link to, the instruction \setlength{\columnseprule}{0.4pt} has to be run before the multicols environment it is supposed to affect.

To limit the scope of \setlength{\columnseprule}{0.4pt} to the "inner" instance, I suggest placing this instruction and the inner multicols environment in a separate TeX group, via \begingroup and \endgroup directives.

enter image description here

\documentclass{article}
\usepackage{multicol} % for 'multicols' environment

\begin{document}
\raggedright % just for this example

\begin{multicols}{2} 
Test1 Test1 Test1 Test1 Test1 Test1 Test1 Test1 Test1 Test1

\begingroup
\setlength{\columnseprule}{0.4pt}
\begin{multicols}{2}
Checka Checka Checka Checka 
Checkb Checkb Checkb Checkb 
\end{multicols} 
\endgroup

Test2 Test2 Test2 Test2 Test2 Test2 Test2 Test2 Test2 Test2 Test2 Test2 Test2 Test2
\end{multicols}

\end{document}
3

I'd define a suitable environment.

\documentclass{article}
\usepackage{multicol}
\usepackage{lipsum}

\newenvironment{rmulticols}[2][0.4pt]{%
  \setlength{\columnseprule}{#1}\begin{multicols}{#2}%
}{\end{multicols}}

\begin{document}

\begin{multicols}{2} 
\lipsum[1][1-2]

\begin{rmulticols}{2}
\lipsum[2][1-4]
\end{rmulticols} 
\lipsum[3]
\end{multicols}

Or the other way around

\begin{rmulticols}{2} 
\lipsum[1][1-2]

\begin{rmulticols}[0pt]{2}
\lipsum[2][1-4]
\end{rmulticols} 
\lipsum[3]
\end{rmulticols}

\end{document}

enter image description here

You must log in to answer this question.

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