当我安装Basic TeX时,我发现pdflatex
只是指向同一目录下pdftex
的符号链接。但是,当我尝试通过pdftex
而不是pdflatex
直接编译我的tex文件时,编译过程变为交互式,我需要不断地按return
按钮直到编译完成。但是,如果我使用pdflatex
,输出似乎不同。 pdftex
在符号链接时发生了什么?符号链接可以改变执行行为的二进制文件吗?
pdftex
的输出如下所示:
This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015) (preloaded format=pdftex)
restricted \write18 enabled.
entering extended mode
(./test.tex
! Undefined control sequence.
l.1 \documentclass
[letter]{article}
?
! Undefined control sequence.
l.2 \usepackage
[margin=0.5in]{geometry}
?
! Undefined control sequence.
l.4 \begin
{document}
?
! Undefined control sequence.
l.6 \section
*{Problem 1}
?
! Undefined control sequence.
l.8 \subsection
*{Algorithm}
?
[1{/usr/local/texlive/2015basic/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
)</usr/local/texlive/2015basic/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.
pfb>
Output written on test.pdf (1 page, 15945 bytes).
Transcript written on test.log.
并且pdflatex
打印出来:
his is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015) (preloaded format=pdflatex)
restricted \write18 enabled.
entering extended mode
(./test.tex
LaTeX2e <2015/01/01>
Babel <3.9l> and hyphenation patterns for 21 languages loaded.
(/usr/local/texlive/2015basic/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(/usr/local/texlive/2015basic/texmf-dist/tex/latex/base/size10.clo))
(/usr/local/texlive/2015basic/texmf-dist/tex/latex/geometry/geometry.sty
(/usr/local/texlive/2015basic/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/oberdiek/ifpdf.sty)
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/oberdiek/ifvtex.sty)
(/usr/local/texlive/2015basic/texmf-dist/tex/generic/ifxetex/ifxetex.sty))
LaTeX Warning: Unused global option(s):
[letter].
(./test.aux)
*geometry* driver: auto-detecting
*geometry* detected driver: pdftex
[1{/usr/local/texlive/2015basic/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
(./test.aux) )</usr/local/texlive/2015basic/texmf-dist/fonts/type1/public/amsfo
nts/cm/cmbx12.pfb></usr/local/texlive/2015basic/texmf-dist/fonts/type1/public/a
msfonts/cm/cmr10.pfb>
Output written on test.pdf (1 page, 21292 bytes).
Transcript written on test.log.
答案 0 :(得分:1)
他们知道他们的名字。您可以通过检查argv[0]
。
答案 1 :(得分:0)
要跟进@Pacholik,程序会知道运行程序时使用的名称。程序会通过运行pdftex
或运行pdflatex
来激活它来知道您是否已将其激活。