该pdfx
包与书签包不兼容,即加载书签包时生成的文件没有书签。
我知道PDF /X
标准不允许任何书签,但PDF /A
确实允许。然而,该pdfx
软件包使用任何设置/选项禁用书签。
This looks like a bug with the pdfx
package, isn't it? Is anyone else able to reproduce this issue?
Here is a MWE
. Simpy switch between pdflatex
and lualatex
and back, to confirm the existence of the bug. The PDF produced by lualatex
will not have any bookmarks.
\PassOptionsToPackage{a-1a}{pdfx}
\PassOptionsToPackage{pdfa}{hyperref}
\PassOptionsToPackage{paper=a4paper, hmarginratio=1:1, vmarginratio=1:1, scale=0.75}{geometry}
\PassOptionsToPackage{all}{hypcap}
\PassOptionsToPackage{nomain, acronym, xindy}{glossaries-extra}
\PassOptionsToPackage{nameinlink}{cleveref}
\documentclass[12pt,a4paper,oneside,openright]{book}
\usepackage{lipsum}
\usepackage{geometry}
\usepackage{pdfx}
% \usepackage{hyperref} % comment out if using the 'pdfx' package
\hypersetup{%
anchorcolor = black,
bookmarks = true,
bookmarksdepth = 4,
bookmarksnumbered = true,
bookmarksopen = true,
final = true,
hyperfootnotes = false,
linktocpage = true,
pdfborderstyle = {/S/U/W 1},
pdfcenterwindow = true,
pdfdisplaydoctitle = true,
pdffitwindow = true,
pdfstartview = {Fit},
pdftoolbar = true,
plainpages = false,
unicode = true,
}%
% ---------- packages to be loaded after hyperref ----------%
\usepackage{hypcap}
\usepackage{glossaries-extra}
% \usepackage{hypdestopt} % seems to have problems with pdfx package?
\usepackage{bookmark} % does not work with pdfx package in lualatex?
\begin{document}
\chapter{First}
\section{First section}
\lipsum[1-2]
\section{Second section}
\lipsum[1-10]
\chapter{Second}
\section{New section}
\lipsum[1-5]
\section{Newer section}
\lipsum[1-8]
\end{document}
答案1
That's a bug in pdfx. It wrongly sets the boolean from ifpdf to false when used with luatex and so confuse following packages.
As a workaround add this:
\usepackage{pdfx}
\ifluatex
\pdftrue
\fi