在过去两个月的某个时候,我的所有 LaTeX 文档都无法使用 TeX Live 2015 中的 XeLaTeX 进行编译。之前它可以正常工作。这是一个最低限度的工作示例:
\documentclass[11pt]{scrartcl}
\usepackage{libertine}
\usepackage[libertine]{newtxmath}
% \DeclareSymbolFont{operators}{\encodingdefault}{\familydefault}{m}{n}
\begin{document}
\end{document}
尝试像这样进行编译:xelatex -interaction nonstopmode bug
,出现以下错误:
(/opt/texlive/2015/texmf-dist/tex/generic/kastrup/binhex.tex)
\tx@Isdigit=\count137
)
! Incomplete \iftrue; all text was ignored after line 128.
<inserted text>
\fi
l.5
The file ended while I was skipping conditional text.
This kind of error happens when you say `\if...' and forget
the matching `\fi'. I've inserted a `\fi'; this might work.
)
! Incomplete \iftrue; all text was ignored after line 128.
<inserted text>
\fi
<*> bug
The file ended while I was skipping conditional text.
This kind of error happens when you say `\if...' and forget
the matching `\fi'. I've inserted a `\fi'; this might work.
! Emergency stop.
<*> bug
*** (job aborted, no legal \end found)
出了什么问题?我尝试过这个答案没有运气。
答案1
这是 中的一个错误newtxmath
。如果在分支中的第 130 行(和第 135 行)\else
包含
\ifx\iflibertine@otf\undefined
if
如果分支未执行,则会导致不完整。
可以通过此示例演示类似的问题:
\documentclass[11pt]{article}
\begin{document}
\newif\ifblab
\iftrue
abc
\else
\ifx
\ifblab\undefined
abc
\fi
\fi
\end{document}
TeX 正在尝试找到该部分的末尾\else
并将其丢弃,但缺少了\ifblab
一个\fi
。