如何调用 pdftex.exe

如何调用 pdftex.exe

我正在尝试使用pdftex.exe如下所示的简单文档从命令行调用

\documentclass{article}
\begin{document}
test
\end{document}

但是我得到的不是 PDF,而是以下输出

This is pdfTeX, Version 3.1415926-2.4-1.40.13 (MiKTeX 2.9)
entering extended mode
(c:/temp/1884874639.tex
! Undefined control sequence.
l.1 \documentclass
                  {article}
?
! Emergency stop.
l.1 \documentclass
                  {article}
!  ==> Fatal error occurred, no output PDF file produced!
Transcript written on c:/temp/1884874639.log.

我是否遗漏了某些命令行开关?我的调用是pdftex.exe -output-directory="c:\temp" 123.tex

答案1

尝试

% this file name is filename.tex
hello world
\bye

pdftex filename.tex

或者尝试

% this file name is filename.tex
\documentclass{article}
\begin{document}
hello world
\end{document}

pdflatex filename.tex

相关内容