如何使用整个页面宽度打印索引

如何使用整个页面宽度打印索引

我正在使用memoirxelatex。我的页面设置使用类型块和边距。这对于常规章节来说没问题,但我希望能够在自动生成的内容(如目录、索引、参考书目)中使用整个页面宽度……这是我的文档设置的示例:

\documentclass[a4paper,twoside,openright,12pt]{memoir}

\settypeblocksize{*}{110mm}{2.1}
\setlrmargins{2.5cm}{*}{*}
\setulmargins{3cm}{*}{0.5}
\marginparmargin{outer}
\setmarginnotes{0.75cm}{5.25cm}{1em}
\checkandfixthelayout

\makechapterstyle{chapStyle}{%
\setlength{\chapindent}{\marginparsep}
\addtolength{\chapindent}{\marginparwidth}
\renewcommand{\printchaptertitle}[1]{%
    \begin{adjustwidth}{}{-\chapindent}
        \chaptitlefont{##1}%
    \end{adjustwidth}
}
\renewcommand{\printchapternum}{%
        \chapnumfont\thechapter
}%
}
\chapterstyle{chapStyle}

\usepackage{lipsum,kantlipsum}
\usepackage{showframe}
\makeindex
\onecolindex

\begin{document}

\frontmatter
\tableofcontents*

\mainmatter
\chapter[Chapter one...]{Chapter one. It has long title that is two rows long}
\kant[1]
Index entry 1\index{One very long index entry that will take two rows when it's printed}.
\section{Section 1.1}
\kant[2-3]
\section{Section 1.2}
\kant[4-5]

\chapter{Chapter two}
\kant[6]
\section{Section 2.1}
\kant[7-8]
\section{Section 2.2}
\kant[9-10]

\chapter{Chapter three}
\kant[11]
\section{Section 3.1}
\kant[12-13]
\section{Section 3.2}
\kant[13-14]

\backmatter
\printindex

\end{document}

答案1

memoir不提供改变页面几何形状的工具。

geometry您可以使用和来完成\newgeometry

\documentclass[a4paper,twoside,openright,12pt]{memoir}
\usepackage{geometry}

\geometry{
  textwidth=110mm,
  textheight=231mm,
  heightrounded,
  marginparwidth=5.25cm,
  marginparsep=0.75cm,
  left=2.5cm,
  top=3cm,
  showframe,% just for checking
}

\makechapterstyle{chapStyle}{%
\setlength{\chapindent}{\marginparsep}
\addtolength{\chapindent}{\marginparwidth}
\renewcommand{\printchaptertitle}[1]{%
    \begin{adjustwidth}{}{-\chapindent}
        \chaptitlefont{##1}%
    \end{adjustwidth}
}
\renewcommand{\printchapternum}{%
        \chapnumfont\thechapter
}%
}
\chapterstyle{chapStyle}

\usepackage{lipsum,kantlipsum}
\makeindex
\onecolindex

\begin{document}

\frontmatter

\newgeometry{
  left=2.5cm,
  textwidth=17cm,
  top=3cm,
  textheight=231mm,
  heightrounded,
}
\tableofcontents*
\restoregeometry

\mainmatter
\chapter[Chapter one...]{Chapter one. It has long title that is two rows long}
\kant[1]
Index entry 1\index{One very long index entry that will take two rows when it's printed}.
\section{Section 1.1}
\kant[2-3]
\section{Section 1.2}
\kant[4-5]

\chapter{Chapter two}
\kant[6]
\section{Section 2.1}
\kant[7-8]
\section{Section 2.2}
\kant[9-10]

\chapter{Chapter three}
\kant[11]
\section{Section 3.1}
\kant[12-13]
\section{Section 3.2}
\kant[13-14]

\backmatter
\newgeometry{
  left=2.5cm,
  textwidth=17cm,
  top=3cm,
  textheight=231mm,
  heightrounded,
}
\printindex
\restoregeometry

\end{document}

调整参数以适应。

相关内容