使用latexmk编译XeLaTeX tex文件
如何在 Mac OS X 上使用 latexmk
编译 XeLaTeX
tex 文档?
目前我正在运行 latexmk job.tex
并收到错误:
!
********************************************
* XeTeX is required to compile this document.
* Sorry!
********************************************.
\RequireXeTeX ...********************************}
\endgroup \fi
l.18 \RequireXeTeX
? ^D
! Emergency stop.
\RequireXeTeX ...********************************}
\endgroup \fi
l.18 \RequireXeTeX
我的 tex 文件的第一行是(如 这篇文章):
% !TEX TS-program = xelatexmk
我尝试过其他的(例如program=xelatex),但无济于事。
Latexmk 对其命令的描述如下:
$ latexmk -commands xelatex job
Commands used by latexmk:
To run latex, I use "latex %O %S"
To run pdflatex, I use "pdflatex %O %S"
...
似乎没有任何从命令行选择 tex 程序的逻辑机制,并且从源代码中也不清楚如何做到这一点。
我还查看了橡胶
,但它似乎也不起作用。
我很感激您能够提供的任何见解。
布莱恩
How can one compile a XeLaTeX
tex document using latexmk
on Mac OS X?
At present I am running latexmk job.tex
and getting an error:
!
********************************************
* XeTeX is required to compile this document.
* Sorry!
********************************************.
\RequireXeTeX ...********************************}
\endgroup \fi
l.18 \RequireXeTeX
? ^D
! Emergency stop.
\RequireXeTeX ...********************************}
\endgroup \fi
l.18 \RequireXeTeX
The first line of my tex file is (as suggested by this post):
% !TEX TS-program = xelatexmk
and I've tried others (e.g. program=xelatex), but to no avail.
latexmk
describes its commands as follows:
$ latexmk -commands xelatex job
Commands used by latexmk:
To run latex, I use "latex %O %S"
To run pdflatex, I use "pdflatex %O %S"
...
There doesn't appear bo be any logical mechanism for selecting a tex program from the command line, and it's not clear from the source how one would do this, either.
I've also looked atrubber
, but it doesn't seem to work either.
I appreciate any insight you may be able to provide.
Brian
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我放入
我的 .latexmkrc 文件。当然,这是一种解决方法。但当我打电话时它对我有用
I put
in my .latexmkrc file. This is a workaround, of course. But it works for me when I call
这是我的快速修复,以便
latexmk
与 XeLaTeX 一起使用:添加到
该行上方(或附近)
。
然后你可以调用
latexmk -xelatex file.tex
。有效,但我没有对其进行广泛的测试。应该与lualatex
类似地工作。That's my quick fix, so that
latexmk
works with XeLaTeX:Add
above (or near) the line
.
Then you can call
latexmk -xelatex file.tex
. Works, but I didn't test it extensively. Should work similarly withlualatex
.我使用命令运行:
这与 andre-r 和 Kay 的答案基本相同,但仅来自命令行。
I run with the command:
which is basically the same as the answers from andre-r and Kay, but only from the command-line.
在版本:4.65(2019 年 6 月 18 日)中,使用
-xelatex
选项和按照评论之一的建议设置-pdflatex
之间存在差异。选项 1:-xelatex
使用
-xelatex
选项或-pdfxe
选项,tex 文件首先被排版为xdv
(扩展 DVI)文件。然后,调用xdvipdfmx
将xdv
文件转换为pdf
文件。在
latexmk
中,$xelatex_default_switches
设置为-no-pdf
(第 395 行)以使xelatex
生成 < code>xdv 文件而不是默认的 PDF 文件。因此,
-xelatex
选项相当于:选项 2:-pdflatex=xelatex
第二个选项是按如下方式设置
pdflatex
,同时打开-pdf< /code> 选项:
在此方法中,使用
xelatex
直接生成 PDF 文件,而不生成中间输出文件。请注意,今天,xelatex
首先生成一个xdv
流,并在内部将其传送到xdvipdfmx
以生成 PDF 文件。因此,这种方法相当于:
根据
user36296
的评论更新了 2019.08.31。In version: 4.65 (18 June 2019), there is a difference between using the
-xelatex
option and setting-pdflatex
as suggested by one of the comments.Option 1: -xelatex
With the
-xelatex
option, or the-pdfxe
option, the tex file is first typeset to anxdv
(extended DVI) file. Then,xdvipdfmx
is called to convert thexdv
file to apdf
file.In
latexmk
,$xelatex_default_switches
is set to-no-pdf
(line 395) to havexelatex
produce anxdv
file instead of the default PDF file.Hence the
-xelatex
option is equivalent to:Option 2: -pdflatex=xelatex
A second option is to set
pdflatex
as follows along with turning on the-pdf
option:In this approach,
xelatex
is used to generate the PDF file directly, without generating an intermediate output file. Note that, today,xelatex
first generates anxdv
stream and internally pipes it toxdvipdfmx
to produce a PDF file.Hence this approach is equivalent to:
Updated 2019.08.31 from
user36296
's comment.latexmk --xelatex job.tex
现在,这个论证以这种简单的形式是可以通过的。
latexmk --xelatex job.tex
Now the argument is passable in this simple form.