当我使用includepdf
addtotoc
带有 选项pdflatex
,此命令生成的书签会产生乱码:
这是代码:
\documentclass[a4paper]{memoir}
\usepackage[T1,T2A]{fontenc}
\usepackage[russian,english]{babel}
\usepackage[utf8]{inputenc}
\usepackage[bookmarks,pdfencoding=auto,psdextra]{hyperref}
\usepackage{pdfpages}
\begin{document}
\tableofcontents
\newpage
\chapter{Глава 1}
\section{Секция 1}
Текст
\section{Секция 2}
Текст
\includepdf[pages=-, addtotoc={1, chapter, 1, Чертёж, app:drawing}]{drawing.pdf}
\end{document}
这drawing.pdf
实际上只是这份文件的第一页:
> pdftk test.pdf cat 1 output drawing.pdf
我该如何修复书签编码?
答案1
我不太清楚 pdfpages 在这里做什么。但你可以外部化 toc 条目:
\documentclass[a4paper]{memoir}
\usepackage[T1,T2A]{fontenc}
\usepackage[russian,english]{babel}
\usepackage[utf8]{inputenc}
\usepackage[bookmarks,pdfencoding=auto,psdextra]{hyperref}
\usepackage{pdfpages}
\begin{document}
\tableofcontents
\newpage
\chapter{Глава 1}
\section{Секция 1}
Текст
\section{Секция 2}
Текст
\clearpage
\refstepcounter{chapter}
\addcontentsline{toc}{chapter}{\protect\chapternumberline {\thechapter}Чертёж}
%
\includepdf[pages=-]{example-image}
\end{document}