paracol 包中的对齐问题

paracol 包中的对齐问题

我在对 paracol 包中的双面文本进行对齐时遇到了问题。

  \documentclass[14pt,openany ]{book}

\usepackage[a4paper,ignoreall,right=2cm, left=2cm,bottom=1.5cm,top=1.5cm]{geometry}
\usepackage{lipsum}
\usepackage{paracol}
\newcommand\mystrut{\rule{0pt}{14pt}}  
\begin{document}

\begin{paracol}{2}


\begin{leftcolumn*}\noindent
\lipsum[1]
\end{leftcolumn*}

\begin{rightcolumn*}\noindent\mystrut
Nam nibh leo, scelerisque quis ex a, venenatis iaculis libero. Integer neque libero, interdum quis nisl id, accumsan semper tortor. Aenean cursus quam sit amet nibh rhoncus tempor u
\end{rightcolumn*}

\begin{leftcolumn*}\noindent\mystrut
\lipsum[1]
\end{leftcolumn*}

\begin{rightcolumn*}\noindent\mystrut
Nam nibh leo, scelerisque quis ex a, venenatis iaculis libero. Integer neque libero, interdum quis nisl id, accumsan semper tortor. Aenean cursus quam sit amet nibh rhoncus tempor u
\end{rightcolumn*}

\begin{leftcolumn*}\noindent\mystrut
Nam nibh leo, scelerisque quis ex a, venenatis iaculis libero. Integer neque libero, interdum quis nisl id, accumsan semper tortor. Aenean cursus quam sit amet nibh rhoncus tempor u\end{leftcolumn*}

\begin{rightcolumn*}\noindent\mystrut
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec elementum, neque non pharetra placerat, mauris felis facilisis nisl, ut tempus lacus magna vitae arcu.
\end{rightcolumn*}

\begin{leftcolumn*}\noindent\mystrut
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec elementum, neque non pharetra placerat, mauris felis facilisis nisl, ut tempus lacus magna vitae arcu.
\end{leftcolumn*}

\begin{rightcolumn*}\noindent\mystrut
ed ipsum lectus, facilisis quis velit convallis, hendrerit suscipit augue. Quisque tincidunt hendrerit nulla, vel pulvinar turpis feugiat sit amet. Nam hendrerit diam quis velit porttitor, sed ornare mauris tempus. Morbi in sapien at ligula tincidunt condimentum. Proin interdum feugiat dui rutrum commodo. Aliquam dapibus nibh e
\end{rightcolumn*}



\end{paracol}
\end{document}

我想做段落之间的对齐,即,当我在第一列中为一个段落加星号时,该包将与第二列文本中的第一个段落对齐,第二个段落与第二个段落对齐,依此类推。

但最多我只得到这个输出。

在此处输入图片描述

答案1

也许这就是你正在寻找的:

\documentclass[14pt,openany ]{book}

\usepackage[a4paper,ignoreall,right=2cm, left=2cm,bottom=1.5cm,top=1.5cm]{geometry}
\usepackage{lipsum}
\usepackage{paracol}
\setlength{\parindent}{0pt}
\setlength{\parskip}{14pt}
\begin{document}

\begin{paracol}{2}

\lipsum[1]

\switchcolumn

Nam nibh leo, scelerisque quis ex a, venenatis iaculis libero. Integer neque libero, interdum quis nisl id, accumsan semper tortor. Aenean cursus quam sit amet nibh rhoncus tempor u

\switchcolumn*

\lipsum[1]

\switchcolumn

Nam nibh leo, scelerisque quis ex a, venenatis iaculis libero. Integer neque libero, interdum quis nisl id, accumsan semper tortor. Aenean cursus quam sit amet nibh rhoncus tempor u
\end{paracol}
\end{document}

在此处输入图片描述

来自paracols文档(第 3 节“列同步”)

\switchcolumn命令后面还可以跟一个“ * ”来同步列。通过\switchcolumn*(或\switchcolumn[ i ]*)从一列切换到另一列后,所有列都会垂直对齐到命令前最深列的底部。

如果您更喜欢leftcolumnrightcolumn符号,您也可以使用以下方法来实现上面显示的结果:

\begin{paracol}{2}

\begin{leftcolumn*}
\lipsum[1]
\end{leftcolumn*}

\begin{rightcolumn}
Nam nibh leo, scelerisque quis ex a, venenatis iaculis libero. Integer neque libero, interdum quis nisl id, accumsan semper tortor. Aenean cursus quam sit amet nibh rhoncus tempor u
\end{rightcolumn}

\begin{leftcolumn*}
\lipsum[1]
\end{leftcolumn*}

\begin{rightcolumn}
Nam nibh leo, scelerisque quis ex a, venenatis iaculis libero. Integer neque libero, interdum quis nisl id, accumsan semper tortor. Aenean cursus quam sit amet nibh rhoncus tempor u
\end{rightcolumn}

\end{paracol}

一般来说,请注意命令/环境的星号和无星号的交替使用。

此外,我还曾经\setlength{\parindent}{0pt}全局删除第一行的缩进并\setlength{\parskip}{14pt}更改段落之间的垂直间距(我猜这就是您想要做的\mystrut?)。

相关内容