我想在 A4 纸上打印一本 24x17 厘米的书,固定文本块大小和页边距之间的比例(如您从代码中的注释中看到的那样)。不幸的是,打印后,文本块大小是正确的,但页边距之间的比例不是所选的(有点不准确):我不明白问题是什么。
这是代码:
\documentclass[showtrims,12pt,twoside]{memoir}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lipsum}
\setstocksize{297mm}{210mm} %set the stock size at A4 (297x210mm)
\settrimmedsize{240mm}{170mm}{*} %set the page size at 24x17cm
\settrims{28.5mm}{20mm} %center the page on the stock
\settypeblocksize{185mm}{125mm}{*} %set the textblock size
\setlrmargins{*}{*}{1,5} %set the fore-edge margin 1,5 times the spine margin
\setulmargins{*}{*}{1} %set the lower margin the same as the upper margin
\begin{document}
\chapter{First chapter}
\lipsum[1]
\section{First section}
\lipsum[2-4]
\section{Second section}
\lipsum[5-8]
\end{document}
答案1
你忘了\checkandfixthelayout
:
\documentclass[showtrims,12pt,twoside]{memoir}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lipsum}
\setstocksize{297mm}{210mm} %set the stock size at A4 (297x210mm)
\settrimmedsize{240mm}{170mm}{*} %set the page size at 24x17cm
\settrims{28.5mm}{20mm} %center the page on the stock
\settypeblocksize{185mm}{125mm}{*} %set the textblock size
\setlrmargins{*}{*}{1.5} %set the fore-edge margin 1.5 times the spine margin
\setulmargins{*}{*}{1} %set the lower margin the same as the upper margin
\checkandfixthelayout
\newcommand{\testmargins}{%
\leavevmode
\makebox[0pt][r]{%
\smash{\vrule width 0.2pt height 30cm depth 30cm}%
\kern-0.2pt
\vrule height 0.1pt depth 0.1pt width 2\dimexpr(170mm-125mm)/5}%
\makebox[0pt][l]{%
\hspace\textwidth
\vrule height 0.1pt depth 0.1pt width 3\dimexpr(170mm-125mm)/5
\kern-0.2pt
\smash{\vrule width 0.2pt height 30cm depth 30cm}%
}%
}
\begin{document}
\chapter{First chapter}
\testmargins
\lipsum[1]
\section{First section}
\lipsum[2-4]
\section{Second section}
\lipsum[5-8]
\end{document}
该\testmargins
命令只是添加了一些规则以显示边距完全符合要求。