前言和正文需要不同的页面布局

前言和正文需要不同的页面布局

根据我的要求,我希望每本书的文本宽度和边距都不同。请告诉我如何解决这个问题。这是我的代码:

\documentclass{book}

\def\frontmatter{\setlength{\textwidth}{117mm}
\setlength\textwidth{117mm}
\setlength\oddsidemargin   {19mm}
\setlength\evensidemargin  {19mm}
\addtolength{\oddsidemargin}{-1in}
\addtolength{\evensidemargin}{-1in}
}


\def\mainmatter{\setlength\textwidth{122mm}
\setlength\oddsidemargin   {19mm}
\setlength\evensidemargin  {14mm}
\addtolength{\oddsidemargin}{-1in}
\addtolength{\evensidemargin}{-1in}}

\begin{document}

\frontmatter
\chapter{FM title}
On the Insert tab, the galleries $\hypint$  include items that are designed to coordinate with the overall look of your document. You can use these galleries to insert tables, headers, footers, lists, cover pages, and other document building blocks. When you create pictures, charts, or diagrams, they also coordinate with your current document look. You can easily change the formatting of selected text in the document text by choosing a look for the selected text from the Quick Styles gallery on the Home tab. You can also for
mat text directly by using the other controls on the Home tab.

\mainmatter
\chapter{FM title}
On the Insert tab, the galleries $\hypint$  include items that are designed to coordinate with the overall look of your document. You can use these galleries to insert tables, headers, footers, lists, cover pages, and other document building blocks. When you create pictures, charts, or diagrams, they also coordinate with your current document look. You can easily change the formatting of selected text in the document text by choosing a look for the selected text from the Quick Styles gallery on the Home tab. You can also for
mat text directly by using the other controls on the Home tab.

\end{document}

答案1

geometry按以下方式尝试使用该包:

\documentclass{book}
\usepackage[hmargin={19mm,14mm},
            vmargin=1in]{geometry}% setting for maintmater

\begin{document}

\frontmatter
\newgeometry{hmargin=19mm} % change to settings for frontmater
\chapter{FM title}
On the Insert tab, the galleries $yyy$  include items that are designed to coordinate with the overall look of your document. You can use these galleries to insert tables, headers, footers, lists, cover pages, and other document building blocks. When you create pictures, charts, or diagrams, they also coordinate with your current document look. You can easily change the formatting of selected text in the document text by choosing a look for the selected text from the Quick Styles gallery on the Home tab. You can also for
mat text directly by using the other controls on the Home tab.

\mainmatter
\restoregeometry   % restore to setting for mainmater
\chapter{FM title}
On the Insert tab, the galleries $xxx$  include items that are designed to coordinate with the overall look of your document. You can use these galleries to insert tables, headers, footers, lists, cover pages, and other document building blocks. When you create pictures, charts, or diagrams, they also coordinate with your current document look. You can easily change the formatting of selected text in the document text by choosing a look for the selected text from the Quick Styles gallery on the Home tab. You can also for
mat text directly by using the other controls on the Home tab.

\end{document}

相关内容