对于我的书,我使用具有不对称页面布局的回忆录文档类(旋转边距是外边距的一半)。对于索引,我使用adjmulticol在三列格式中有一个索引位置idxlayout。这几乎可以正常工作……除了所有项目都在一页上!当页面已满时,即页面不会按预期中断(参见下面的示例),并且当 adjmulticol 中有其他(非索引)文本时也是如此。
是什么原因导致了这种行为?有没有更好的方法来实现预期的结果?
编辑:
在我最初的问题中,不幸的是我删掉了三行:
\usepackage{calc}
文档类之后立即
\setlength{\marginwidth}{\marginparsep+\marginparwidth}
\setlength{\headwidth}{\textwidth+\marginwidth}
在 \usepackage{adjmulticol} 之前,这说明了为什么我实际上嵌套了一个adjmulticol和idxlayout。
我在实际情况下使用 \marginwidth 长度来计算 \headwidth 和其他项目(例如章节标题布局、扩展到外边距的新环境)。我希望我的问题更加清楚。
我需要更宽的文本宽度来在索引中放置更长的索引,以免它们不必要地分成两行。
\documentclass[twoside,openright]{memoir}
\usepackage{calc}% added in eddit
\setstocksize{297mm}{210mm} % A4
\settrimmedsize{\stockheight}{\stockwidth}{*} % A4
\newlength{\marginwidth}
\settypeblocksize{247mm}{120mm}{*}
\setulmargins{25mm}{*}{1} % upper, lower margin, ratio
\setlrmarginsandblock{30mm}{60mm}{*}% spinner, outer margin, ratio
\checkandfixthelayout
\setlength{\marginparwidth}{45mm}
\setlength{\marginparsep}{5mm}
\setlength{\marginwidth}{\marginparsep+\marginparwidth}% added in edit
\setlength{\headwidth}{\textwidth+\marginwidth}% added in edit
%---------------------------------------------------------------%
\usepackage{adjmulticol}
\usepackage[columns=3]{idxlayout}
\makeindex
\begin{document}
\mainmatter
\chapter{Test of indexing}
\index{Alpha}
alpha(a) \index{Alpha!alpha}
alpha(a) \index{Alpha!alpha!a} alpha(b) \index{Alpha!alpha!b}
alpha(c) \index{Alpha!alpha!c} alpha(d) \index{Alpha!alpha!d}
beta(a) \index{Alpha!beta}
\index{Alpha!beta!a}
beta(b) \index{Alpha!beta!b} beta(c) \index{Alpha!beta!c}
\section{Beta, Delta, Epsilon, Eta}
\index{Beta}
alpha(a) \index{Beta!alpha}
alpha(a) \index{Beta!alpha!a} alpha(b) \index{Beta!alpha!b}
alpha(c) \index{Beta!alpha!c} alpha(d) \index{Beta!alpha!d}
beta(a) \index{Beta!beta}
\index{Beta!beta!a}
beta(b) \index{Beta!beta!b} beta(c) \index{Beta!beta!c}
\index{Delta}
alpha(a) \index{Delta!alpha}
alpha(a) \index{Delta!alpha!a} alpha(b) \index{Delta!alpha!b}
alpha(c) \index{Delta!alpha!c} alpha(d) \index{Delta!alpha!d}
beta(a) \index{Delta!beta}
\index{Delta!beta!a}
beta(b) \index{Delta!beta!b} beta(c) \index{Delta!beta!c}
\index{Epsilon}
alpha(a) \index{Epsilon!alpha}
alpha(a) \index{Epsilon!alpha!a} alpha(b) \index{Epsilon!alpha!b}
alpha(c) \index{Epsilon!alpha!c} alpha(d) \index{Epsilon!alpha!d}
beta(a) \index{Epsilon!beta}
\index{Epsilon!beta!a}
beta(b) \index{Epsilon!beta!b} beta(c) \index{Epsilon!beta!c}
\index{Eta}
alpha(a) \index{Eta!alpha}
alpha(a) \index{Eta!alpha!a} alpha(b) \index{Eta!alpha!b}
alpha(c) \index{Eta!alpha!c} alpha(d) \index{Eta!alpha!d}
beta(a) \index{Eta!beta}
\index{Eta!beta!a}
beta(b) \index{Eta!beta!b} beta(c) \index{Eta!beta!c}
\section{Gamma, Kappa, Lambda, Omega}
\index{Gama}
alpha(a) \index{Gamma!alpha}
alpha(a) \index{Gamma!alpha!a} alpha(b) \index{Gamma!alpha!b}
alpha(c) \index{Gamma!alpha!c} alpha(d) \index{Gamma!alpha!d}
beta(a) \index{Gamma!beta}
\index{Gamma!beta!a}
beta(b) \index{Gamma!beta!b} beta(c) \index{Gamma!beta!c}
\index{Kappa}
alpha(a) \index{Kappa!alpha}
alpha(a) \index{Kappa!alpha!a} alpha(b) \index{Kappa!alpha!b}
alpha(c) \index{Kappa!alpha!c} alpha(d) \index{Kappa!alpha!d}
beta(a) \index{Kappa!beta}
\index{Kappa!beta!a}
beta(b) \index{Kappa!beta!b} beta(c) \index{Kappa!beta!c}
\index{Lambda}
alpha(a) \index{Lambda!alpha}
alpha(a) \index{Lambda!alpha!a} alpha(b) \index{Lambda!alpha!b}
alpha(c) \index{Lambda!alpha!c} alpha(d) \index{Lambda!alpha!d}
beta(a) \index{Lambda!beta}
\index{Lambda!beta!a}
beta(b) \index{Lambda!beta!b} beta(c) \index{Lambda!beta!c}
\index{Omega}
alpha(a) \index{Omega!alpha}
alpha(a) \index{Omega!alpha!a} alpha(b) \index{Omega!alpha!b}
alpha(c) \index{Omega!alpha!c} alpha(d) \index{Omega!alpha!d}
beta(a) \index{Omega!beta}
\index{Omega!beta!a}
beta(b) \index{Omega!beta!b} beta(c) \index{Omega!beta!c}
\section{Pi, Phi, Psi, Rho}
\index{Pi}
alpha(a) \index{Pi!alpha}
alpha(a) \index{Pi!alpha!a} alpha(b) \index{Pi!alpha!b}
alpha(c) \index{Pi!alpha!c} alpha(d) \index{Pi!alpha!d}
beta(a) \index{Pi!beta}
\index{Pi!beta!a}
beta(b) \index{Pi!beta!b} beta(c) \index{Pi!beta!c}
\index{Phi}
alpha(a) \index{Phi!alpha}
alpha(a) \index{Phi!alpha!a} alpha(b) \index{Phi!alpha!b}
alpha(c) \index{Phi!alpha!c} alpha(d) \index{Phi!alpha!d}
beta(a) \index{Phi!beta}
\index{Phi!beta!a}
beta(b) \index{Phi!beta!b} beta(c) \index{Phi!beta!c}
\index{Psi}
alpha(a) \index{Psi!alpha}
alpha(a) \index{Psi!alpha!a} alpha(b) \index{Psi!alpha!b}
alpha(c) \index{Psi!alpha!c} alpha(d) \index{Psi!alpha!d}
beta(a) \index{Psi!beta}
\index{Psi!beta!a}
beta(b) \index{Psi!beta!b} beta(c) \index{Psi!beta!c}
\index{Rho}
alpha(a) \index{Rho!alpha}
alpha(a) \index{Rho!alpha!a} alpha(b) \index{Rho!alpha!b}
alpha(c) \index{Rho!alpha!c} alpha(d) \index{Rho!alpha!d}
beta(a) \index{Rho!beta}
\index{Rho!beta!a}
beta(b) \index{Rho!beta!b} beta(c) \index{Rho!beta!c}
\section{Sigma, Theta, Xi}
\index{Sigma}
alpha(a) \index{Sigma!alpha}
alpha(a) \index{Sigma!alpha!a} alpha(b) \index{Sigma!alpha!b}
alpha(c) \index{Sigma!alpha!c} alpha(d) \index{Sigma!alpha!d}
beta(a) \index{Sigma!beta}
\index{Sigma!beta!a}
beta(b) \index{Sigma!beta!b} beta(c) \index{Sigma!beta!c}
\index{Theta}
alpha(a) \index{Theta!alpha}
alpha(a) \index{Theta!alpha!a} alpha(b) \index{Theta!alpha!b}
alpha(c) \index{Theta!alpha!c} alpha(d) \index{Theta!alpha!d}
beta(a) \index{Theta!beta}
\index{Theta!beta!a}
beta(b) \index{Theta!beta!b} beta(c) \index{Theta!beta!c}
\index{Xi}
alpha(a) \index{Xi!alpha}
alpha(a) \index{Xi!alpha!a} alpha(b) \index{Xi!alpha!b}
alpha(c) \index{Xi!alpha!c} alpha(d) \index{Xi!alpha!d}
beta(a) \index{Xi!beta}
\index{Xi!beta!a}
beta(b) \index{Xi!beta!b} beta(c) \index{Xi!beta!c}
\backmatter
\begin{adjmulticols}{1}{0mm}{-\marginwidth}\Large
\printindex
\end{adjmulticols}
\end{document}
答案1
我的idxlayout
包重新定义了theindex
环境,以便它使用multicols
环境。你\printindex
在一个adjmulticols
环境中封闭(据我所知,是经过修改的multicols
),这会导致嵌套( adj
)multicols
环境。缺少分页符似乎表明不支持嵌套这些环境。
我不确定您到底想实现什么——您定义了一个新的长度\marginwidth
,但从不将其从默认值 0pt 更改。我还怀疑更改文档中间的边距(紧接在 之前\printindex
)是满足您需求的正确解决方案,并且也可以使用memoir
-specific 方法。但是,这里有一个有点 hack 的解决方案:我们可以修补环境theindex
(由 重新定义idxlayout
),以便multicols
将其替换为adjmulticols
(加上后者环境所需的参数)。
\documentclass[twoside,openright]{memoir}
\setstocksize{297mm}{210mm} % A4
\settrimmedsize{\stockheight}{\stockwidth}{*} % A4
\newlength{\marginwidth}
\settypeblocksize{247mm}{120mm}{*}
\setulmargins{25mm}{*}{1} % upper, lower margin, ratio
\setlrmarginsandblock{30mm}{60mm}{*}% spinner, outer margin, ratio
\checkandfixthelayout
\setlength{\marginparwidth}{45mm}
\setlength{\marginparsep}{5mm}
\usepackage{adjmulticol}
\usepackage[columns=3]{idxlayout}
\renewcommand*{\indexfont}{\Large}% \indexfont is defined by idxlayout
\makeindex
% \usepackage{etoolbox}% already loaded by idxlayout
\makeatletter
\patchcmd{\theindex}{%
\begin{multicols}{\theidxcols}%
}{%
\begin{adjmulticols}{\theidxcols}{0mm}{-\marginwidth}%
}{}{}
\patchcmd{\endtheindex}{%
\end{multicols}%
}{%
\end{adjmulticols}%
}{}{}
\makeatother
\begin{document}
\mainmatter
\chapter{Test of indexing}
\index{Alpha}
alpha(a) \index{Alpha!alpha}
alpha(a) \index{Alpha!alpha!a} alpha(b) \index{Alpha!alpha!b}
alpha(c) \index{Alpha!alpha!c} alpha(d) \index{Alpha!alpha!d}
beta(a) \index{Alpha!beta}
\index{Alpha!beta!a}
beta(b) \index{Alpha!beta!b} beta(c) \index{Alpha!beta!c}
\section{Beta, Delta, Epsilon, Eta}
\index{Beta}
alpha(a) \index{Beta!alpha}
alpha(a) \index{Beta!alpha!a} alpha(b) \index{Beta!alpha!b}
alpha(c) \index{Beta!alpha!c} alpha(d) \index{Beta!alpha!d}
beta(a) \index{Beta!beta}
\index{Beta!beta!a}
beta(b) \index{Beta!beta!b} beta(c) \index{Beta!beta!c}
\index{Delta}
alpha(a) \index{Delta!alpha}
alpha(a) \index{Delta!alpha!a} alpha(b) \index{Delta!alpha!b}
alpha(c) \index{Delta!alpha!c} alpha(d) \index{Delta!alpha!d}
beta(a) \index{Delta!beta}
\index{Delta!beta!a}
beta(b) \index{Delta!beta!b} beta(c) \index{Delta!beta!c}
\index{Epsilon}
alpha(a) \index{Epsilon!alpha}
alpha(a) \index{Epsilon!alpha!a} alpha(b) \index{Epsilon!alpha!b}
alpha(c) \index{Epsilon!alpha!c} alpha(d) \index{Epsilon!alpha!d}
beta(a) \index{Epsilon!beta}
\index{Epsilon!beta!a}
beta(b) \index{Epsilon!beta!b} beta(c) \index{Epsilon!beta!c}
\index{Eta}
alpha(a) \index{Eta!alpha}
alpha(a) \index{Eta!alpha!a} alpha(b) \index{Eta!alpha!b}
alpha(c) \index{Eta!alpha!c} alpha(d) \index{Eta!alpha!d}
beta(a) \index{Eta!beta}
\index{Eta!beta!a}
beta(b) \index{Eta!beta!b} beta(c) \index{Eta!beta!c}
\section{Gamma, Kappa, Lambda, Omega}
\index{Gama}
alpha(a) \index{Gamma!alpha}
alpha(a) \index{Gamma!alpha!a} alpha(b) \index{Gamma!alpha!b}
alpha(c) \index{Gamma!alpha!c} alpha(d) \index{Gamma!alpha!d}
beta(a) \index{Gamma!beta}
\index{Gamma!beta!a}
beta(b) \index{Gamma!beta!b} beta(c) \index{Gamma!beta!c}
\index{Kappa}
alpha(a) \index{Kappa!alpha}
alpha(a) \index{Kappa!alpha!a} alpha(b) \index{Kappa!alpha!b}
alpha(c) \index{Kappa!alpha!c} alpha(d) \index{Kappa!alpha!d}
beta(a) \index{Kappa!beta}
\index{Kappa!beta!a}
beta(b) \index{Kappa!beta!b} beta(c) \index{Kappa!beta!c}
\index{Lambda}
alpha(a) \index{Lambda!alpha}
alpha(a) \index{Lambda!alpha!a} alpha(b) \index{Lambda!alpha!b}
alpha(c) \index{Lambda!alpha!c} alpha(d) \index{Lambda!alpha!d}
beta(a) \index{Lambda!beta}
\index{Lambda!beta!a}
beta(b) \index{Lambda!beta!b} beta(c) \index{Lambda!beta!c}
\index{Omega}
alpha(a) \index{Omega!alpha}
alpha(a) \index{Omega!alpha!a} alpha(b) \index{Omega!alpha!b}
alpha(c) \index{Omega!alpha!c} alpha(d) \index{Omega!alpha!d}
beta(a) \index{Omega!beta}
\index{Omega!beta!a}
beta(b) \index{Omega!beta!b} beta(c) \index{Omega!beta!c}
\section{Pi, Phi, Psi, Rho}
\index{Pi}
alpha(a) \index{Pi!alpha}
alpha(a) \index{Pi!alpha!a} alpha(b) \index{Pi!alpha!b}
alpha(c) \index{Pi!alpha!c} alpha(d) \index{Pi!alpha!d}
beta(a) \index{Pi!beta}
\index{Pi!beta!a}
beta(b) \index{Pi!beta!b} beta(c) \index{Pi!beta!c}
\index{Phi}
alpha(a) \index{Phi!alpha}
alpha(a) \index{Phi!alpha!a} alpha(b) \index{Phi!alpha!b}
alpha(c) \index{Phi!alpha!c} alpha(d) \index{Phi!alpha!d}
beta(a) \index{Phi!beta}
\index{Phi!beta!a}
beta(b) \index{Phi!beta!b} beta(c) \index{Phi!beta!c}
\index{Psi}
alpha(a) \index{Psi!alpha}
alpha(a) \index{Psi!alpha!a} alpha(b) \index{Psi!alpha!b}
alpha(c) \index{Psi!alpha!c} alpha(d) \index{Psi!alpha!d}
beta(a) \index{Psi!beta}
\index{Psi!beta!a}
beta(b) \index{Psi!beta!b} beta(c) \index{Psi!beta!c}
\index{Rho}
alpha(a) \index{Rho!alpha}
alpha(a) \index{Rho!alpha!a} alpha(b) \index{Rho!alpha!b}
alpha(c) \index{Rho!alpha!c} alpha(d) \index{Rho!alpha!d}
beta(a) \index{Rho!beta}
\index{Rho!beta!a}
beta(b) \index{Rho!beta!b} beta(c) \index{Rho!beta!c}
\section{Sigma, Theta, Xi}
\index{Sigma}
alpha(a) \index{Sigma!alpha}
alpha(a) \index{Sigma!alpha!a} alpha(b) \index{Sigma!alpha!b}
alpha(c) \index{Sigma!alpha!c} alpha(d) \index{Sigma!alpha!d}
beta(a) \index{Sigma!beta}
\index{Sigma!beta!a}
beta(b) \index{Sigma!beta!b} beta(c) \index{Sigma!beta!c}
\index{Theta}
alpha(a) \index{Theta!alpha}
alpha(a) \index{Theta!alpha!a} alpha(b) \index{Theta!alpha!b}
alpha(c) \index{Theta!alpha!c} alpha(d) \index{Theta!alpha!d}
beta(a) \index{Theta!beta}
\index{Theta!beta!a}
beta(b) \index{Theta!beta!b} beta(c) \index{Theta!beta!c}
\index{Xi}
alpha(a) \index{Xi!alpha}
alpha(a) \index{Xi!alpha!a} alpha(b) \index{Xi!alpha!b}
alpha(c) \index{Xi!alpha!c} alpha(d) \index{Xi!alpha!d}
beta(a) \index{Xi!beta}
\index{Xi!beta!a}
beta(b) \index{Xi!beta!b} beta(c) \index{Xi!beta!c}
\backmatter
\printindex
\end{document}