在 XeTeX 遇到一些问题后,我决定开始尝试 LuaTeX。不幸的是,我遇到了一个无法立即解决的问题。
我确实需要 CJK 支持。根据一些快速研究,在 LuaTex 中实现此目的的方法是使用luatexja
包。但是,每当我将这个包与 KOMA 脚本文档类(到目前为止我已经广泛使用)一起使用时,它都会抛出以下相当烦人的警告:
LaTeX Warning: Command \selectfont has changed.
Check if current package is valid.
它之所以令人讨厌是因为它会导致 vimlatex-suite
关闭我正在处理的文件并打开lltjfont.sty
(根据其路径,它似乎是 的一个补丁luatexja
)进行检查。
无论我是否实际使用该包执行了什么操作,只要包含该包就会抛出错误。对于 MWE:
\documentclass{scrartcl}
% luatexja-fontenc also includes fontenc for use in
% conjunction. However the warning is thrown with just
% luatexja as well, so fontenc doesn't seem to be the
% problem
\usepackage{luatexja-fontenc}
\begin{document}
Dummy text
\end{document}
你们知道如何解决冲突吗(或者至少由于文档编译正常,可以消除警告)?
顺便说一句,我在 TexLive2018 上。我的\listfiles
输出:
scrreprt.cls 2018/03/30 v3.25 KOMA-Script document class (report)
scrkbase.sty 2018/03/30 v3.25 KOMA-Script package (KOMA-Script-dependent basi
cs and keyval usage)
scrbase.sty 2018/03/30 v3.25 KOMA-Script package (KOMA-Script-independent ba
sics and keyval usage)
keyval.sty 2014/10/28 v1.15 key=value parser (DPC)
scrlfile.sty 2018/03/30 v3.25 KOMA-Script package (loading files)
tocbasic.sty 2018/03/30 v3.25 KOMA-Script package (handling toc-files)
scrsize11pt.clo 2018/03/30 v3.25 KOMA-Script font size class option (11pt)
typearea.sty 2018/03/30 v3.25 KOMA-Script package (type area)
fontspec.sty 2018/07/30 vv2.6h Font selection for XeLaTeX and LuaLaTeX
xparse.sty 2018-08-23 L3 Experimental document command parser
expl3.sty 2018-08-23 L3 programming layer (loader)
expl3-code.tex 2018-08-23 L3 programming layer
l3pdfmode.def 2018-08-23 v L3 Experimental driver: PDF mode
fontspec-luatex.sty 2018/07/30 vv2.6h Font selection for XeLaTeX and LuaLaTeX
fontenc.sty
tuenc.def 2017/04/05 v2.0i Standard LaTeX file
fontspec.cfg
luatexja-fontspec.sty 2018/07/31 fontspec support of LuaTeX-ja
l3keys2e.sty 2018-08-23 LaTeX2e option processing using LaTeX3 keys
luatexja.sty 2018/08/25 Japanese Typesetting with Lua(La)TeX
luatexja-core.sty 2017/11/12 Core of LuaTeX-ja
luatexbase.sty 2015/10/04 v1.3 luatexbase interface to LuaTeX
ctablestack.sty 2015/10/01 v1.0 Catcode table stable support
ltxcmds.sty 2016/05/16 v1.23 LaTeX kernel commands for general use (HO)
pdftexcmds.sty 2018/01/30 v0.27 Utility functions of pdfTeX for LuaTeX (HO)
infwarerr.sty 2016/05/16 v1.4 Providing info/warning/error messages (HO)
ifluatex.sty 2016/05/16 v1.4 Provides the ifluatex switch (HO)
ifpdf.sty 2017/03/15 v3.2 Provides the ifpdf switch
xkeyval.sty 2014/12/03 v2.7a package option processing (HA)
xkeyval.tex 2014/12/03 v2.7a key=value parser (HA)
atbegshi.sty 2016/06/09 v1.18 At begin shipout hook (HO)
etoolbox.sty 2018/08/19 v2.5f e-TeX tools for LaTeX (JAW)
everyhook.sty 2014/11/26 v1.2 (SVN Rev: 12)\ Hooks for low level TeX everyX p
rimitives.
svn-prov.sty 2010/04/24 v3.1862 Package Date/Version from SVN Keywords
ltj-base.sty 2017/05/05
ltj-latex.sty 2018/08/24 LaTeX support of LuaTeX-ja
lltjfont.sty 2018/01/12 Patch to NFSS2 for LuaTeX-ja
tuenc.def 2017/04/05 v2.0i Standard LaTeX file
everysel.sty 2011/10/28 v1.2 EverySelectfont Package (MS)
lltjdefs.sty 2018/06/15 Default font settings of LuaTeX-ja
lltjcore.sty 2018/06/15 Patch to LaTeX2e Kernel for LuaTeX-ja
filehook.sty 2011/10/12 v0.5d Hooks for input files
filehook-scrlfile.sty 2011/01/03 v0.1 filehook patch for scrlfile package
lltjp-geometry.sty 2018/01/19 Patch to geometry for LuaTeX-ja with vertical w
riting mode
luatexja-compat.sty 2018/03/29 Compatibility with pTeX
luatexja-fontspec-26h.sty 2018/08/02 fontspec support of LuaTeX-ja
答案1
如果您使用 vim,则可以自定义其在出现警告和错误时的反应。请参阅此处——http://vim-latex.sourceforge.net/documentation/latex-suite/compiler-output-customization.html——关于适应的方式,但是,关于编译 LaTeX 的整个部分似乎值得一读:http://vim-latex.sourceforge.net/documentation/latex-suite/latex-compiling.html
重点是:每次编译时你都会收到一堆警告,因此花时间和精力来定制 vim 确实是值得的。