[Tex/LaTex] How to avoid column vertical line inside multicol environment

multicoltwo-column

I use

\documentclass[11pt,twocolumn]{article} 
\setlength{\columnseprule}{1.0pt}

to write a two-column document with a a visible vertical line separation.

However, when I try to use \begin{multicols} to type a two-column section inside one of the columns of the page, the vertical line appears. How can we avoid this line?

enter image description here

Best Answer

Be aware that a multicols environment will not work if it extends past a main column break, in two column format.

Set \columnseprule to zero locally:

\documentclass[11pt,twocolumn]{article}
\usepackage[a4paper]{geometry}

\usepackage{multicol}

\usepackage{lipsum}

\setlength{\columnseprule}{0.4pt}

\begin{document}

\lipsum[1-2]

\begin{multicols}{2}\setlength{\columnseprule}{0pt}
abc def ghi jklmno
abc def ghi jklmno
abc def ghi jklmno
abc def ghi jklmno
abc def ghi jklmno
abc def ghi jklmno
\end{multicols}

\lipsum

\end{document}

enter image description here

On the other hand, using tasks, for instance, will avoid the usage of multicols.

\documentclass[11pt,twocolumn]{article}
\usepackage[a4paper]{geometry}

\usepackage{tasks}

\usepackage{lipsum}

\setlength{\columnseprule}{0.4pt}

\newenvironment{problem}
 {\par\addvspace{\topsep}%
  \stepcounter{problem}%
  \noindent\textbf{\theproblem}.\ignorespaces}
 {\par\addvspace{\topsep}}
\newcounter{problem}

\begin{document}

\lipsum[1-2]

\begin{problem}
Compute the following integrals
\begin{tasks}[counter-format=tsk[a])](2)
\task $\displaystyle\int 7\sqrt{7x-1}\,dx$
\task $\displaystyle\int \frac{\ln x}{x}\,dx$
\task $\displaystyle\int\sin(2x)\,dx$
\end{tasks}
\end{problem}

\lipsum

\end{document}

enter image description here

Related Question