为什么 load-unicode-xetex-classes.tex 仅由 xetex.ini 加载(而不是 xelatex.ini)?

为什么 load-unicode-xetex-classes.tex 仅由 xetex.ini 加载(而不是 xelatex.ini)?

文件xetex.ini在生成时使用xetex.fmt

%% xetex.ini
% General Unicode set up
\input load-unicode-data.tex %

% Classes that have always been defined by the XeTeX format
\input load-unicode-xetex-classes.tex %

此 .ini 文件同时加载load-unicode-data.texload-unicode-xetex-classes.tex。但在生成时xelatex.fmt,使用的文件xelatex.ini似乎load-unicode-data.tex只加载第一个文件(通过latex.ltx)。

我搜索了 latex2e 的存储库,找不到第二个文件的包含load-unicode-xetex-classes.tex。为什么此文件仅由 xetex.ini 输入?

答案1

TeX Live 和 MiKTeX 使用的文件.ini最初是处理 DVI 的简单方法相对PDF 输出:latex.inipdflatex.ini。然而,它们随着时间的推移而增长,特别是那些用于纯 TeX 类格式的。原因是对于纯 TeX,Knuth 仅支持文件中的原始 TeX(TeX90),而该文件(按照惯例)不能被其他人更改。因此,为了支持 XeTeX、LuaTeX 的关键功能,ETC。.ini,需要在文件中添加代码。

在一段时间内,也没有做出任何改变latex.ltx,所以各种各样的东西都聚集在xelatex.iniETC。前段时间,团队决定积极支持 XeTeX 和 LuaTeX,并将大量代码从文件移.inilatex.ltx

如果你看一下ltfinal.dtx(最后一部分的来源latex.ltx),你会发现load-unicode-xetex-classes 阅读:目前的源部分说

% \changes{v2.0a}{2015/01/03}{Unicode data loading added}
% \changes{v2.0c}{2015/01/24}{Skip T1-code entirely with Unicode engines}
% \changes{v2.0d}{2015/03/26}{Use renamed 
%   \texttt{unicode-letters.def}}
% \changes{v2.0i}{2015/12/10}{Use new common Unicode data loaders}
% \changes{v2.0j}{2016/01/04}{Do not set up inter character classes for
%   XeTeX}
%  \changes{v2.0l}{2016/01/05}{Correct \textsf{latexrelease} guards}
%  \changes{v2.0l}{2016/01/05}{Ensure old definitions for inter-character
%    class toks are available using \textsf{latexrelease}}
%  \changes{v2.0m}{2016/01/05}{Undefine XeTeX classes when using patching
%    an older kernel}
%  \changes{v2.0l}{2016/01/05}{Missing brace}
%  \changes{v2.0p}{2016/01/05}{Only apply XeTeX change if XeTeX is in use}
%  For $7$- and $8$-bit engines the assumption of T1 encodings is the
%  basis for the hyphenation patterns. That's not the case for the Unicode
%  engines, where the assumption is engine-native working. The common
%  loader system provides access to data from the Unicode Consortium
%  covering not only |\lccode| but also other related data. The
%  |\lccode| part of that at least needs to be loaded before hyphenation is
%  tackled: Xe\TeX{} follows the standard \TeX{} route of building patterns
%  into the format. Lua\TeX{} doesn't require this data be loaded \emph{here}
%  but it does need to be loaded somewhere. Rather than test for the Unicode
%  engines by name, the approach here is to look for the extended math mode
%  handling both provide: any other engine developed in this area will
%  presumably also provide |\Umathcode|.
%    \begin{macrocode}
\ifnum 0%
  \ifx\Umathcode\@undefined\else 1\fi
  \ifx\XeTeXmathcode\@undefined\else 1\fi
  >\z@
  \message{ Unicode character data,}
  \input{load-unicode-data}
%</2ekernel>
%<latexrelease>\IncludeInRelease{2016/02/01}%
%<latexrelease>  {\XeTeXintercharclasses}{XeTeX character classes}%
%<latexrelease>  \ifx\XeTeXinterchartoks\undefined
%<latexrelease>  \else
%<latexrelease>    \begingroup
%<latexrelease>      \chardef\XeTeXcharclassID = 0 %
%<latexrelease>      \chardef\XeTeXcharclassOP = 0 %
%<latexrelease>      \chardef\XeTeXcharclassCL = 0 %
%<latexrelease>      \chardef\XeTeXcharclassEX = 0 %
%<latexrelease>      \chardef\XeTeXcharclassIS = 0 %
%<latexrelease>      \chardef\XeTeXcharclassNS = 0 %
%<latexrelease>      \chardef\XeTeXcharclassCM = 0 %
%<latexrelease>      \input{load-unicode-xetex-classes}
%<latexrelease>    \endgroup
%<latexrelease>    \global\let\xtxHanGlue\undefined
%<latexrelease>    \global\let\xtxHanSpace\undefined
%<latexrelease>    \global\XeTeXinterchartoks 0 1 = {}
%<latexrelease>    \global\XeTeXinterchartoks 0 2 = {}
%<latexrelease>    \global\XeTeXinterchartoks 0 3 = {}
%<latexrelease>    \global\XeTeXinterchartoks 1 0 = {}
%<latexrelease>    \global\XeTeXinterchartoks 2 0 = {}
%<latexrelease>    \global\XeTeXinterchartoks 3 0 = {}
%<latexrelease>    \global\XeTeXinterchartoks 1 1 = {}
%<latexrelease>    \global\XeTeXinterchartoks 1 2 = {}
%<latexrelease>    \global\XeTeXinterchartoks 1 3 = {}
%<latexrelease>    \global\XeTeXinterchartoks 2 1 = {}
%<latexrelease>    \global\XeTeXinterchartoks 2 2 = {}
%<latexrelease>    \global\XeTeXinterchartoks 2 3 = {}
%<latexrelease>    \global\XeTeXinterchartoks 3 1 = {}
%<latexrelease>    \global\XeTeXinterchartoks 3 2 = {}
%<latexrelease>    \global\XeTeXinterchartoks 3 3 = {}
%<latexrelease>  \fi
%<latexrelease>\EndIncludeInRelease
%<latexrelease>\IncludeInRelease{0000/00/00}%
%<latexrelease>  {\XeTeXintercharclasses}{XeTeX character classes}%
%<latexrelease>  \ifx\XeTeXinterchartoks\undefined
%<latexrelease>  \else
%<latexrelease>   \input{load-unicode-xetex-classes}
%<latexrelease>   \gdef\xtxHanGlue{\hskip0pt plus 0.1em\relax}
%<latexrelease>   \gdef\xtxHanSpace{\hskip0.2em plus 0.2em minus 0.1em\relax}
%<latexrelease>   \global\XeTeXinterchartoks 0 1 = {\xtxHanSpace}
%<latexrelease>   \global\XeTeXinterchartoks 0 2 = {\xtxHanSpace}
%<latexrelease>   \global\XeTeXinterchartoks 0 3 = {\nobreak\xtxHanSpace}
%<latexrelease>   \global\XeTeXinterchartoks 1 0 = {\xtxHanSpace}
%<latexrelease>   \global\XeTeXinterchartoks 2 0 = {\nobreak\xtxHanSpace}
%<latexrelease>   \global\XeTeXinterchartoks 3 0 = {\xtxHanSpace}
%<latexrelease>   \global\XeTeXinterchartoks 1 1 = {\xtxHanGlue}
%<latexrelease>   \global\XeTeXinterchartoks 1 2 = {\xtxHanGlue}
%<latexrelease>   \global\XeTeXinterchartoks 1 3 = {\nobreak\xtxHanGlue}
%<latexrelease>   \global\XeTeXinterchartoks 2 1 = {\nobreak\xtxHanGlue}
%<latexrelease>   \global\XeTeXinterchartoks 2 2 = {\nobreak\xtxHanGlue}
%<latexrelease>   \global\XeTeXinterchartoks 2 3 = {\xtxHanGlue}
%<latexrelease>   \global\XeTeXinterchartoks 3 1 = {\xtxHanGlue}
%<latexrelease>   \global\XeTeXinterchartoks 3 2 = {\xtxHanGlue}
%<latexrelease>   \global\XeTeXinterchartoks 3 3 = {\nobreak\xtxHanGlue}
%<latexrelease>  \fi
%<latexrelease>\EndIncludeInRelease
%<*2ekernel>
%    \end{macrocode}
% \changes{v2.0d}{2015/02/03}{Set \cs{lccode} for \texttt{-} with Unicode
%   engines}
% There is one over-ride that makes sense here (see below for the same for
% $8$-bit engines): setting the lccode for |-| to itself.
%    \begin{macrocode}
  \lccode`\- =`\- % default hyphen char
%    \end{macrocode}

您将看到 XeTeX 类加载有两个版本:反映.ini文件中的更改,ETC。

对于普通的 TeX,仅有的将 Unicode 数据加载到格式中的方法在.ini文件中。因此加载器和其他内容(例如 Unicode 基本数据和 Unicode 数学模式信息)都在那里。

相关内容