\attachfile 在最終 PDF 中添加註釋而不是附件

\attachfile 在最終 PDF 中添加註釋而不是附件

我想將文件附加到 XeLaTeX 生成的最終 PDF 中,因此我使用了以下 MWE:

\documentclass{article}
\usepackage{attachfile2}


\begin{document}
  \attachfile{foo.txt}{bar}
\end{document}

但是,編譯後,我得到的不是附件而是註解:

Evince 螢幕截圖顯示了生成的 PDF 中「bar」附近的註釋

如您所見,我的命令產生註釋,但文件內容不存在。

那麼,如何在attachfile2包中添加附件而不是註釋呢?

答案1

使用嵌入檔案包:

\documentclass{article}
\usepackage{embedfile}
\begin{document}
\embedfile{test-ansi.tex} text
\end{document}

在此輸入影像描述

相關內容