我想生成一个混合单面和双面页面的 PDF,当在 evince 中选择“双视图”时,这些页面可以在 PDF 查看器中正确显示:
(以及 Adobe Acrobat 中的等效视图/选项)
例如假设我有以下内容:
- 覆盖
- 第 1 页和第 2 页双面
- 第 3 页 单面 左侧
- 第 4 页 单面 左侧
- 第 5 页和第 6 页双面
- 第 7 页 单面 左侧
- 第 8 页 单面 左侧
从这个 MWE 开始:
\documentclass{article}
\usepackage{xcolor}
\usepackage[papersize={200mm,200mm},margin=0mm]{geometry}
\usepackage{tikz}
\usetikzlibrary{calc}
\parindent=0pt
\begin{document}
% page#cover double sided
\eject
\pdfpagewidth=405mm
\pdfpageheight=200mm
\begin{tikzpicture}[remember picture, overlay]
\draw node[inner sep=0] at ([xshift=202.5mm, yshift=-100mm] current page.north west) {
\includegraphics[width=405mm, height=200mm]{example-image}
};
\end{tikzpicture}
% page#001-002 double sided
\eject
\pdfpagewidth=400mm
\pdfpageheight=200mm
\begin{tikzpicture}[remember picture, overlay]
\draw node[inner sep=0] at ([xshift=200mm, yshift=-100mm] current page.north west) {
\includegraphics[width=400mm, height=200mm]{example-image}
};
\end{tikzpicture}
% page#003 single sided left
\eject
\pdfpagewidth=200mm
\pdfpageheight=200mm
\begin{tikzpicture}[remember picture, overlay]
\draw node[inner sep=0] at ([xshift=100mm, yshift=-100mm] current page.north west) {
\includegraphics[width=200mm, height=200mm]{example-image}
};
\end{tikzpicture}
% page#004 single sided right
\eject
\pdfpagewidth=200mm
\pdfpageheight=200mm
\begin{tikzpicture}[remember picture, overlay]
\draw node[inner sep=0] at ([xshift=100mm, yshift=-100mm] current page.north west) {
\includegraphics[width=200mm, height=200mm]{example-image}
};
\end{tikzpicture}
% page#005-006 double sided
\eject
\pdfpagewidth=400mm
\pdfpageheight=200mm
\begin{tikzpicture}[remember picture, overlay]
\draw node[inner sep=0] at ([xshift=200mm, yshift=-100mm] current page.north west) {
\includegraphics[width=400mm, height=200mm]{example-image}
};
\end{tikzpicture}
% page#007 single sided left
\eject
\pdfpagewidth=200mm
\pdfpageheight=200mm
\begin{tikzpicture}[remember picture, overlay]
\draw node[inner sep=0] at ([xshift=100mm, yshift=-100mm] current page.north west) {
\includegraphics[width=200mm, height=200mm]{example-image}
};
\end{tikzpicture}
% page#008 single sided right
\eject
\pdfpagewidth=200mm
\pdfpageheight=200mm
\begin{tikzpicture}[remember picture, overlay]
\draw node[inner sep=0] at ([xshift=100mm, yshift=-100mm] current page.north west) {
\includegraphics[width=200mm, height=200mm]{example-image}
};
\end{tikzpicture}
\end{document}
我希望最终得到一个可以在 evince 中以以下布局查看的 PDF:
|-------------|
| cover |
|-------------|
|-------------|
| 1 and 2 |
|-------------|
|-----| |-----|
| 3 | | 4 |
|-----| |-----|
|-------------|
| 5 and 6 |
|-------------|
|-----| |-----|
| 7 | | 8 |
|-----| |-----|
这可能吗?如果可以,那么实现该目的的 tex 指令是什么?
答案1
这显示了如何使用 flowfram 创建双页。请注意,\textwidth
不会随框架宽度而改变。
\documentclass{article}
\usepackage{xcolor}
\usepackage[papersize={405mm,200mm},margin=0mm, noheadfoot]{geometry}
\usepackage{tikz}
\usetikzlibrary{calc}
\parindent=0pt
\pagestyle{empty}
\usepackage{flowfram}
\newflowframe[1,2,4]{405mm}{200mm}{0pt}{0pt}
\newflowframe[3,5]{200mm}{200mm}{0pt}{0pt}
\newflowframe[3,5]{200mm}{200mm}{205mm}{0pt}
\begin{document}
\vspace*{-12pt}% the first page is always off
% page#cover double sided
\begin{tikzpicture}
\draw node[inner sep=0] {\includegraphics[width=\textwidth, height=\textheight]{example-image}};
\end{tikzpicture}\newpage
% page 2 double sided
\begin{tikzpicture}
\draw node[inner sep=0] {\includegraphics[width=\textwidth, height=\textheight]{example-image}};
\end{tikzpicture}\newpage
% page 3 single sided left
\begin{tikzpicture}
\draw node[inner sep=0] {\includegraphics[width=\linewidth, height=\textheight]{example-image}};
\end{tikzpicture}\newpage
% page 3.5 single sided right
\begin{tikzpicture}
\draw node[inner sep=0] {\includegraphics[width=\linewidth, height=\textheight]{example-image}};
\end{tikzpicture}\newpage
% page 4 double sided
\begin{tikzpicture}
\draw node[inner sep=0] {\includegraphics[width=\textwidth, height=\textheight]{example-image}};
\end{tikzpicture}\newpage
% page 5 single sided left
\begin{tikzpicture}
\draw node[inner sep=0] {\includegraphics[width=\linewidth, height=\textheight]{example-image}};
\end{tikzpicture}\newpage
% page 5.5 single sided right
\begin{tikzpicture}
\draw node[inner sep=0] {\includegraphics[width=\linewidth, height=\textheight]{example-image}};
\end{tikzpicture}\newpage
\end{document}