我有一个两列布局定义如下:
\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
我正在使用多个\btwocol \etwocol
块在列布局中创建部分,我遇到的问题如下:
如果我在靠近页面末尾的地方开始一个新的部分,并且左列内容非常小并且可以适合该页面,但第二列图像不适合,则第一列将显示在页面上,n
而第二列图像将被推送到页面n+1
。
如果第二列的内容放不下,有没有办法强制 paracol 对某一部分的两列进行垂直对齐?
答案1
我从未使用过 pandoc 或 imageurl(你确实需要在 MWE 中放入类似的东西),我不知道这是否适合你。但既然我努力创建了以下内容,我想分享一下。
\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}