我可以看一下纯 TeX 源文件吗?

我可以看一下纯 TeX 源文件吗?

所有 LaTeX 教程都告诉我 LaTeX 是一个简化 TeX 文档构建的扩展。可以理解的是,现在没有人再使用纯 TeX 了,对吧?

但当我掌握了 TeX 和 LaTeX 之间的联系后,我似乎学得更好了。有人有纯 TeX 示例文件的链接吗?我想知道哪些命令、宏等是特定于 LaTeX 的。

答案1

以下是一个例子:

% Plain TeX for a 1 page document

%% The lines between the two rows of %'s are more or less compulsory.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\magnification=\magstep1
\baselineskip=12pt
\hsize=6.3truein
\vsize=8.7truein
\font\footsc=cmcsc10 at 8truept
\font\footbf=cmbx10 at 8truept
\font\footrm=cmr10 at 10truept
\footline={\footsc the electronic journal of combinatorics
   {\footbf 16} (2009), \#R00\hfil\footrm\folio}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% The further structure of the front page need not be exactly as below,
%% but the header must contain the names and addresses of the authors
%% as well as the submission and acceptance dates.

\font\bigrm=cmr12 at 14pt
\centerline{\bigrm An elementary proof of the reconstruction conjecture}

\bigskip\bigskip

\centerline{D. Remifa\footnote*{Thanks to
  the editors of this wonderful journal!}}
\smallskip
\centerline{Department of Inconsequential Studies}
\centerline{Solatido College, North Kentucky, USA}
\centerline{\tt [email protected]}

\bigskip

\centerline{\footrm 
Submitted: Jan 1, 2009; Accepted: Jan 2, 2009; Published: Jan 3, 2009}
\centerline{\footrm Mathematics Subject Classifications: 05C88, 05C89}

\bigskip\bigskip

\centerline{\bf Abstract}
\smallskip
{\narrower\noindent
The reconstruction conjecture states that the multiset of unlabeled
vertex-deleted subgraphs of a graph determines the graph, provided it
has at least 3 vertices.  A version of the problem was first stated
by Stanis\l aw Ulam.  In this paper, we show that the conjecture can
be proved by elementary methods.  It is only necessary to integrate
the Lenkle potential of the Broglington manifold over the quantum
supervacillatory measure in order to reduce the set of possible
counterexamples to a small number (less than a trillion).  A simple
computer program that implements Pipletti's classification theorem
for torsion-free Aramaic groups with simplectic socles can then
finish the remaining cases.\par}

\bigskip

\beginsection 1. Introduction.

This is the start of the introduction.

\bye

结果:

在此处输入图片描述

答案2

由于 TH 抓住机会发布了 xii.tex,我也抓住机会发布了我的进一步精简版本(相同输出所需的击键次数减少了近 14% :-))。这次练习确实是我第一次深入研究 TeX 的内部工作原理。

\let~\catcode~`76~`A13~`F1~`j00~`P2jdefA71F~`7113jdefPA;;FP
AYYFvePAJJ7172F72e71PAEE71"72F72i71PAGG71Fo71dPAWW71;FPADDF
PA**7172F727171PAKK7172F72r71PAqq71.F71Kse71PAIIFoPAXXFKdiP
AQQFjbigskipDOPAzzFhPAHHFDPATT7172F72a71PAZZFTDDPAUU71,72MF
jpar71ing;jifx:72jelseU72MjfiPABB71W72;73,74:Fjif.74.jelseB
74:jfiQn tJ;z7172tz; TydDIfDCEzs;tTsm;DmWa;y "KKJtDulIY TYg
tI J;mU7173,74:MPB tJlwWf;Wq;Yq K*dmu.,eJYlnW;q Ep"p.,JntW;
lKsGZlTpe,En"nW;eDTJlsE "dTndc,Egz"eW;t Emd"TsZElk"m,JYsnW;
sTnwWo;sZs*mE"w,Ex"sW; Jg*JZsTyl,E"fWf;Y gGlEDng"KsW,fIurW;
TlcEngD"lbXsW,tzWXW;K*J JfKncz JnzsW,WJcsGnW;tWace;wI tKtuJ
DldIYsW,WKsE"ftW;aHAHHFndZPKpTEt"KdJEgn"DZpJTKDtK*J.W,:jbye

答案3

有许多纯 TeX 源文件的示例。例如,我的所有书籍和文章都是用纯 TeX 编写的:

这里有一个用纯 TeX 编写的学士论文示例(包括来源):

纯 TeX 无法分离 逻辑标记排版任务我和我的学生始终尊重这条规则。例如,您可以在所提及的学士论文来源中验证这一点。

不幸的是,这不是一个好的例子,因为这里的排版宏和文本混在一起了。文档内部texbook.tex有,等等。\def's\eject

您可以创建糟糕的文档(其中排版任务与逻辑标记混合)或好的文档,而基本使用的宏是纯 TeX 或 LaTeX。从这个角度来看,这里接受的答案是坏例子在纯 TeX 中这是很好的做法,因为在文档的作者部分里面有\bigskip\bigskip, 等等。\centerline \indent

最后,我不同意 David Carlisle 的例子是纯 TeX 的典型例子。这只是 TeX 功能的一个例子。纯 TeX 与它没有任何共同之处。您可以创建以下文档:

\documentclass{article}
\begin{document}
\def\bye{\end{document}}
\let~\catcode~`76~`A13~`F1~`j00~`P2jdefA71F~`7113jdefPALLF
PA''FwPA;;FPAZZFLaLPA//71F71iPAHHFLPAzzFenPASSFthP;A$$FevP
A@@FfPARR717273F737271P;ADDFRgniPAWW71FPATTFvePA**FstRsamP
AGGFRruoPAqq71.72.F717271PAYY7172F727171PA??Fi*LmPA&&71jfi
Fjfi71PAVVFjbigskipRPWGAUU71727374 75,76Fjpar71727375Djifx
:76jelse&U76jfiPLAKK7172F71l7271PAXX71FVLnOSeL71SLRyadR@oL
RrhC?yLRurtKFeLPFovPgaTLtReRomL;PABB71 72,73:Fjif.73.jelse
B73:jfiXF71PU71 72,73:PWs;AMM71F71diPAJJFRdriPAQQFRsreLPAI
I71Fo71dPA!!FRgiePBt'el@ lTLqdrYmu.Q.,Ke;vz vzLqpip.Q.,tz;
;Lql.IrsZ.eap,qn.i. i.eLlMaesLdRcna,;!;h htLqm.MRasZ.ilk,%
s$;z zLqs'.ansZ.Ymi,/sx ;LYegseZRyal,@i;@ TLRlogdLrDsW,@;G
LcYlaDLbJsW,SWXJW ree @rzchLhzsW,;WERcesInW qt.'oL.Rtrul;e
doTsW,Wk;Rri@stW aHAHHFndZPpqar.tridgeLinZpe.LtYer.W,:jbye

并用 LaTeX 处理。你会说这是典型的 LaTeX 文档吗?

编辑我将展示与此处 (Sadeq) 接受的答案中相同的示例,但将部分分开:宏和作者的文本。作者可以是宏的程序员以外的其他人。

文本作者创建的纯 TeX 文件将是:

\input macros

\title      {An elementary proof of the reconstruction conjecture}
\author     {D. Remifa\footnote*{Thanks to the editors of this wonderful journal!}}
\department {Department of Inconsequential Studies}   
\address    {Solatido College, North Kentucky, USA}
\email      {[email protected]}
\edinfo     {Submitted: Jan 1, 2009; Accepted: Jan 2, 2009; Published: Jan 3, 2009\nl
             Mathematics Subject Classifications: 05C88, 05C89}
\printdata

\abstract
The reconstruction conjecture states that the multiset of unlabeled
vertex-deleted subgraphs of a graph determines the graph, provided it
has at least 3 vertices.  A version of the problem was first stated
by Stanis\l aw Ulam.  In this paper, we show that the conjecture can
be proved by elementary methods.  It is only necessary to integrate
the Lenkle potential of the Broglington manifold over the quantum
supervacillatory measure in order to reduce the set of possible
counterexamples to a small number (less than a trillion).  A simple 
computer program that implements Pipletti's classification theorem 
for torsion-free Aramaic groups with simplectic socles can then  
finish the remaining cases.

\section Introduction.

This is the start of the introduction.

\bye

macros.tex文件声明了(1)标记和(2)文档的设计:

\magnification=\magstep1
\font\footsc=cmcsc10 at 8truept
\font\footbf=cmbx10 at 8truept
\font\footrm=cmr10 at 10truept
\footline={\footsc the electronic journal of combinatorics
   {\footbf 16} (2009), \#R00\hfil\footrm\folio}
\font\bigrm=cmr12 at 14pt

\newtoks\title   \newtoks\author \newtoks\department
\newtoks\address \newtoks\email  \newtoks\edinfo

\def\printdata{\par
   \centerline{\bigrm\the\title}\vskip2\baselineskip
   \if^\the\author^\else \centerline{\the\author}\medskip\fi
   \if^\the\department^\else \centerline{\the\department}\fi   
   \if^\the\address^\else \centerline{\the\address}\fi
   \if^\the\email^\else \centerline{\tt\the\email}\fi
   \if^\the\edinfo^\else \bigskip
      {\footrm \leftskip=0pt plus1fill \rightskip=\leftskip \the\edinfo\par}\fi
   \vskip2\baselineskip
}
\def\nl{\hfil\break}  

\def\abstract{\par\centerline{\bf Abstract}\smallskip
   \bgroup \def\par{\endgraf\bigskip\egroup}  
   \narrower \noindent
}
\newcount\secnum
\def\section#1\par{\global\advance\secnum by1 
   \csname beginsection\endcsname \the\secnum. #1\par
}

输出与此处接受的答案完全相同。

答案4

最好的纯 TeX 源是 David Carlisle 的 xii.tex:

\let~\catcode~`76~`A13~`F1~`j00~`P2jdefA71F~`7113jdefPALLF
PA''FwPA;;FPAZZFLaLPA//71F71iPAHHFLPAzzFenPASSFthP;A$$FevP
A@@FfPARR717273F737271P;ADDFRgniPAWW71FPATTFvePA**FstRsamP
AGGFRruoPAqq71.72.F717271PAYY7172F727171PA??Fi*LmPA&&71jfi
Fjfi71PAVVFjbigskipRPWGAUU71727374 75,76Fjpar71727375Djifx
:76jelse&U76jfiPLAKK7172F71l7271PAXX71FVLnOSeL71SLRyadR@oL
RrhC?yLRurtKFeLPFovPgaTLtReRomL;PABB71 72,73:Fjif.73.jelse
B73:jfiXF71PU71 72,73:PWs;AMM71F71diPAJJFRdriPAQQFRsreLPAI
I71Fo71dPA!!FRgiePBt'el@ lTLqdrYmu.Q.,Ke;vz vzLqpip.Q.,tz;
;Lql.IrsZ.eap,qn.i. i.eLlMaesLdRcna,;!;h htLqm.MRasZ.ilk,%
s$;z zLqs'.ansZ.Ymi,/sx ;LYegseZRyal,@i;@ TLRlogdLrDsW,@;G
LcYlaDLbJsW,SWXJW ree @rzchLhzsW,;WERcesInW qt.'oL.Rtrul;e
doTsW,Wk;Rri@stW aHAHHFndZPpqar.tridgeLinZpe.LtYer.W,:jbye

相关内容