我经常为我的学生制作 A5 大小的讲义。我希望直接编译 A5 页面,以便在一张 A4 页面上复制原始 A5 页面。到目前为止,我的解决方案是制作第二个文档,使用软件包处理复制pdfpages
。这能否自动完成,在一次编译后在一张 A4 页面上生成两个类似的 A5 页面?文档始终适合一张 A5 页面。
原始 A5 文件:
\documentclass[a5paper,12pt,norsk]{article}
\usepackage[utf8]{inputenc}
\usepackage{babel,fouriernc,parskip,booktabs,array}
\usepackage[margin=1cm,landscape]{geometry}
\usepackage{enumitem}
\setlist{nolistsep}
\renewcommand\labelitemi{--}
\begin{document}
\thispagestyle{empty}
{\Large <<Jeg kan>> om kjemi}
\vspace{1em}
\begin{center}
\begin{tabular}{p{0.7\textwidth} |>{\centering}p{0.1\textwidth}| >{\centering}p{0.1\textwidth}}
\toprule
\textbf{Spørsmål} & \textbf{ja} & \textbf{nei} \tabularnewline
\hline
\dots some text & & \tabularnewline
\bottomrule
\end{tabular}
\end{center}
\end{document}
将 A5 纸张收集在一张 A4 纸上的“打印输出”文档
\documentclass[a4paper]{article}
\usepackage{pdfpages}
\usepackage[margin=0cm,showframe]{geometry}
\begin{document}
\includepdf[nup=1x2,pages={1,1}]{jegKan}
% \includepdf{vurderingsskjema}
\end{document}
答案1
以下内容使用 DG 所建议的pgfpages
包装在 A4 布局上进行 1x2 A5 打印,但在发货时自动复制每张 A5 页面的内容,这样您最终会在每张 A4 页面上获得两个相同的 A5 副本。
它还适用于多页文档。
\documentclass[a5paper,12pt,norsk]{article}
\usepackage[utf8]{inputenc}
\usepackage{babel,fouriernc,parskip,booktabs,array}
\usepackage[margin=1cm,landscape]{geometry}
\usepackage{enumitem}
\usepackage{pgfpages} % <— load the package
\pgfpagesuselayout{2 on 1}[a4paper,border shrink=5mm] % <— set options
\usepackage{atbegshi}
% duplicate the content at shipout time
\AtBeginShipout{
\pgfpagesshipoutlogicalpage{1}\copy\AtBeginShipoutBox
\pgfpagesshipoutlogicalpage{2}\box\AtBeginShipoutBox
\pgfshipoutphysicalpage
}
\usepackage{blindtext}
\setlist{nolistsep}
\renewcommand\labelitemi{--}
\begin{document}
\thispagestyle{empty}
{\Large <<Jeg kan>> om kjemi}
\vspace{1em}
\begin{center}
\begin{tabular}{p{0.7\textwidth} |>{\centering}p{0.1\textwidth}| >{\centering}p{0.1\textwidth}}
\toprule
\textbf{Spørsmål} & \textbf{ja} & \textbf{nei} \tabularnewline
\hline
\dots some text & & \tabularnewline
\bottomrule
\end{tabular}
\end{center}
% To demonstrate that it also works with multiple pages
\newpage
\blindtext
\end{document}
评论:如果您的 a5 页面是纵向的,则设置如下:
\documentclass[a5paper]{article}
...
\usepackage[margin=1cm,portrait]{geometry}
...
\usepackage{pgfpages}
\pgfpagesuselayout{2 on 1}[a4paper,landscape,border shrink=5mm]
...
答案2
更新:添加了代码来复制页面。但您应该使用@Daniels 解决方案,因为它更加通用。
您可以使用pgfpages
:
\documentclass[a5paper,12pt,norsk]{article}
\usepackage[utf8]{inputenc}
\usepackage{babel,fouriernc,parskip,booktabs,array}
\usepackage[margin=1cm,landscape]{geometry}
\usepackage{forloop} % <-- needed to duplicate page
\usepackage{pgfpages} % <-- load the package
\pgfpagesuselayout{2 on 1}[a4paper,border shrink=5mm] % <-- set options
\usepackage{enumitem}
\setlist{nolistsep}
\renewcommand\labelitemi{--}
\begin{document}
\newcounter{counter}
\forloop{counter}{0}{\value{counter} < 2}{% <-- Print the page twice
\thispagestyle{empty}
{\Large <<Jeg kan>> om kjemi}
\vspace{1em}
\begin{center}
\begin{tabular}{p{0.7\textwidth} |>{\centering}p{0.1\textwidth}| >{\centering}p{0.1\textwidth}}
\toprule
\textbf{Spørsmål} & \textbf{ja} & \textbf{nei} \tabularnewline
\hline
\dots some text & & \tabularnewline
\bottomrule
\end{tabular}
\end{center}
\clearpage
}
\end{document}
其结果是:
答案3
这pgfmorepage
(github,卡坦) 扩展pgfpages
可以处理这个问题,包括页面的重复。
\documentclass[a5paper,12pt,norsk]{article}
%\url{https://tex.stackexchange.com/q/142187/86}
\usepackage[utf8]{inputenc}
\usepackage{babel,fouriernc,parskip,booktabs,array}
\usepackage[margin=1cm,landscape]{geometry}
\usepackage{enumitem}
\setlist{nolistsep}
\renewcommand\labelitemi{--}
\usepackage{pgfmorepages}
\pgfmorepagesloadextralayouts
\pgfpagesuselayout{repeated 2-up}[a4paper]
\begin{document}
\thispagestyle{empty}
{\Large <<Jeg kan>> om kjemi}
\vspace{1em}
\begin{center}
\begin{tabular}{p{0.7\textwidth} |>{\centering}p{0.1\textwidth}| >{\centering}p{0.1\textwidth}}
\toprule
\textbf{Spørsmål} & \textbf{ja} & \textbf{nei} \tabularnewline
\hline
\dots some text & & \tabularnewline
\bottomrule
\end{tabular}
\end{center}
\end{document}