用 TeX 编写的文档(没有 LaTeX,没有 Plain TeX)

用 TeX 编写的文档(没有 LaTeX,没有 Plain TeX)

LaTeX 和 Plain TeX 是 TeX 的格式,它们简化了文档的创建。但是我们可以只使用 TeX 创建文档吗?​​我找不到任何纯 TeX 示例。

答案1

你可以写简单的仅使用 TeX 基元的文档:

\font\rm=ptmr7t
\font\bf=ptmb7t
\font\sl=ptmro7t
\rm
\hrule
\vskip 1in
\hbox to \hsize{\hss\bf A SHORT STORY\hss}
\vskip 6pt
\hbox to \hsize{\hss\sl by A. U. Thor\hss}
\vskip .5cm
Once upon a time, in a distant
  galaxy called \accent "7F O\accent "7F o\accent 24 c,
there lived a computer
named R.\penalty10000\ J. Drofnats.

Mr.\penalty10000\ Drofnats---or ``R. J.,'' as
he preferred to be called---%
was happiest when he was at work
typesetting beautiful documents.
\vskip 1in
\hrule
\vfill\penalty-10000
\end

在此处输入图片描述

然而,显然宏是至关重要的,不仅仅是为了让我们的生活更美好。

使用一些预先设定的宏有助于沟通。


如果你想无格式,然后你需要做更多的初始化,使用以下命令运行文件pdftex -ini -output-format=pdf

\catcode`\{=1 % left brace is begin-group character
\catcode`\}=2 % right brace is end-group character
\catcode`\$=3 % dollar sign is math shift
\catcode`\&=4 % ampersand is alignment tab
\catcode`\#=6 % hash mark is macro parameter character
\catcode`\^=7 \catcode`\^^K=7 % circumflex and uparrow are for superscripts
\catcode`\_=8 \catcode`\^^A=8 % underline and downarrow are for subscripts
\catcode`\^^I=10 % ascii tab is a blank space
\chardef\active=13 \catcode`\~=\active % tilde is active
\catcode`\^^L=\active \outer\def^^L{\par} % ascii form-feed is "\outer\par"

\pdfpagewidth=8.5in
\pdfpageheight=11in
\hsize=6.5in
\vsize=8.9in
\baselineskip=12pt

\font\rm=ptmr7t
\font\bf=ptmb7t
\font\sl=ptmro7t
\rm
\hrule
\vskip 1in
\hbox to \hsize{\hss\bf A SHORT STORY\hss}
\vskip 6pt
\hbox to \hsize{\hss\sl by A. U. Thor\hss}
\vskip .5cm
Once upon a time, in a distant
  galaxy called \accent "7F O\accent "7F o\accent 24 c,
there lived a computer
named R.\penalty10000\ J. Drofnats.

Mr.\penalty10000\ Drofnats---or ``R. J.,'' as
he preferred to be called---%
was happiest when he was at work
typesetting beautiful documents.
\vskip 1in
\hrule
\vfill\penalty-10000
\end

相关内容