![如何使奇数页和偶数页的页边距不同?](https://linux22.com/image/282494/%E5%A6%82%E4%BD%95%E4%BD%BF%E5%A5%87%E6%95%B0%E9%A1%B5%E5%92%8C%E5%81%B6%E6%95%B0%E9%A1%B5%E7%9A%84%E9%A1%B5%E8%BE%B9%E8%B7%9D%E4%B8%8D%E5%90%8C%EF%BC%9F.png)
我想制作一本书,其奇数页和偶数页的页边距具有以下规格。
我怎样才能在信纸上做到这一点?
答案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}