2

I'm writing a document and i want two column section to write a text. I use multicol package, but if the text of the first column is shorter than the second, the first text will align to the bottom of the second text.

How can i have the first text on the top?

I want the line1 of sec 1 align with line1 of sec2

\documentclass[12pt,a4paper]{article}
\title{Title}
\author{CE}
\usepackage{multicol}

\begin{document}
\maketitle

\begin{flushleft}
\begin{multicols}{2}

\section{sec1} 
line1 \\

\columnbreak

\section{sec 2}
line 1 \\
line 2 \\
line 3 \\
line 4

\end{multicols}
\end{flushleft}
\end{document}

enter image description here

2
  • 1
    Hi, welcome. Please add an entire compileable code that reproduces your problem.
    – AndréC
    Commented Oct 31, 2019 at 20:58
  • @AndréC I add the code
    – Zetlark
    Commented Oct 31, 2019 at 21:25

1 Answer 1

2

Just specify this with the command \raggedcolumns

screenshot

\documentclass[12pt,a4paper]{article}
\title{Title}
\author{CE}
\usepackage{multicol}

\begin{document}
\maketitle

\begin{flushleft}
\begin{multicols}{2}\raggedcolumns% <--- add these 
\section{sec1}


line1 

\columnbreak

\section{sec 2}
line 1 

line 2

line 3

line 4

\end{multicols}
\end{flushleft}
\end{document}
1
  • It works, thank you !!
    – Zetlark
    Commented Oct 31, 2019 at 22:26

You must log in to answer this question.

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