如何获得从 `parmargin` 到页面边缘的预定间隙?

如何获得从 `parmargin` 到页面边缘的预定间隙?

下图中所示的边距就是我指的间隙。我已经预先指定了左边距、水平边距比率、装订偏移量和 marginsep。我希望 LaTeX 能够计算出marginparwidth如下所示的间隙(从页面边缘到段落边距的间隙)具有预先指定的值,例如 10mm。使用给定的参数,该值为 35mm,但我希望自动计算该值,而不是通过反复试验来设置

在此处输入图片描述

我的源代码

\documentclass[]{book}

    \usepackage[a4paper]{geometry}
    \geometry{twoside=true, showframe=true}

        % Horizontal
        \geometry{inner=20mm}
        \geometry{hmarginratio=2:5}
        \geometry{bindingoffset=0pt}
        \geometry{marginparsep=5mm, marginparwidth=35mm}

        % Vertical
        \geometry{top=20mm}
        \geometry{vmarginratio=2:3}
        \geometry{headheight=8pt, headsep=14pt} 
        \geometry{footskip=24pt}



\begin{document}

Document Text

\end{document}

答案1

像这样?

可能的目标

\documentclass[a4paper,twoside]{book}

\usepackage{geometry}
\geometry{verbose, showframe}

% Horizontal
\geometry{inner=20mm,hmarginratio=2:5,outer=10mm,includemp=true, marginparsep=5mm}% includemp=true means that the calculation includes the space for marginal notes into the area allocated to text, rather than to the area allocated to the margins i.e. marginalia are no longer in the margin, strictly speaking. The effect of this is that outer specifies the width of the gap between the end of (text block and marginalia) and the paper edge, which is what you seem to want. In this case, either inner or hmarginratio is redundant, but I've left both as I don't know which you actually want. (The value of hmarginratio gives you an inner margin of 25mm rather than 20mm, I think.)

% Vertical
\geometry{top=20mm,vmarginratio=2:3,headheight=8pt, headsep=14pt,footskip=24pt}% note that headheight is too small unless you are using a very small font for the header or not using a header at all. If you use `fancyhdr` read the console output to see what you need instead, else you'll get inconsistent page layout.



\begin{document}

Document Text

\end{document}

相关内容