我需要从多个 pdf 页面创建一个文档,并使用 tcolorbox 包中的“tcbincludepdf”来执行此操作。
但是,我无法操纵页面顺序。以下 MWE 生成一个 pdf,在附加的屏幕截图中,我用红色标记了我想要的页面顺序。
梅威瑟: 要创建 PDF 源文件:
\documentclass[a4paper]{article}
\usepackage{geometry}
\usepackage[final]{pdfpages}
\usepackage{graphicx}
\pagestyle{empty}
\usepackage[skins,raster]{tcolorbox}
\begin{document}
\centering
\scalebox{30}{1}\newpage
\scalebox{30}{2}\newpage
\scalebox{30}{3}\newpage
\scalebox{30}{4}\newpage
\scalebox{30}{5}\newpage
\scalebox{30}{6}\newpage
\scalebox{30}{7}\newpage
\scalebox{30}{8}
\end{document}
要创建 PDF 输出文件:
\documentclass[a4paper]{article}
\usepackage{geometry}
\usepackage[final]{pdfpages}
\usepackage{graphicx}
\pagestyle{empty}
\usepackage[skins,raster]{tcolorbox}
\begin{document}
\begin{tcbraster}[%
raster columns=2,
colframe = white,
raster height=\textheight,raster equal skip=0pt,blank,
colback = white,
colbacktitle = black!50,
fonttitle = \small\ttfamily,
boxsep = 0pt,
toptitle = 1mm,
bottomtitle = 1mm,
center title,
graphics pages = {1,2,3,4, 5,6,7},
title = {MWE\ [\imagepage]}]
\tcbincludepdf{1.pdf}
\end{tcbraster}
\end{document}
答案1
您可以更改键中的顺序graphics pages
:
\documentclass[a4paper]{article}
\usepackage{geometry}
\usepackage[final]{pdfpages}
\usepackage{graphicx}
\pagestyle{empty}
\usepackage[skins,raster]{tcolorbox}
\begin{document}
\begin{tcbraster}[%
raster columns=2,
colframe = white,
raster height=\textheight,raster equal skip=0pt,blank,
colback = white,
colbacktitle = black!50,
fonttitle = \small\ttfamily,
boxsep = 0pt,
toptitle = 1mm,
bottomtitle = 1mm,
center title,
raster halign=right, % to right align the last page
graphics pages = {2,1,4,3,6,5,7}, %<-- order
title = {MWE\ [\imagepage]}]
\tcbincludepdf{example-image-a4-numbered.pdf}
\end{tcbraster}
\end{document}