梅威瑟:
\documentclass[11pt]{book}
\usepackage{paracol}
\begin{document}
\begin{paracol}{2}
\switchcolumn[1]* \section*{Heading in Language 1}
\switchcolumn[0] \section*{Heading in Language 2}
\begin{enumerate}
\switchcolumn[1]* \item Text in language 1
\switchcolumn[0] \item Text in language 2
\begin{itemize}
\item \switchcolumn[1]* Why does this spill over? Shouldn't it wrap?
\item \switchcolumn[0] Why does this spill over? It shouldn't go into margins.
\end{itemize}
\switchcolumn[1]* \item More text in language 1
\switchcolumn[0] \item More text in language 2
\switchcolumn[1]* \item Yet more text in language 1
\switchcolumn[0] \item Yet more text in language 2
\end{enumerate}
\end{paracol}
\end{document}
输出:
如何更改 itemize 环境的列宽并防止其溢出?
答案1
再次,您的 MWE 违反了规则“不要在 paracol 中包含的列表类环境(枚举、逐项列举等)中执行 \switchcolumn。”以下内容遵守规则,因此运行良好。
\begin{enumerate}
\begin{paracol}{2}
\switchcolumn[1]* \item ...
\switchcolumn[0] \item ...
\switchcolumn[1]*
\begin{itemize} \item ...
\end{itemize}
\switchcolumn[0]
\begin{itemize} \item ...
\end{itemize}
\switchcolumn[1]* \item ...
\switchcolumn[0] \item ...
\switchcolumn[1]* \item ...
\switchcolumn[0] \item ...
\end{paracol}
\end{enumerate}
如果您有两个或更多个 \item-s 需要在 itemize 环境中对齐,则需要使用一些巧妙的技巧来获得适当的 \item 间空间。例如,在序言中使用以下 \def-initions;
\makeatlatter
\def\FirstList{\@topsepadd\z@}
\def\MidList{\@newlistfalse \@topsepadd\z@}
\def\LastList{\@newlistfalse}
\makeatother
您可以通过将其中一个空格添加到 \begin{itemize} 来获得适当的空格,如下所示。
\begin{itemize}\Firstlist % for the first chunk
\begin{itemize}\MidList % for non-first/non-last chunks
\begin{itemize}\LastList % for the last chunk