这是我的要求:
- 我需要使用 XeTeX。
- 我需要链接,所以我使用
hyperref
- 我需要在打印时将链接显示为黑色,因此我使用了
ocgcolorlinks
hyperref选项 - 我需要目录中的链接可断开,因此我
ocgx2
按照建议使用 hyperref 选项这里。
到目前为止,非常复杂。然后我编译了这个 MWE:
\documentclass{article}
\usepackage[colorlinks=true,linkcolor=blue,urlcolor=blue]{hyperref}
\usepackage[ocgcolorlinks]{ocgx2}
%\hypersetup{pdfhighlight=/N}
\begin{document}
\tableofcontents
\section{this is a very very very very very very very very very very very very very very very very very very long section}
\end{document}
如果我使用 XeTex 进行编译,在 Acrobat 阅读器中,单击时,链接会“反转”为正方形,其大小与页面大小大致相同(pdf)。
如果我使用 LaTeX 进行编译,在 Acrobat 阅读器中,单击链接时,链接会“反转”为正常链接大小(pdf)。
我无法附加任何有意义的屏幕截图,因为其中没有显示反向链接。
有什么方法可以解决这个问题吗?起初我甚至没有注意到这一点,因为它不会在 TeXWorks 预览中发生。我尝试使用\hypersetup{pdfhighlight=/N}
,但它要么在使用 XeTex 编译时不起作用,要么被覆盖/不被尊重ocgx2
。
输出\listfiles
:
*File List*
article.cls 2014/09/29 v1.4h Standard LaTeX document class
size10.clo 2014/09/29 v1.4h Standard LaTeX file (size option)
hyperref.sty 2017/03/14 v6.85a Hypertext links for LaTeX
hobsub-hyperref.sty 2016/05/16 v1.14 Bundle oberdiek, subset hyperref (HO)
hobsub-generic.sty 2016/05/16 v1.14 Bundle oberdiek, subset generic (HO)
hobsub.sty 2016/05/16 v1.14 Construct package bundles (HO)
infwarerr.sty 2016/05/16 v1.4 Providing info/warning/error messages (HO)
ltxcmds.sty 2016/05/16 v1.23 LaTeX kernel commands for general use (HO)
ifluatex.sty 2016/05/16 v1.4 Provides the ifluatex switch (HO)
ifvtex.sty 2016/05/16 v1.6 Detect VTeX and its facilities (HO)
intcalc.sty 2016/05/16 v1.2 Expandable calculations with integers (HO)
ifpdf.sty 2017/03/15 v3.2 Provides the ifpdf switch
etexcmds.sty 2016/05/16 v1.6 Avoid name clashes with e-TeX commands (HO)
kvsetkeys.sty 2016/05/16 v1.17 Key value parser (HO)
kvdefinekeys.sty 2016/05/16 v1.4 Define keys (HO)
pdftexcmds.sty 2017/03/19 v0.25 Utility functions of pdfTeX for LuaTeX (HO)
pdfescape.sty 2016/05/16 v1.14 Implements pdfTeX's escape features (HO)
bigintcalc.sty 2016/05/16 v1.4 Expandable calculations on big integers (HO)
bitset.sty 2016/05/16 v1.2 Handle bit-vector datatype (HO)
uniquecounter.sty 2016/05/16 v1.3 Provide unlimited unique counter (HO)
letltxmacro.sty 2016/05/16 v1.5 Let assignment for LaTeX macros (HO)
hopatch.sty 2016/05/16 v1.3 Wrapper for package hooks (HO)
xcolor-patch.sty 2016/05/16 xcolor patch
atveryend.sty 2016/05/16 v1.9 Hooks at the very end of document (HO)
atbegshi.sty 2016/06/09 v1.18 At begin shipout hook (HO)
refcount.sty 2016/05/16 v3.5 Data extraction from label references (HO)
hycolor.sty 2016/05/16 v1.8 Color options for hyperref/bookmark (HO)
keyval.sty 2014/10/28 v1.15 key=value parser (DPC)
ifxetex.sty 2010/09/12 v0.6 Provides ifxetex conditional
auxhook.sty 2016/05/16 v1.4 Hooks for auxiliary files (HO)
kvoptions.sty 2016/05/16 v3.12 Key value format for package options (HO)
pd1enc.def 2017/03/14 v6.85a Hyperref: PDFDocEncoding definition (HO)
hyperref.cfg 2002/06/06 v1.2 hyperref configuration of TeXLive
url.sty 2013/09/16 ver 3.4 Verb mode for urls, etc.
hxetex.def 2017/03/14 v6.85a Hyperref driver for XeTeX
puenc.def 2017/03/14 v6.85a Hyperref: PDF Unicode definition (HO)
stringenc.sty 2016/05/16 v1.11 Convert strings between diff. encodings (HO)
rerunfilecheck.sty 2016/05/16 v1.8 Rerun checks for auxiliary files (HO)
ocgx2.sty 2017/06/08 v0.29 ports `ocgx' functionality to dvips+ps2pdf, xe
latex and dvipdfmx
xparse.sty 2017/07/19 L3 Experimental document command parser
expl3.sty 2017/07/19 L3 programming layer (loader)
expl3-code.tex 2017/07/19 L3 programming layer
l3xdvipdfmx.def
l3keys2e.sty 2017/07/19 LaTeX2e option processing using LaTeX3 keys
ocgbase.sty 2017/03/30 v0.10 support package for ocgx2.sty
pdfbase.sty 2017/08/25 v0.17 driver independent access to low-level PDF fea
tures
color.sty 2016/07/10 v1.1e Standard LaTeX Color (DPC)
color.cfg 2016/01/02 v1.6 sample color configuration
xetex.def 2016/07/11 v4.10 LaTeX color/graphics driver for XeTeX (L3/RRM/
JK)
nameref.sty 2016/05/21 v2.44 Cross-referencing by name of section
gettitlestring.sty 2016/05/16 v1.5 Cleanup title references (HO)
toctest.out
toctest.out
se-ascii-print.def 2016/05/16 v1.11 stringenc: Printable ASCII characters
***********
答案1
包含由 diabonas 修复的 0.30 版软件包现已发布在github,根据 agrahn 的评论已在前往 CTAN 的路上,因此它也将可用那里很快。