[Tex/LaTex] how can I draw a vertical line between two specific columns in multicol environment

multicolrules

Trying to have a vertical line between the 4th and the 5th column in a multicol environment.

\documentclass[a4paper,10pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{multicol}
\usepackage{lipsum}
%opening


\begin{document}

\begin{multicols}{5}

\lipsum
%... line_beween_forth_and_fith_column
\end{multicols}


\end{document}

Best Answer

enter image description here

\documentclass[a4paper,10pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{multicol}
\usepackage{lipsum}
%opening

\makeatletter
\setlength\columnseprule{.5pt}

\def\columnseprulecolor\vrule\@width{%
\ifnum\count@=\numexpr\mult@rightbox+8\relax
\vrule\@width
\else
\kern
\fi
}
\makeatother

\begin{document}

\begin{multicols}{5}

\lipsum
%... line_beween_forth_and_fith_column
\end{multicols}


\end{document}
Related Question