I've been using LaTeX for 3 years and I'm decided to switch to (plain) TeX. For the moment I'm reading The TeXbook for the third time (I quietly start to read the double-danger signed paragraphs) and I'm looking for informations about stuff that are not covered in the book but needed to use TeX with all that has been added since the 90's: etex, eplain, preloading other formats, pdftex, texmf trees, character encodings (utf8/latin1), foreign language hyphenation (French in particular), use of colors, image inclusion, etc. I also read somewhere that TeX's modern implementation have switched from 256 to (a higher number I've forgotten) registers. What about it?
3 Answers
Here's a whirlwind of some of the things you can do with XeTeX (and to even larger extent, LuaTeX). Plain-kru putting a stop to this discrimination nonsense.
\uselanguage{french}
\frenchspacing
\input eplain % http://tug.org/eplain/
\font\bodyfont="Liberation Serif:mapping=tex-text" at 12bp
% ^ XeTeX-specific font-loading, see http://ctan.org/pkg/xetexref
\bodyfont
\font\titlefont="Liberation Serif:letterspace=12" at 20bp
\baselineskip=16bp
\fontdimen2\font=.25em % inter-word space
\fontdimen3\font=.25em % inter-word stretchability
\fontdimen4\font=.05em % inter-word shrinkability
% ^ http://tex.stackexchange.com/a/49306/1410
\parindent=1.3em % paragraph indentation
\parskip=0pt % normally there is stretchability between par's, remove it
\topskip=\baselineskip \lineskip=\baselineskip
\smallskipamount=\baselineskip \medskipamount=2\baselineskip
\bigskipamount=3\baselineskip % retain vertical rhythm
\emergencystretch=1em % in a case of emergency, let there be some extra
% stretchability on that line. http://tex.stackexchange.com/a/52855/1410
\XeTeXprotrudechars=2
\def\marginprotrusion#1{% let these characters protrude into right margin
% just some random test values to play with. http://tex.stackexchange.com/a/8130/1410
\rpcode#1 U`” 150 \rpcode#1 U`’ 150 \rpcode#1 U`! 100
\rpcode#1 U`, 200 \rpcode#1 U`- 200 \rpcode#1 U`. 200
\rpcode#1 U`: 100 \rpcode#1 U`; 100 \rpcode#1 U`? 100}
\marginprotrusion\bodyfont
\doublecolumns % this command comes from eplain
% see http://tug.org/eplain/doc/eplain/Multiple-columns.html#Multiple-columns
\special{background rgb 1.0 0.941176470588235 0.96078431372549}
\special{color push rgb 1 0 0}
\centerline{\titlefont J'accuse}
\special{color pop}
\medskip
\XeTeXpicfile "Desktop/daalia.jpg" width\hsize height 10\baselineskip
\medskip
\input zola
\bye
-
3
-
... though you're tying yourself to XeTeX tremendously by using all these primitives without any abstraction layer inbetween... Jan 21, 2013 at 19:51
-
@Stephan: Yes, true, but then again that's what I use. I usually do abstract away stuff, but I just wanted to quickly compile an example for this question (OP mentioned primitives vs abstraction in the comments). I phrased poorly the first line, though. What I meant was that you can do even more neat stuff with LuaTeX.– morbusgJan 21, 2013 at 20:00
-
1+1 for completeness to the answer will you please add
texdoc xetexref
Jan 21, 2013 at 20:45
these resources don't cover "recent" implementations of (plain) tex, but are nonetheless useful in explaining its workings.
- Victor Eijkhout's TeX by Topic is a solid reference that explains the meaning of all (original) TeX primitives in the context of related commands; available on-line in PDF form or printed/bound on demand (see the linked page for details). Edit 2014-04-01: TeX by Topic is now available in a new revised edition by the german user group DANTE.
- A Gentle Introduction to TeX by Michael Doob gives a tutorial in source and output; an interesting (to me) feature is the inclusion in the source of both Canadian and U.S. spellings, and the ability to choose between them by setting of a "true" or "false" condition (requires changing the source).
- An excellent introduction is A Beginner's Book of TeX by Silvio Levy and Raymond Seroul (translated and expanded from the French original by Levy).
- David Salomon wrote The Advanced TeXbook to cover topics such as page layout, font manipulation, contents and indexes; this book was out of print, but has been republished. Some of the material was published in TUGboat; look in the list by author for relevant articles.
- another author of an extensive work about (plain) TeX, TeX in Practice (4 volumes), is Stephan Bechtolsheim; again, the work goes in and out of print, but some of the material was presented in TUGboat.
unfortunately, the tugboat list by category doesn't usually identify plain/latex/context, but everything there that was published more than a year ago is open to all.
-
The Advanced TeXbook does not seem to be out of print: amazon.com/The-Advanced-TeXbook-David-Salomon/dp/0387945563/…– MafraJan 21, 2013 at 23:19
-
@Mafra -- thanks. it was out of print for awhile, but it seems that springer has republished it (it's listed under "new and forthcoming titles). i'll update the ams master list of tex-related books. Jan 22, 2013 at 14:07
-
1I started reading A Beginner's Book of TeX after seeing it highly recommended in the ConTeXt reference manual by Hans Hagen ("the book that turns every beginner into an expert"). It is truly excellent. I cannot recommend it enough. To clarify a minor ambiguity above in "(translated and expanded from the French original by Seroul)": the French original Le Petit livre de TeX is by Seroul, and it was translated and expanded by Levy. Dec 17, 2016 at 18:34
-
2@ShreevatsaR -- yes, you are correct; silvio levy translated the book, not raymond seroul. the french original quickly became a favorite when i received a copy, and i was very happy that it was translated for a wider audience. there is also a german translation, mentioned on the ams web page cited in a comment above. Dec 17, 2016 at 21:56
I post here answers to my questions as I find them. I'm not finished with reading all I've found, so this answer will be edited.
eTeX, pdfTeX, XeTeX and LuaTeX are newer TeX engines, as described in The differences between TeX engines and on http://www.tex.ac.uk/cgi-bin/texfaq2html?label=texthings . Unicode input is (by default) not supported by pdfTeX but it is by XeTeX and LuaTeX. Differences between LuaTeX, ConTeXt and XeTeX has nice answers for the question "should I use LuaTeX or XeTeX?".
eplain is an extension to the plain TeX format designed to support (a limited number of) LaTeX packages to manage cross-references, color, image inclusion, pdf hyperlinks.
(personnal note: get information about multilingual support.)
\def
s, etc.).