我想制作一本书,其奇数页和偶数页的页边距具有以下规格。
我怎样才能在信纸上做到这一点?
答案1
这用于geometry
定义纸张并设置每页的平均边距。然后,水平边距会针对偶数页和奇数页进行偏移,以从平均值变为目标边距。对于垂直边距,我使用了 Heiko 的答案双面打印时奇数页移位将奇数页的页边距向下移动。
\documentclass[twoside]{article}
% DEFINE PAPER
\usepackage[letterpaper, portrait]{geometry}
\usepackage{lipsum}
%SET AVERAGE MARGIN
\geometry{
left={3.25cm},
right={3.25cm},
top={3.5cm},
bottom={3cm},
}
%SHIFT HORIZONTAL MARGIN ON EVEN/ODD PAGES
\addtolength\oddsidemargin {0.75cm}
\addtolength\evensidemargin {-1.25cm}
%SHIFT VERTICAL MARGIN ON ODD PAGES, BASED ON HEIKO'S ANSWER:
%https://tex.stackexchange.com/questions/79688/shift-odd-page-in-duplex-print/79708#79708
\usepackage{atbegshi}
\AtBeginShipout{%
\ifodd\value{page}%
\edef\mytemp{%
\ht\AtBeginShipoutBox=\the\ht\AtBeginShipoutBox\relax
\dp\AtBeginShipoutBox=\the\dp\AtBeginShipoutBox\relax
}%
\sbox\AtBeginShipoutBox{%
\raisebox{-0.5cm}{\usebox\AtBeginShipoutBox}%
}%
\mytemp
\fi
}
\begin{document}
\lipsum[1-20]
\end{document}