编译 expl3-code.tex 比其他的花费更多的时间

编译 expl3-code.tex 比其他的花费更多的时间

expl3-code.tex 的作用是什么?为什么它在 LuaLaTeX 中比其他代码加载时间更长。可以避免这种情况吗?

(“C:/Program Files/MiKTeX 2.9/tex/latex/l3kernel/expl3-code.tex”)

分数维:

\documentclass[11pt]{book}
\RequirePackage{luatex85}
\usepackage[paperwidth=142mm,paperheight=210mm,top=25mm,bottom=20mm,left=17mm,right=22mm]{geometry}
%\usepackage{fontspec}
\usepackage{fancyhdr}
\usepackage{graphicx}
\usepackage{chngcntr}
\usepackage{tocloft}
\usepackage{charter}
\usepackage{polyglossia}

\begin{document}
test
\end{document}

什么叫它..

答案1

polyglossia负载fontspec,负载expl3,负载expl3-code.tex

texdoc expl3会告诉你关于 的一切expl3。它是内核的一部分LaTeX3,是一组用于编写更复杂程序包的编程约定和工具。或者类似的东西。

终端输出会lualatex告诉您包的加载顺序以及哪个包加载了什么。

我修剪了它以显示序言中发生的事情(在此之前,类文件会加载更多内容,在此之后,文档开头的钩子会加载更多内容)。我还为此输出添加了一些缩进,以便您可以更清楚地看到哪个包在何时由什么加载。

(/usr/share/texlive/texmf-dist/tex/generic/luatex85/luatex85.sty)
(/usr/share/texlive/texmf-dist/tex/latex/geometry/geometry.sty
    (/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty)
    (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifpdf.sty)
    (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifvtex.sty)
    (/usr/share/texlive/texmf-dist/tex/generic/ifxetex/ifxetex.sty)
    (/home/dcpurton/texmf/tex/latex/geometry/geometry.cfg))
(/usr/share/texlive/texmf-dist/tex/latex/fancyhdr/fancyhdr.sty)
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty
    (/usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty
        (/usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty)
        (/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/graphics.cfg)
        (/usr/share/texlive/texmf-dist/tex/latex/graphics-def/luatex.def)))
(/usr/share/texlive/texmf-dist/tex/latex/chngcntr/chngcntr.sty)
(/usr/share/texlive/texmf-dist/tex/latex/tocloft/tocloft.sty)
(/usr/share/texlive/texmf-dist/tex/latex/psnfss/charter.sty)
(/usr/share/texlive/texmf-dist/tex/latex/polyglossia/polyglossia.sty
    (/usr/share/texlive/texmf-dist/tex/latex/etoolbox/etoolbox.sty)
    (/usr/share/texlive/texmf-dist/tex/latex/makecmds/makecmds.sty)
    (/usr/share/texlive/texmf-dist/tex/latex/xkeyval/xkeyval.sty
        (/usr/share/texlive/texmf-dist/tex/generic/xkeyval/xkeyval.tex
            (/usr/share/texlive/texmf-dist/tex/generic/xkeyval/xkvutils.tex)))
    (/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec.sty
        (/usr/share/texlive/texmf-dist/tex/latex/l3kernel/expl3.sty
            (/usr/share/texlive/texmf-dist/tex/latex/l3kernel/expl3-code.tex)
            (/usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3pdfmode.def))
        (/usr/share/texlive/texmf-dist/tex/latex/l3packages/xparse/xparse.sty)
        (/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty
            (/usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty
                (/usr/share/texlive/texmf-dist/tex/latex/base/tuenc.def))
            (/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec.cfg)
            (load luc: /home/dcpurton/.texlive2017/texmf-var/luatex-cache/generic/fonts/otl/lmromandemi10-regular.luc)
            (load luc: /home/dcpurton/.texlive2017/texmf-var/luatex-cache/generic/fonts/otl/lmroman10-italic.luc)))
    (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifluatex.sty)
    (/usr/share/texlive/texmf-dist/tex/luatex/luatexbase/luatexbase.sty
        (/usr/share/texlive/texmf-dist/tex/luatex/ctablestack/ctablestack.sty)))

这是每个文件中的行数,这可能很好地表明了为什么expl3-code.tex与其他文件相比处理速度较慢(正如 Ulrike 在上面的评论中指出的那样)。

在我的计算机上(2014 年中期 Macbook Air,运行 Linux),MWE 运行仅需一秒多一点的时间。如果我删除该polyglossia软件包,时间会缩短至不到 0.4 秒。

122   /usr/share/texlive/texmf-dist/tex/generic/luatex85/luatex85.sty
1130  /usr/share/texlive/texmf-dist/tex/latex/geometry/geometry.sty
87    /usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty
49    /usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifpdf.sty
261   /usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifvtex.sty
50    /usr/share/texlive/texmf-dist/tex/generic/ifxetex/ifxetex.sty
236   /usr/share/texlive/texmf-dist/tex/latex/fancyhdr/fancyhdr.sty
276   /usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty
521   /usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty
117   /usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty
61    /usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/graphics.cfg
581   /usr/share/texlive/texmf-dist/tex/latex/graphics-def/luatex.def
110   /usr/share/texlive/texmf-dist/tex/latex/chngcntr/chngcntr.sty
1151  /usr/share/texlive/texmf-dist/tex/latex/tocloft/tocloft.sty
31    /usr/share/texlive/texmf-dist/tex/latex/psnfss/charter.sty
871   /usr/share/texlive/texmf-dist/tex/latex/polyglossia/polyglossia.sty
1755  /usr/share/texlive/texmf-dist/tex/latex/etoolbox/etoolbox.sty
95    /usr/share/texlive/texmf-dist/tex/latex/makecmds/makecmds.sty
152   /usr/share/texlive/texmf-dist/tex/latex/xkeyval/xkeyval.sty
622   /usr/share/texlive/texmf-dist/tex/generic/xkeyval/xkeyval.tex
271   /usr/share/texlive/texmf-dist/tex/generic/xkeyval/xkvutils.tex
41    /usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec.sty
326   /usr/share/texlive/texmf-dist/tex/latex/l3kernel/expl3.sty
23763 /usr/share/texlive/texmf-dist/tex/latex/l3kernel/expl3-code.tex
442   /usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3pdfmode.def
2174  /usr/share/texlive/texmf-dist/tex/latex/l3packages/xparse/xparse.sty
3758  /usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty
113   /usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty
518   /usr/share/texlive/texmf-dist/tex/latex/base/tuenc.def
22    /usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec.cfg
265   /usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifluatex.sty
301   /usr/share/texlive/texmf-dist/tex/luatex/luatexbase/luatexbase.sty
59    /usr/share/texlive/texmf-dist/tex/luatex/ctablestack/ctablestack.sty

相关内容