在 xetex 的早期版本中,我在多语言文档(英语和普什图语)中使用 lettrine 没有任何问题。然而,最近的一些更新似乎破坏了一些东西,我不确定该如何处理。
这是一个最小的工作示例,其中 \firstword 命令可以正常工作。
\documentclass{memoir}
\usepackage{polyglossia} % Babel replacement for XeTeX
\usepackage{lettrine}
\newcommand{\firstword}[2]{\lettrine[lines=2]{\textbf{#1}}{#2}}
\setdefaultlanguage{english} % Set default language for the Polyglossia package
%\setotherlanguage{arabic}
% START DOCUMENT ---------------------------------------------------------------
\begin{document}
\book*{}
\chapter{Test}
\firstword{I} was occupied, during many working hours of two years. I must have
been very ill employed, if I could not leave its merits and demerits as a whole,
to express themselves on its being read as a whole.
\end{document}
编译工作正常并且输出符合预期:
$ xelatex mwe_lettrine
This is XeTeX, Version 3.14159265-2.6-0.99999 (TeX Live 2019/dev/Debian) (preloaded format=xelatex)
restricted \write18 enabled.
entering extended mode
(./mwe_lettrine.tex
LaTeX2e <2018-04-01> patch level 5
(/usr/share/texlive/texmf-dist/tex/latex/memoir/memoir.cls
Document Class: memoir 2018/04/04 v3.7g configurable book, report, article docu
ment class
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifpdf.sty)
(/usr/share/texlive/texmf-dist/tex/latex/ifetex/ifetex.sty
(/usr/share/texlive/texmf-dist/tex/plain/ifetex/ifetex.tex))
(/usr/share/texlive/texmf-dist/tex/generic/ifxetex/ifxetex.sty)
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifluatex.sty)
(/usr/share/texlive/texmf-dist/tex/latex/memoir/mem10.clo))
(/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/generic/xkeyval/keyval.tex))))
(/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec.sty
(/usr/share/texlive/texmf-dist/tex/latex/l3packages/xparse/xparse.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/l3xdvipdfmx.def)))
(/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec-xetex.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))))
(/usr/share/texlive/texmf-dist/tex/latex/lettrine/lettrine.sty
(/usr/share/texlive/texmf-dist/tex/generic/minifp/minifp.sty)
Loading lettrine.cfg
(/usr/share/texlive/texmf-dist/tex/latex/lettrine/lettrine.cfg))
(/usr/share/texlive/texmf-dist/tex/latex/polyglossia/gloss-english.ldf)
(./mwe_lettrine.aux) [1] [2] [3] (./mwe_lettrine.aux) )
Output written on mwe_lettrine.pdf (3 pages).
Transcript written on mwe_lettrine.log.
但只需取消注释源文件中以下行:
\setotherlanguage{arabic}
重新运行 xelatex 会导致失败:
$ xelatex mwe_lettrine
This is XeTeX, Version 3.14159265-2.6-0.99999 (TeX Live 2019/dev/Debian) (preloaded format=xelatex)
restricted \write18 enabled.
entering extended mode
(./mwe_lettrine.tex
LaTeX2e <2018-04-01> patch level 5
(/usr/share/texlive/texmf-dist/tex/latex/memoir/memoir.cls
Document Class: memoir 2018/04/04 v3.7g configurable book, report, article docu
ment class
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifpdf.sty)
(/usr/share/texlive/texmf-dist/tex/latex/ifetex/ifetex.sty
(/usr/share/texlive/texmf-dist/tex/plain/ifetex/ifetex.tex))
(/usr/share/texlive/texmf-dist/tex/generic/ifxetex/ifxetex.sty)
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifluatex.sty)
(/usr/share/texlive/texmf-dist/tex/latex/memoir/mem10.clo))
(/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/generic/xkeyval/keyval.tex))))
(/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec.sty
(/usr/share/texlive/texmf-dist/tex/latex/l3packages/xparse/xparse.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/l3xdvipdfmx.def)))
(/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec-xetex.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))))
(/usr/share/texlive/texmf-dist/tex/latex/lettrine/lettrine.sty
(/usr/share/texlive/texmf-dist/tex/generic/minifp/minifp.sty)
Loading lettrine.cfg
(/usr/share/texlive/texmf-dist/tex/latex/lettrine/lettrine.cfg))
(/usr/share/texlive/texmf-dist/tex/latex/polyglossia/gloss-english.ldf)
(/usr/share/texlive/texmf-dist/tex/latex/polyglossia/gloss-arabic.ldf
(/usr/share/texlive/texmf-dist/tex/latex/polyglossia/arabicnumbers.sty)
(/usr/share/texlive/texmf-dist/tex/latex/polyglossia/hijrical.sty
(/usr/share/texlive/texmf-dist/tex/latex/tools/calc.sty)
(/usr/share/texlive/texmf-dist/tex/latex/polyglossia/cal-util.def))
(/usr/share/texlive/texmf-dist/tex/xelatex/bidi/bidi.sty
****************************************************
*
* bidi package (Bidirectional typesetting in
* plain TeX and LaTeX, using XeTeX engine)
*
* Description: A convenient interface for
* typesetting bidirectional texts in plain TeX
* and LaTeX. The package includes adaptations
* for use with many other commonly-used packages.
*
* Copyright (c) 2009--2018 Vafa Khalighi
*
* v33.1, 2018/08/12
*
* License: LaTeX Project Public License, version
* 1.3c or higher (your choice)
*
* Location on CTAN: /macros/xetex/latex/bidi
*
* Issue tracker: https://sourceforge.net/p/persian-tex-dist/tickets
*
* Support: http://persian-tex.com
*
****************************************************
(/usr/share/texlive/texmf-dist/tex/generic/iftex/iftex.sty)
(/usr/share/texlive/texmf-dist/tex/xelatex/bidi/biditools.sty
LaTeX Warning: Command \InputIfFileExists has changed.
Check if current package is valid.
) (/usr/share/texlive/texmf-dist/tex/latex/oberdiek/zref-abspage.sty
(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/zref-base.sty
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ltxcmds.sty)
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/infwarerr.sty)
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/etexcmds.sty))
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/kvdefinekeys.sty)
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty)
(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/auxhook.sty))
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/atbegshi.sty))
(/usr/share/texlive/texmf-dist/tex/xelatex/bidi/latex-xetex-bidi.def
(/usr/share/texlive/texmf-dist/tex/xelatex/bidi/footnote-xetex-bidi.def)
(/usr/share/texlive/texmf-dist/tex/xelatex/bidi/memoir-xetex-bidi.def)
(/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/xetex.def)))
(/usr/share/texlive/texmf-dist/tex/xelatex/bidi/graphicx-xetex-bidi.def)
(/usr/share/texlive/texmf-dist/tex/xelatex/bidi/tabularx-xetex-bidi.def)
(/usr/share/texlive/texmf-dist/tex/xelatex/bidi/lettrine-xetex-bidi.def)
(/usr/share/texlive/texmf-dist/tex/xelatex/bidi/array-xetex-bidi.def))
(/usr/share/texlive/texmf-dist/tex/xelatex/bidi/loadingorder-xetex-bidi.def)))
(./mwe_lettrine.aux) [1] [2]
! Undefined control sequence.
<argument> \L@factor
\L@height
l.17 \firstword{I} w
as occupied, during many working hours of two years. I m...
?
我正在运行 Ubuntu 18.10 并使用包管理器安装了 xetex:
$ sudo apt-get install texlive-xetex
我的安装似乎位于:
/usr/share/texlive/texmf-dist/
我在以下位置找到了 letterine 包:
/usr/share/texlive/texmf-dist/tex/latex/lettrine
我将非常感谢任何帮助或指点。同样,最近似乎出现了某种倒退,因为几个月前我的文档编译得很好。
答案1
按照以下步骤如何删除与 TeX Live 相关的所有内容以便在 Ubuntu 上全新安装?,我彻底删除了我的 TeX 安装并安装了最新版本的TeX 直播(2019)使用他们提供的安装程序。这解决了这个问题。