5

I'm trying to create a page with two columns, on one page only, the rest should be with only one column. I've tried the package multicoland that solves one part of my problem which is to get a divider line between the columns. For that I use

\setlength{\columnseprule}{0.5pt}
\def\columnseprulecolor{\color{orange}}

It seems like there is no way to change the width of the columns with multicol. I've seen different approaches like using minipagebut that removes my separator.

Is there any way to do this? I've been at it for a couple of hours now and can't seem to find a nice easy way to do it.

And I'm using the latexmk -pdf file.tex in linux to create my pdf's whatever that latex package is called.

\documentclass{article}
\usepackage{multicol}

\setlength{\columnseprule}{0.5pt}
\def\columnseprulecolor{\color{orange}}

\begin{document}
\begin{multicols}{2}
[
\section*{First Section}
Section title, spanning.
]
This is the left column that I want to be 0.3 of \textwidth

\columnbreak

And here is the right column with \textwidth 0.7
\end{multicols}

Something else here. The text should not be multicolumned in this part

\end{document}
  • Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – user31729 Jan 10 '15 at 0:28
  • Do you mean multicol package? – user31729 Jan 10 '15 at 0:29
  • The question title and I'm trying to create a page with two columns, on one page only, the rest should be with only one column. I've tried the package do not really match ;-) – user31729 Jan 10 '15 at 0:52
  • How do you want the text to flow within the 2-column page? Should it naturally flow from left to right (mid-paragraph, say), or will you issue a manual \columnbreak to move text from left to right? – Werner Jan 10 '15 at 1:27
6

You can use the parcolumns package:

\documentclass{article}
\usepackage{microtype}
\usepackage{parcolumns}

\usepackage{kantlipsum}

\begin{document}

\begin{parcolumns}[colwidths={1=.3\textwidth},rulebetween=true]{2}
\colchunk{% left column
  \sloppy
  \kant[1]
}
\colchunk{% right column
  \kant[2-3]
}
\end{parcolumns}

\end{document}

If you want a colored rule, you have to patch a command

\documentclass{article}
\usepackage{microtype}
\usepackage{parcolumns}
\usepackage{xcolor}
\usepackage{xpatch}

\usepackage{kantlipsum}

\makeatletter
\xpatchcmd{\pc@placeboxes}
  {\vrule}{\begingroup\color{orange}\vrule width 1pt\endgroup}
  {}{}
\makeatother

\begin{document}

\begin{parcolumns}[colwidths={1=.3\textwidth},rulebetween=true]{2}
\colchunk{% left column
  \sloppy
  \kant[1]
}
\colchunk{% right column
  \kant[2-3]
}
\end{parcolumns}

\end{document}

enter image description here

However, it seems that a simple minipage could do:

\documentclass{article}
\usepackage{microtype}
\usepackage{xcolor}

\usepackage{kantlipsum}

\begin{document}

\noindent
\begin{minipage}[t]{\dimexpr.3\textwidth-\tabcolsep-.5pt}
\sloppy
\kant*[1]
\end{minipage}%
\hfill\begingroup\color{orange}\vrule width 1pt\endgroup\hfill
\begin{minipage}[t]{\dimexpr.7\textwidth-\tabcolsep-.5pt}
\kant*[2-3]
\end{minipage}

\end{document}

The output is essentially the same.

| improve this answer | |
  • For the sake of your answer I tried both examples, and they gave the exact same output and does exactly what I want them to do! The minipage seems to be the best choice (less code). Thanks – Joakim Hellström Jan 10 '15 at 1:29

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.