带有纯 tex 的 eplain 包不再具有所有需要的定义

带有纯 tex 的 eplain 包不再具有所有需要的定义

如果使用 tex 而不是 pdftex,则在使用 eplain 输入某些包时会出现错误。例如,让 test.tex 成为此文件:

\input /usr/share/texlive/texmf-dist/tex/eplain/eplain
\beginpackages
   \usepackage{graphicx}  
\endpackages

\bye

跑步tex test.tex给予

This is TeX, Version 3.14159265 (TeX Live 2019/Debian) (preloaded format=tex)
(./test.tex (/usr/share/texlive/texmf-dist/tex/eplain/eplain.tex)
(/usr/share/texlive/texmf-dist/tex/plain/graphics-pln/miniltx.tex)
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty
(/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.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/dvips.def)
! Undefined control sequence.
l.118 \protected
                \def\includegraphics{%
? 
! Undefined control sequence.
l.171 \edef\Gin@gzext{\detokenize
                                 {gz}}
? 
! Undefined control sequence.
l.413 \protected
                \long\def\rotatebox#1#2{%
? 
! Undefined control sequence.
l.482 \protected
                \def\scalebox#1{%
? 
! Undefined control sequence.
l.501 \protected
                \def\reflectbox{\Gscale@box-1[1]}
? 
! Undefined control sequence.
l.502 \protected
                \def\resizebox{%
? 
)
! Undefined control sequence.
l.239 \protected
                \def\rotatebox{%
? 
) [1] )
Output written on test.dvi (1 page, 236 bytes).
Transcript written on test.log.

而运行pdftex test.tex没有错误:

This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/Debian) (preloaded format=pdftex)
 restricted \write18 enabled.
entering extended mode
(./test.tex (/usr/share/texlive/texmf-dist/tex/eplain/eplain.tex)
(/usr/share/texlive/texmf-dist/tex/plain/graphics-pln/miniltx.tex)
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty
(/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.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/pdftex.def)))
(/usr/share/texlive/texmf-dist/tex/context/base/mkii/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
) )
No pages of output.
Transcript written on test.log.

TeX Live 2015 / Debian 没有问题:

This is TeX, Version 3.14159265 (TeX Live 2015/Debian) (preloaded format=tex)
(./test.tex (/usr/share/texlive/texmf-dist/tex/eplain/eplain.tex)
(/usr/share/texlive/texmf-dist/tex/plain/graphics-pln/miniltx.tex)
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty
(/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.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/latexconfig/graphics.cfg)
(/usr/share/texlive/texmf-dist/tex/latex/graphics/dvips.def))) )
No pages of output.
Transcript written on test.log.

正确的解决方法是什么?

答案1

LaTeX 包假定存在 etex 扩展,例如,\protected有时您很幸运,实际上没有使用任何扩展,但图形(现在)使用\protected

etex 扩展在所有引擎(pdftex、luatex、xetex、etex)中可用,但格式tex使用经典的 tex 未扩展格式来使用名称tex

因此,您可以简单地使用 etex(或等效地使用 pdftex \pdfoutput=0)来使用带有 dvi 输出的纯 tex。

相关内容