我正在为孩子们写一本小册子。最后我想插入要剪切的材料(拼图、图片……)。
我的问题是如何插入空白页以确保仅在最后的奇数页上打印?
谢谢。
% !TeX encoding = utf8
% !TeX spellcheck = en_GB
% !TeX TS-program = lualatex
\documentclass[twoside]{memoir}
\usepackage{easyfig}
\usepackage{xparse}
\usepackage{hyperref}
\hypersetup{colorlinks}
\usepackage{cleveref}
\gdef\adecouper{}
\makeatletter
\renewcommand{\thefigure}{\@arabic\c@figure}
\NewDocumentCommand{\ImageADecouper}{om}{\textbf{Use picture \cref{fig:#2} p.~\pageref{fig:#2}.} \g@addto@macro\adecouper{\Figure[here, #1]{#2}}}
\makeatother
\AtEndDocument{\cleartorecto Pictures to be cut. Must be printed on odd pages…\adecouper}
\usepackage{lipsum}
\begin{document}
\lipsum[1]
\ImageADecouper[width=\linewidth, caption={Test}]{example-image}
\lipsum[2]
\ImageADecouper[width=\linewidth, caption={Test a}]{example-image-a}
\lipsum[3]
\ImageADecouper[width=\linewidth, caption={Test b}]{example-image-b}
\lipsum[4]
\end{document}
答案1
此解决方案使用 paracol 来区分奇数页和偶数页。您可能还想看看 endfloat 包。
那么 easyfig 可以将图片和标题分开吗?很有趣,但不是很好。
\documentclass[twoside]{memoir}
\usepackage{easyfig}
\usepackage{xparse}
\usepackage{hyperref}
\hypersetup{colorlinks}
\usepackage{cleveref}
\usepackage{paracol}
\gdef\adecouper{}
\makeatletter
\renewcommand{\thefigure}{\@arabic\c@figure}
\NewDocumentCommand{\ImageADecouper}{om}{\textbf{Use picture \cref{fig:#2} p.~\pageref{fig:#2}.} \g@addto@macro\adecouper{\Figure[here, #1]{#2}}}
\makeatother
\usepackage{lipsum}
\begin{document}
\lipsum[1]
\ImageADecouper[width=\linewidth, caption={Test}]{example-image}
\lipsum[2]
\ImageADecouper[width=\linewidth, caption={Test a}]{example-image-a}
\lipsum[3]
\ImageADecouper[width=\linewidth, caption={Test b}]{example-image-b}
\lipsum[4]
\cleartorecto
\begin{paracol}[1]*{2}
Pictures to be cut. Must be printed on odd pages…\adecouper
\end{paracol}
\end{document}
答案2
我对宏的参数做了些许修改,在前面\adecouper
添加了一个选项 ,这样最后的每张图片都会打印在奇数页上。\cleartorecto
\Figure
% blankendproc.tex SE 575493
% !TeX encoding = utf8
% !TeX spellcheck = en_GB
% !TeX TS-program = lualatex
\documentclass[twoside]{memoir}
\usepackage{easyfig}
\usepackage{xparse}
\usepackage{hyperref}
\hypersetup{colorlinks}
\usepackage{cleveref}
\gdef\adecouper{}
\makeatletter
\renewcommand{\thefigure}{\@arabic\c@figure}
\NewDocumentCommand{\ImageADecouper}{om}{\textbf{Use picture \cref{fig:#2} p.~\pageref{fig:#2}.}
\g@addto@macro\adecouper{\cleartorecto\Figure[here, #1]{#2}}} %%%%% changed this
\makeatother
%%%% moved the argument to just before \end{document}
%\AtEndDocument{\cleartorecto Pictures to be cut. Must be printed on odd pages…\adecouper}
\usepackage{lipsum}
\leavespergathering{6}
\begin{document}
\lipsum[1]
\ImageADecouper[width=\linewidth, caption={Test}]{example-image}
\lipsum[2]
\ImageADecouper[width=\linewidth, caption={Test a}]{example-image-a}
\lipsum[3]
\ImageADecouper[width=\linewidth, caption={Test b}]{example-image-b}
\lipsum[4]
\cleartorecto Pictures to be cut. Must be printed on odd pages…\adecouper
\end{document}
我不确定你是否想在最后留一些空白页,以便在打印后粘贴不同的材料。我使用了memoir
宏\leavespergathering{<num>}
执行此操作,这将产生多2num
页,并在末尾留有空白页以弥补数量(如果需要)(请参阅第节集会或签名在手册中)。
答案3
这是一个简单的方法。
% !TeX encoding = utf8
% !TeX spellcheck = en_GB
% !TeX TS-program = lualatex
\documentclass[twoside]{memoir}
\usepackage{easyfig}
\usepackage{xparse}
\usepackage{hyperref}
\hypersetup{colorlinks}
\usepackage{cleveref}
\usepackage{afterpage}
\gdef\adecouper{}
\makeatletter
\renewcommand{\thefigure}{\@arabic\c@figure}
\NewDocumentCommand{\ImageADecouper}{om}{\textbf{Use picture \cref{fig:#2} p.~\pageref{fig:#2}.} \g@addto@macro\adecouper{\Figure[here, #1]{#2}}}
\makeatother
%\AtEndDocument{\cleartorecto Pictures to be cut. Must be printed on odd pages…\adecouper}
\usepackage{lipsum}
\begin{document}
1. \lipsum[1]
\textbf{Use picture \cref{fig:TestA} p.~\pageref{fig:TestA}.}
2. \lipsum[2]
\textbf{Use picture \cref{fig:TestB} p.~\pageref{fig:TestB}.}
3. \lipsum[3]
\textbf{Use picture \cref{fig:TestC} p.~\pageref{fig:TestC}.}
4. \lipsum[4]
\chapter*{Pictures to be cut}
\cleardoublepage
\begin{figure}[!t]
\centering
\includegraphics[width=\linewidth]{example-image-A}
\caption{Test A}
\label{fig:TestA}
\end{figure}
\cleardoublepage
\begin{figure}[!t]
\centering
\includegraphics[width=\linewidth]{example-image-B}
\caption{Test B}
\label{fig:TestB}
\end{figure}
\cleardoublepage
\begin{figure}[!t]
\centering
\includegraphics[width=\linewidth]{example-image-C}
\caption{Test C}
\label{fig:TestC}
\end{figure}
\end{document}