如何创建特定嵌入 pdf 的目录?

如何创建特定嵌入 pdf 的目录?

我有一个包含许多 PDF 的主文档。其中一些是翻译,我必须为它们创建索引。

有没有办法标记包含的 pdf 并为它们创建目录?

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{pdfpages}
\usepackage{xcolor, etoolbox}
\usepackage{hyperref}



\begin{document}

\tableofcontents

\section{Translated Documents}

%\tableoftranslateddocuments

\newpage 

\section{General Documentation}

This section contains the resume, a copy of the degree in Industrial Mechanical Engineering, and a copy of the degree of the Master in Business Administration. 

\subsection{Student Transcript}

\includepdf[pages=-, pagecommand={}]{Diplomas/escolaridad-1.pdf}
\includepdf[pages=-, pagecommand={}]{Diplomas/escolaridad-2.pdf}
\includepdf[pages=-, pagecommand={}]{Diplomas/escolaridad-3.pdf}
\includepdf[pages=-, pagecommand={}]{Diplomas/escolaridad-4.pdf}
\includepdf[pages=-, pagecommand={}]{Diplomas/escolaridad-5.pdf}

\includepdf[pages=-, pagecommand={}]{Translations/student-transcript.pdf}%tag this as translation

\section{Employment Documentation}

The following pages show the work history of the applicant as it is registered by the Social Security Services (Banco de Previsión Social) of Uruguay.

\subsection{Record of Employment by the Social Security Bank of Uruguay (BPS)}

\includepdf[pages=-, pagecommand={}]{Employment/historia-laboral.pdf}

\newpage

\subsection{Translation of the Record of Employment}

\includepdf[pages=-, angle=90, pagecommand={}]{Translations/employment-record-BPS.pdf}%tag this as translation


\end{document}

答案1

根据您的评论,我猜您正在寻找“PDF 列表”,而不是第二个目录。添加“... 列表”非常简单。以下是使用包创建“... 列表”的一种方法float

\documentclass[a4paper]{article}
\usepackage{mwe}
\usepackage{pdfpages}
\usepackage{float}
\newfloat{pdfdoc}{h}{pdc}[section]

\begin{document}
\tableofcontents
\listof{pdfdoc}{My PDF documents}

\section{Section}
\subsection{Subsection}

\includepdf[
  pages = -,
  addtolist = {1, pdfdoc, Paper 1, pdf:paper1},
]{example-image-a4-numbered.pdf}

\includepdf[
  pages = -,
  addtolist = {1, pdfdoc, Paper 2, pdf:paper2},
]{example-image-a4-numbered.pdf}

\end{document}

在此处输入图片描述

答案2

我通常的做法是

\includepdf[pagecommand={\phantomsection\addcontentsline{toc}{chapter}{TOC Entry}}]{Diplomas/escolaridad-1.pdf}
\includepdf[pages=2-]{Diplomas/escolaridad-1.pdf}

我通常将其包装成宏。

pdfpages声称允许\includepdf[addtotoc={1,section,1,TOC Entry,mylabel}],但我无法让它工作。

相关内容