24

I have text, formulas and an enumeration. I tried to use multicols, but it divides the text where it wants. I used tabular, but it don't allow to have an enumeration or I don't know how to do it. In other words, I want to divide some piece of the page into 2 parts as it is shown in the picture:

enter image description here

I also want to save an enumeration. See also the border and alignment of the second part of the page. How can I do it in LaTeX?

Werner
  • 603,163

2 Answers2

30

You can use a minipage to achieve this along with a tabular. This method will not break across the pages though.

\documentclass{article}
\begin{document}
\begin{minipage}{0.45\textwidth}
\begin{enumerate}
  \item First item \\
        This is the second line in item and this may extend to third if long
  \item second item\ldots
\end{enumerate}
\end{minipage}%
\hfill
\begin{minipage}{0.45\textwidth}
\begin{tabular}{|p{\textwidth}}
This is second part \\
$f(x) = 2x + 3y$ This line may go all along the end and wrap afterwards to the next as seen here\\
This is a forced next line by ending the previous line 
\end{tabular}
\end{minipage}%
\end{document}

enter image description here

It seems the other possibility is with parallel package.

\documentclass{article}
\usepackage{parallel,enumitem}
\begin{document}
\noindent
Here we use \texttt{parallel} package.
\par
\begin{Parallel}[v]{0.48\textwidth}{0.48\textwidth}
\ParallelLText{\noindent
This is the left side.
\begin{enumerate}[itemsep=1ex,leftmargin=1cm,rightmargin=.52\textwidth]
  \item { First item}
  \item{second item}
\end{enumerate}
And you are back in business.\\
This list can break across pages automatically }
\ParallelRText{\noindent
This goes to the right. This may be going long. If you want you can input equations also.\\
$x=y+10$\\
This may be the best choice if you want this kind of thing to span multiple pages. }
\ParallelPar
\end{Parallel}
\end{document}

enter image description here

David Carlisle
  • 757,742
0

If you wanted to use multicols and then divide the page on where you want. You can use \columnbreak to achieve this.

Here is a complete example demonstrating how to achieve this (which is adapted from the complete overleaf example here):

\documentclass{article}
\usepackage{blindtext}
\usepackage{multicol}
\usepackage{color}
\usepackage{xcolor}
\setlength{\columnseprule}{1pt}
\def\columnseprulecolor{\color{black}}

\begin{document}

\begin{multicols}{2} Hello, here is some text without a meaning. This text should show what a printed text will look like at this place.

\begin{enumerate} \item { First item} \item{second item} \end{enumerate}

If you want to move to the next column of your choice then do so here.

\columnbreak This will be in a new column, here is some text without a meaning. This text should show what a printed text will look like at this place.

If you read this text, you will get no information. Really? Is there no information? Is there... \end{multicols}

\end{document}

Visualisation of compiled document

enter image description here

Note, to achieve the page split the \def\columnseprulecolor{\color{black}} was set at the top of the example, here I have used black, but can be set to other colors, such as blue - for more information, see the Overleaf Color Documentation.

For reference, I used Overleaf to generate this example.