在 LaTeX 中布局平行列?
Layout parallel columns in LaTeX?
我正在尝试按如下方式布置段落:
1. 在介绍中,我会在所有栏目中放置段落。
2、然后平行跟随两个反对意见的栏目。它不同于两列布局,两列将平行,并且左侧的内容将始终保留在左侧,右侧的内容始终在多个页面的右侧。即使左列的参数量较短,右列的参数也不应浮入左列。
这是 HTML 中的示例:
https://www.biblegateway.com/passage/?search=1+Corinthians+15&version=CCB;KJ21
用于比较不同的翻译。
下面是我尝试实现的效果。
\documentclass{report}
\usepackage[english]{babel}
\usepackage{blindtext}
\begin{document}
\section{Introduction}
Here are the normal paragraph crossing colmuns.
\blindtext
\begin{minipage}[t]{0.5\textwidth}
\section{Argument on the Left}
Because I am on the left, so must I be not right?
\end{minipage}\begin{minipage}[t]{0.5\textwidth}
\section{Argument on the Right}
Because I am on the right, so I must be right!
\blindtext
\end{minipage}
\end{document}
差不多就达到了这个效果,只是两列之间没有空隙。
结果截图如下:
什么是更好的解决方案?
如何在 org-mode 中通过导出为 PDF(通过 LaTex)实现同样的效果?
要分隔列,使用较小的小页并在它们之间添加 space 就足够了。 Minipages 是盒子,你可以使用固定的 space(用 ~~~ 或 \hspace{}),但更好的是 rubber space \hfill.
\usepackage[english]{babel}
\usepackage{blindtext}
\begin{document}
\section{Introduction}
Here are the normal paragraph crossing colmuns.
\blindtext
\noindent\begin{minipage}[t]{0.48\textwidth}
\section{Argument on the Left}
Because I am on the left, so must I be not right?
\end{minipage}%
\hfill%
\begin{minipage}[t]{0.48\textwidth}
\section{Argument on the Right}
Because I am on the right, so I must be right!
\blindtext
\end{minipage}
\end{document}
\noindent
避免了正常的段落间距,并且 \hfill
将小页面推向左右边距。
但这不是最好的解决方案。您将无法正确管理分页符,并且有一个特定的软件包可以完全满足您的需求。
包 paracol
定义了一个具有 2(或更多)列的并行环境,并提供了一种通过在列之间切换来 "synchronize" 它们的方法。它负责分页符,绝对是您想要的。
这里有一个使用 paracol 的例子
\documentclass{report}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage{paracol}
\begin{document}
\section{Introduction}
Here are the normal paragraph crossing colmuns.
\blindtext
\begin{paracol}{2}
\section{Argument on the\ Left}
Because I am on the left, so must I be not right?
\switchcolumn
\section{Argument on the\ Right}
Because I am on the right, so I must be right!
\blindtext
\end{paracol}
\end{document}
如您所见,各栏之间的节编号是一致的,但如果您不喜欢,可以通过多种方式自定义包。看看 documentation
另请注意,我必须添加手动换行符才能正确格式化章节标题,但这是一个小缺点。
关于,org-mode,我用过,但我没有出口经验,不能真正帮助你。但是利用 paracol 的灵活性,您可以找到一些方法来定义执行您需要的宏。也许如果您提供 org-mode 导出,人们可以尝试找到解决方案。
我正在尝试按如下方式布置段落: 1. 在介绍中,我会在所有栏目中放置段落。 2、然后平行跟随两个反对意见的栏目。它不同于两列布局,两列将平行,并且左侧的内容将始终保留在左侧,右侧的内容始终在多个页面的右侧。即使左列的参数量较短,右列的参数也不应浮入左列。
这是 HTML 中的示例: https://www.biblegateway.com/passage/?search=1+Corinthians+15&version=CCB;KJ21 用于比较不同的翻译。
下面是我尝试实现的效果。
\documentclass{report}
\usepackage[english]{babel}
\usepackage{blindtext}
\begin{document}
\section{Introduction}
Here are the normal paragraph crossing colmuns.
\blindtext
\begin{minipage}[t]{0.5\textwidth}
\section{Argument on the Left}
Because I am on the left, so must I be not right?
\end{minipage}\begin{minipage}[t]{0.5\textwidth}
\section{Argument on the Right}
Because I am on the right, so I must be right!
\blindtext
\end{minipage}
\end{document}
差不多就达到了这个效果,只是两列之间没有空隙。
结果截图如下:
什么是更好的解决方案?
如何在 org-mode 中通过导出为 PDF(通过 LaTex)实现同样的效果?
要分隔列,使用较小的小页并在它们之间添加 space 就足够了。 Minipages 是盒子,你可以使用固定的 space(用 ~~~ 或 \hspace{}),但更好的是 rubber space \hfill.
\usepackage[english]{babel}
\usepackage{blindtext}
\begin{document}
\section{Introduction}
Here are the normal paragraph crossing colmuns.
\blindtext
\noindent\begin{minipage}[t]{0.48\textwidth}
\section{Argument on the Left}
Because I am on the left, so must I be not right?
\end{minipage}%
\hfill%
\begin{minipage}[t]{0.48\textwidth}
\section{Argument on the Right}
Because I am on the right, so I must be right!
\blindtext
\end{minipage}
\end{document}
\noindent
避免了正常的段落间距,并且 \hfill
将小页面推向左右边距。
但这不是最好的解决方案。您将无法正确管理分页符,并且有一个特定的软件包可以完全满足您的需求。
包 paracol
定义了一个具有 2(或更多)列的并行环境,并提供了一种通过在列之间切换来 "synchronize" 它们的方法。它负责分页符,绝对是您想要的。
这里有一个使用 paracol 的例子
\documentclass{report}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage{paracol}
\begin{document}
\section{Introduction}
Here are the normal paragraph crossing colmuns.
\blindtext
\begin{paracol}{2}
\section{Argument on the\ Left}
Because I am on the left, so must I be not right?
\switchcolumn
\section{Argument on the\ Right}
Because I am on the right, so I must be right!
\blindtext
\end{paracol}
\end{document}
如您所见,各栏之间的节编号是一致的,但如果您不喜欢,可以通过多种方式自定义包。看看 documentation 另请注意,我必须添加手动换行符才能正确格式化章节标题,但这是一个小缺点。
关于,org-mode,我用过,但我没有出口经验,不能真正帮助你。但是利用 paracol 的灵活性,您可以找到一些方法来定义执行您需要的宏。也许如果您提供 org-mode 导出,人们可以尝试找到解决方案。