我怎样才能将文档从 B5 改为 A4 尺寸,同时仍保持相同的相对边距?我真的很喜欢当前的外观,但需要它是 A4 尺寸。
下面是对 MWE 的尝试(我不太清楚与边距有什么关系)。
\documentclass[10pt,twoside,b5paper,showtrims]{memoir}
% Stock and paper layout
\showtrimsoff
\pagebv
\setlrmarginsandblock{26mm}{20mm}{*}
\setulmarginsandblock{35mm}{30mm}{*}
\setheadfoot{8mm}{10mm}
\setlength{\headsep}{7mm}
\setlength{\marginparwidth}{18mm}
\setlength{\marginparsep}{2mm}
\checkandfixthelayout % Check if errors!
\sideparmargin{outer} % Put sidemargins in outer position
% Chapterstyle
\makeatletter
\makechapterstyle{mychapterstyle}{
\chapterstyle{default}
\def\format{\normalfont\sffamily}
\setlength\beforechapskip{0mm}
\renewcommand*{\chapnamefont}{\format\LARGE}
\renewcommand*{\chapnumfont}{\format\fontsize{40}{40}\selectfont}
\renewcommand*{\chaptitlefont}{\format\fontsize{32}{32}\selectfont}
\setlength\midchapskip{1ex}
\renewcommand*{\printchaptertitle}[1]{\raggedleft \chaptitlefont ##1}
\renewcommand*{\afterchaptertitle}{\vskip0.5\onelineskip \hrule \vskip1.3\onelineskip}
}
\makeatother
\chapterstyle{mychapterstyle}
% Header and footer
\def\hffont{\sffamily\small}
\makepagestyle{myruled}
\makeheadrule{myruled}{\textwidth}{\normalrulethickness}
\makeevenhead{myruled}{\hffont\thepage}{}{\hffont\leftmark}
\makeoddhead{myruled}{\hffont\rightmark}{}{\hffont\thepage}
\makeevenfoot{myruled}{}{}{}
\makeoddfoot{myruled}{}{}{}
\makepsmarks{myruled}{
\nouppercaseheads
\createmark{chapter}{both}{shownumber}{}{\space}
\createmark{section}{right}{shownumber}{}{\space}
\createplainmark{toc}{both}{\contentsname}
\createplainmark{lof}{both}{\listfigurename}
\createplainmark{lot}{both}{\listtablename}
\createplainmark{bib}{both}{\bibname}
\createplainmark{index}{both}{\indexname}
\createplainmark{glossary}{both}{\glossaryname}
}
\pagestyle{myruled}
\copypagestyle{cleared}{myruled} % When \cleardoublepage, use myruled instead of empty
\makeevenhead{cleared}{\hffont\thepage}{}{} % Remove leftmark on cleared pages
\makeevenfoot{plain}{}{}{} % No page number on plain even pages (chapter begin)
\makeoddfoot{plain}{}{}{} % No page number on plain odd pages (chapter begin)
%
\begin{document}
%
\chapter{Discussion}
\chapter{Modelling}
\end{document}
答案1
我最近在我编写的一个软件包中实现了这一点,以确保无论你选择哪种纸张尺寸,标题页的格式都是相同的。我通过计算页边距作为纸张高度的函数来实现这一点,所以它应该适用于你的情况。
我根据我所需的边距计算了常数(我将其与 \paperheight 相乘)。如果您知道边距和纸张高度,则可以找出常数并将其代入下面的表达式中(\paperheight 之前)。
\newlength{\innersidemargin}
\setlength{\innersidemargin}{0.135\paperheight}
% for A4 paper this is approximately 40 mm.
\newlength{\outersidemargin}
\setlength{\outersidemargin}{0.068\paperheight}
% for A4 paper this is approximately 20 mm.
\newlength{\topsidemargin}
\setlength{\topsidemargin}{0.10\paperheight}
% for A4 paper this is approximately 29 mm.
\newlength{\bottomsidemargin}
\setlength{\bottomsidemargin}{\outersidemargin}
% for A4 paper this is approximately 20 mm.
然后使用几何包设置边距
\usepackage{geometry}
\geometry{inner=\innersidemargin,%
outer=\outersidemargin,%
top=\topsidemargin,%
bottom=\bottomsidemargin}%
希望有所帮助。