LuaLatex 编译期间 pdfcomment 包与 polyglossia 发生冲突

LuaLatex 编译期间 pdfcomment 包与 polyglossia 发生冲突

我想准备一份双语文档,同时我希望能够通过添加 pdf 注释pdf评论

  • lualatex test.tex当库灵魂已加载。等待一个小时后,翻译仍未完成。
  • 命令编译xelatex test.tex运行良好!!

\setmainlanguage{czech}当命令和\setotherlanguage{english}被评论 时,问题就消失了。

我正在使用该miktex-2.9.7255-x64发行版的全新安装。请参阅附件文件列表。错误消息如下所示。

MNWE:

\documentclass{scrbook} 

\usepackage{fontspec}
\usepackage{polyglossia} 
  \setmainlanguage{czech}
  \setotherlanguage{english}
\usepackage{pdfcomment}   % A user-friendly interface to pdf annotations.
\usepackage{blindtext}
\listfiles

\begin{document} 
  \blinddocument
\end{document}

错误编译

文件列表

    *File List*
 scrbook.cls    2019/10/12 v3.27 KOMA-Script document class (book)
scrkbase.sty    2019/10/12 v3.27 KOMA-Script package (KOMA-Script-dependent bas 
ics and keyval usage)
 scrbase.sty    2019/10/12 v3.27 KOMA-Script package (KOMA-Script-independent b 
asics and keyval usage)
  keyval.sty    2014/10/28 v1.15 key=value parser (DPC)
scrlfile.sty    2019/10/12 v3.27 KOMA-Script package (loading files)
tocbasic.sty    2019/10/12 v3.27 KOMA-Script package (handling toc-files)       
scrsize11pt.clo    2019/10/12 v3.27 KOMA-Script font size class option (11pt)   
typearea.sty    2019/10/12 v3.27 KOMA-Script package (type area)
fontspec.sty    2019/10/19 v2.7d Font selection for XeLaTeX and LuaLaTeX        
  xparse.sty    2019-10-11 L3 Experimental document command parser
   expl3.sty    2019-11-07 L3 programming layer (loader)
expl3-code.tex    2019-11-07 L3 programming layer
l3deprecation.def    2019-04-06 v L3 Deprecated functions
l3backend-pdfmode.def    2019-04-06 L3 backend support: PDF mode
fontspec-luatex.sty    2019/10/19 v2.7d Font selection for XeLaTeX and LuaLaTeX 

 fontenc.sty
   tuenc.def    2018/08/11 v2.0j Standard LaTeX file
fontspec.cfg
polyglossia.sty    2019/11/15 v1.46 Alternative to Babel for XeLaTeX and LuaLaT 
eX
etoolbox.sty    2019/09/21 v2.5h e-TeX tools for LaTeX (JAW)
makecmds.sty    2009/09/03 v1.0a extra command making commands
 xkeyval.sty    2014/12/03 v2.7a package option processing (HA)
 xkeyval.tex    2014/12/03 v2.7a key=value parser (HA)
ifluatex.sty    2019/10/25 v1.5 ifluatex legacy package. Use iftex instead.     
   iftex.sty    2019/11/07 v1.0c TeX engine tests
 ifxetex.sty    2019/10/25 v0.7 ifxetex legacy package. Use iftex instead.      
l3keys2e.sty    2019-10-11 LaTeX2e option processing using LaTeX3 keys
filehook.sty    2019/10/03 v0.6 Hooks for input files
filehook-scrlfile.sty    2011/01/03 v0.1 filehook patch for scrlfile package    
luatexbase.sty    2015/10/04 v1.3 luatexbase interface to LuaTeX
ctablestack.sty    2015/10/01 v1.0 Catcode table stable support
gloss-latex.ldf    polyglossia: module for default language
pdfcomment.sty    2018/11/01 pdfcomment.sty v2.4a - Josef Kleber (C) 2008-2012, 
 2015-2016, 2018
luatex85.sty    2016/06/15 v1.4 pdftex aliases for luatex
datetime2.sty    2019/11/11 v1.5.5 (NLCT) date and time formats
tracklang.sty    2019/11/11 v1.3.9 (NLCT) Track Languages
tracklang.tex    2019/11/11 v1.3.9 (NLCT) Track Languages Generic Code
zref-savepos.sty    2018/11/21 v2.27 Module savepos for zref (HO)
zref-base.sty    2018/11/21 v2.27 Module base for zref (HO)
 ltxcmds.sty    2016/05/16 v1.23 LaTeX kernel commands for general use (HO)     
infwarerr.sty    2016/05/16 v1.4 Providing info/warning/error messages (HO)     
kvsetkeys.sty    2016/05/16 v1.17 Key value parser (HO)
etexcmds.sty    2016/05/16 v1.6 Avoid name clashes with e-TeX commands (HO)     
kvdefinekeys.sty    2016/05/16 v1.4 Define keys (HO)
pdftexcmds.sty    2019/07/25 v0.30 Utility functions of pdfTeX for LuaTeX (HO)  
   ifpdf.sty    2019/10/25 v3.4 ifpdf legacy package. Use iftex instead.        
 auxhook.sty    2016/05/16 v1.4 Hooks for auxiliary files (HO)
refcount.sty    2016/05/16 v3.5 Data extraction from label references (HO)      
  ifthen.sty    2014/09/29 v1.1c Standard LaTeX ifthen package (DPC)
    calc.sty    2017/05/25 v4.3 Infix arithmetic (KKT,FJ)
marginnote.sty    2018/08/09 v1.4b non floating margin notes for LaTeX
 soulpos.sty    2012/02/25 v1.1 Fancy underlining
hyperref.sty    2019/11/10 v7.00c Hypertext links for LaTeX
pdfescape.sty    2016/05/16 v1.14 Implements pdfTeX's escape features (HO)      
 hycolor.sty    2016/05/16 v1.8 Color options for hyperref/bookmark (HO)        
xcolor-patch.sty    2016/05/16 xcolor patch
 hopatch.sty    2016/05/16 v1.3 Wrapper for package hooks (HO)
letltxmacro.sty    2016/05/16 v1.5 Let assignment for LaTeX macros (HO)
kvoptions.sty    2016/05/16 v3.12 Key value format for package options (HO)     
  pd1enc.def    2019/11/10 v7.00c Hyperref: PDFDocEncoding definition (HO)      
 intcalc.sty    2016/05/16 v1.2 Expandable calculations with integers (HO)      
hyperref.cfg    2002/06/06 v1.2 hyperref configuration of TeXLive
   puenc.def    2019/11/10 v7.00c Hyperref: PDF Unicode definition (HO)
stringenc.sty    2016/05/16 v1.11 Convert strings between diff. encodings (HO)  
     url.sty    2013/09/16  ver 3.4  Verb mode for urls, etc.
  bitset.sty    2016/05/16 v1.2 Handle bit-vector datatype (HO)
bigintcalc.sty    2016/05/16 v1.4 Expandable calculations on big integers (HO)  
atbegshi.sty    2016/06/09 v1.18 At begin shipout hook (HO)
 hluatex.def    2019/11/10 v7.00c Hyperref driver for luaTeX
atveryend.sty    2016/05/16 v1.9 Hooks at the very end of document (HO)
rerunfilecheck.sty    2016/05/16 v1.8 Rerun checks for auxiliary files (HO)     
uniquecounter.sty    2016/05/16 v1.3 Provide unlimited unique counter (HO)      
blindtext.sty    2012/01/06 V2.0 blindtext-Package
  xspace.sty    2014/10/28 v1.13 Space after command names (DPC,MH)
soulutf8.sty    2016/05/16 v1.1 Permit use of UTF-8 characters in soul (HO)     
    soul.sty    2003/11/17 v2.4 letterspacing/underlining (mf)
 nameref.sty    2019/09/16 v2.46 Cross-referencing by name of section
gettitlestring.sty    2016/05/16 v1.5 Cleanup title references (HO)
bookmark.sty    2019/06/04 v1.27 PDF bookmarks (HO)
  ifvtex.sty    2019/10/25 v1.7 ifvtex legacy package. Use iftex instead.       
bkm-pdftex.def    2019/06/04 v1.27 bookmark driver for pdfTeX (HO)
grain0022.upa
 ***********

答案1

pdfcommentsoulpos由于未知原因而加载soulutf8的负载\AtBeginDocument,此时语言速记已经活跃,这令人心碎。

尽早加载灵魂(并考虑稍后加载语言以避免此类冲突)。

\documentclass{scrbook}
\usepackage{soul}
\usepackage{fontspec}
\usepackage{polyglossia}
\setmainlanguage{czech}
\setmainlanguage{english}

\usepackage{pdfcomment}   % A user-friendly interface to pdf annotations.

\usepackage{blindtext}
\listfiles
\begin{document}
  \blinddocument
\end{document}

(但是我使用 lualatex 时遇到了其他错误,因此考虑使用 babel)。

相关内容