我使用 Vim + vimtex + latexmk + xelatex。当在章节名称中使用首字母缩略词时,Vim 会显示以下 lint:
Intersentence spacing (`\@') should perhaps be used.
梅威瑟:
\documentclass{report}
\usepackage{hyperref}
\begin{document}
\chapter{FOO: Bar}
Foo
\end{document}
如果我\@
这样使用,则没有 lint:
\documentclass{report}
\usepackage{hyperref}
\begin{document}
\chapter{FOO:\@ Bar}
Foo
\end{document}
然后hyperref
抱怨:
This is XeTeX, Version 3.14159265-2.6-0.99992 (TeX Live 2015/Arch Linux) (preloaded format=xelatex)
restricted \write18 enabled.
entering extended mode
(./foo.tex
LaTeX2e <2015/10/01> patch level 2
Babel <3.9m> and hyphenation patterns for 79 languages loaded.
(/usr/share/texmf-dist/tex/latex/base/report.cls
Document Class: report 2014/09/29 v1.4h Standard LaTeX document class
(/usr/share/texmf-dist/tex/latex/base/size10.clo))
(/usr/share/texmf-dist/tex/latex/hyperref/hyperref.sty
(/usr/share/texmf-dist/tex/generic/oberdiek/hobsub-hyperref.sty
(/usr/share/texmf-dist/tex/generic/oberdiek/hobsub-generic.sty))
(/usr/share/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/share/texmf-dist/tex/generic/ifxetex/ifxetex.sty)
(/usr/share/texmf-dist/tex/latex/oberdiek/auxhook.sty)
(/usr/share/texmf-dist/tex/latex/oberdiek/kvoptions.sty)
(/usr/share/texmf-dist/tex/latex/hyperref/pd1enc.def)
(/usr/share/texmf-dist/tex/latex/latexconfig/hyperref.cfg)
(/usr/share/texmf-dist/tex/latex/hyperref/backref.sty
(/usr/share/texmf-dist/tex/latex/oberdiek/rerunfilecheck.sty))
(/usr/share/texmf-dist/tex/latex/url/url.sty))
Package hyperref Message: Driver (autodetected): hxetex.
(/usr/share/texmf-dist/tex/latex/hyperref/hxetex.def
(/usr/share/texmf-dist/tex/latex/hyperref/puenc.def)
(/usr/share/texmf-dist/tex/generic/oberdiek/stringenc.sty)) (./foo.aux)
(/usr/share/texmf-dist/tex/latex/hyperref/nameref.sty
(/usr/share/texmf-dist/tex/generic/oberdiek/gettitlestring.sty)) (./foo.out)
(./foo.out)
Chapter 1.
Package hyperref Warning: Token not allowed in a PDF string (Unicode):
(hyperref) removing `\spacefactor' on input line 5.
Package hyperref Warning: Token not allowed in a PDF string (Unicode):
(hyperref) removing `\@m' on input line 5.
(/usr/share/texmf-dist/tex/generic/oberdiek/se-ascii-print.def) [1] (./foo.aux)
)
Output written on foo.pdf (1 page).
Transcript written on foo.log.
那么我应该使用什么?或者我应该忽略或lint
的hyperref
投诉?
答案1
警告(不是错误)来自书签代码。空间因子的设置\@
可用于 TeX,但不能用于书签字符串。可以通过以下方式禁用该命令:
\usepackage{hyperref}% option "pdfencoding=auto" or "unicode" recommended
\pdfstringdefDisableCommands{\let\@\@empty}