4

Related Question

Aim:

I develop a din-a4 questionnaire and want to typeset the questions in a two column layout. As a constraint i don't want columnbreaks or pagebreaks inside a test item. In addition the columns should be separated by a rule.

Current status:

Unfortunately the \columnseprule hangs over the bottom of the type area.

The following MWE illustrates this (look at the bottom of the first output page):

MWE

\documentclass{scrartcl}

\usepackage{tikz}
\usepackage{multicol}
\usepackage{adjustbox}
\usepackage{showframe}

\setlength\parindent{0pt}
\setlength\parskip{1.5ex}
\setlength\parsep{1.5\parskip}
\setlength\fboxsep{0pt}

\newcommand{\drawbox}[2][1] {
   \adjustbox{
     minipage=\linewidth,
     padding=1ex #1 0ex #1,
     center,
     bgcolor=red!20,
     cfbox=red
  }{%
     #2
   }%
}

\begin{document}

\setlength\columnseprule{0.4pt}

\begin{multicols*}{2}
   \foreach \i in {1,...,3} {
      \drawbox[17em]{Item \i}\par
   }
\end{multicols*}

\end{document}

Output:

enter image description hereenter image description here

Question

How can i limit the \columseprule to the typearea?

3

Harrish showed a solution using a different package, but with respect to your initial example all that is needed is using the latest version of the multicol. I haven't tried to check when that got fixed or what the problem was with the version you used (might have been just with the latest update that reached CTAN just the other day) but if you use that (version 1.8l) then you get

enter image description here

4

You can use tcolorbox instead of adjustbox then there won't be any problem.

\documentclass{scrartcl}

\usepackage{multicol,lipsum,pgffor}
\usepackage{tcolorbox}
\usepackage{showframe}

\setlength\parindent{0pt}
\setlength\parskip{1.5ex}
\setlength\parsep{1.5\parskip}

\begin{document}

\setlength\columnseprule{0.4pt}

\begin{multicols*}{2}
   \foreach \i in {1,...,10} {
      \begin{tcolorbox}[colback=red!20,colframe=red,arc=0pt,outer arc=0pt]
        \lipsum[\i]
      \end{tcolorbox}
   }
\end{multicols*}

\end{document}

enter image description here

The details of how to tweak the box style are available in tcolorbox manual.

  • Indeed, \columnsep is limited to the type area now. Do you know whether tcolorbox takes any precautions for this case internally? Best regards – user1146332 Apr 2 '15 at 14:08
  • @user1146332 I am not so sure of the precautions taken by tcolorbox but for sure, it won't trouble you in this case. :) – user11232 Apr 2 '15 at 14:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.