0

I have a two column layout defined as follows:

\usepackage{paracol}
\newcommand{\btwocol}{\begin{paracol}{2}}
\newcommand{\etwocol}{\end{paracol}}


\btwocol
Connect
Make sure that you can answer to the following questions:

\begin{itemize}
\tightlist
\item
  How do rockets work?
\item
  What would it take to ensure that rockets are safe?
\item
  What types of rocket propulsion systems do you know?
\end{itemize}

Later you will learn more prewriting strategies that will narrow the focus of the topic.

\vspace{5mm} \switchcolumn  \ensurevspace{2\baselineskip}

\begin{figure}
\centering
\includegraphics{https://upload.wikimedia.org/wikipedia/commons/thumb/2/27/Soyuz_rocket_ASTP.jpg/1200px-Soyuz_rocket_ASTP.jpg}
\caption{}
\end{figure}

\vspace{5mm}

\etwocol

I am using multiple \btwocol \etwocol blocks to create sections in the column layout, the problem that I have is the following:

If I start a new section close to the end of a page and the left column content is really small and it fits into that page but the second column image doesn't fit, then the first column is displayed on page n while the second column image gets pushed to page n+1.

Is there a way to force paracol to v-align the two columns of a section in case the content of the second doesn't fit ?

Here is an example of the issue and what I'm trying to achieve enter image description here

6
  • If you don't want text to break across pages, you don't need paracol. A minipage for the text and \raisebox to align the image will do. Commented Jun 22, 2017 at 19:25
  • Hi @JohnKormylo, while your suggestion seems promising for pure latex documents, my case is a markdown to latex and finally to pdf solution using pandoc, the problem I have is that I end up mixing markdown and latex, therefore the latex engine is failing if I nest things like heading (#heading) or images such as ![](imageurl) while using paracol they work fine and I can insert markdown inside the cols. Commented Jun 22, 2017 at 20:06
  • I think you are reinventing longtable Commented Jun 22, 2017 at 20:27
  • @MichaelFraiman I have that feeling too, my need is to have a two-col layout where I can have sections as described in the picture I attached (text and image) that will keep horizontal alignment. Commented Jun 22, 2017 at 20:28
  • This is called a table :-) Commented Jun 22, 2017 at 20:31

1 Answer 1

2

Having never used pandoc or imageurl (you really need to put stuff like that in the MWE), I have no idea if this will work for you. But since I went to the effort of creating the following, I thought I would share.

\documentclass{article}
\usepackage{graphicx}
\usepackage{showframe}

\newsavebox{\rightcolumn}% must be done first, #1 not passed

\makeatletter% for \@captype
\newenvironment{twocol}[1]% #1 = image and caption
{\setlength{\columnwidth}{\dimexpr 0.5\textwidth-0.5\columnsep}%
  \savebox{\rightcolumn}{\begin{minipage}{\columnwidth}
    \def\@captype{figure}#1\end{minipage}}
  \par\noindent\minipage[t]{\columnwidth}\strut}
{\endminipage\hfill
  \raisebox{\dimexpr\topskip-\ht\rightcolumn}{\usebox{\rightcolumn}}\par}
\makeatother

\begin{document}
\begin{twocol}{\includegraphics[width=\columnwidth]{example-image}\caption{test}}
Connect
Make sure that you can answer to the following questions:

\begin{itemize}
%\tightlist% from enumiten?
\item
  How do rockets work?
\item
  What would it take to ensure that rockets are safe?
\item
  What types of rocket propulsion systems do you know?
\end{itemize}

Later you will learn more prewriting strategies that will narrow the focus of the topic.
\end{twocol}
\end{document}

demo

You must log in to answer this question.

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