20

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?

Michael Kropat
  • 677
  • 7
  • 13
lvaneesbeeck
  • 3,095
  • 1
    Welcome to TeX.sx! You don't have to sign with your name since it automatically appears in the lower right corner of your post. – Seamus Jan 21 '13 at 15:57
  • 10
    Why do you want to use an old system like plain (which doesn't know anything of the newer development like unicode) instead of a modern system like latex or context? – Ulrike Fischer Jan 21 '13 at 15:58
  • @UlrikeFischer: what parts of Plain need to know about Unicode? – خالد حسني Jan 21 '13 at 16:00
  • @KhaledHosny: The question mentions utf8, so probably some equivalent to inputenc is wanted. – Ulrike Fischer Jan 21 '13 at 16:05
  • 8
    @Ulrike: I use plain format with XeTeX and I have everything I want with UTF-8 support (\defs, etc.). – morbusg Jan 21 '13 at 16:22
  • 15
    @Ulrike: It says "TeX" right there at the top of this page, not LaTeX, so I don't see why some people have made it their business to decide what format other people should use. This isn't the first time I see that kind of question (I'm referring to your question) on this site. I'm not asking why would you drive a Peugeot, am I now? – morbusg Jan 21 '13 at 16:25
  • 3
    Welcome to TeX.sx! There are quite a lot of separate questions here, and the way TeX.sx works they would be best separated out (some have been covered in the past). For example, texmf trees are unrelated to plain, as they are part of (almost) any TeX set up (which may include LaTeX, ConTeXt and other formats in addition to plain). A second example is graphics inclusion in plain, which has been covered to some extent before. – Joseph Wright Jan 21 '13 at 16:54
  • 18
    @morbusg: I'm giving such advices all the time. I care about people and try to show them the best way. So I'm telling people to drop bibtex and switch to the modern biber/biblatex, I'm telling people to drop old classes and switch to a modern class, I'm telling people to drop old TeXLive versions and to update. I don't intent to let someone run without comment in the plainTeX adventure if I have the impression that he/she doesn't really know what plainTeX is. – Ulrike Fischer Jan 21 '13 at 16:58
  • @user24686. (1) I started from zero with The LaTeX Companion. Despite being much more up-to-date than its TeX counterpart, The TeXbook, it naturally contains some outdated information. With hindsight, however, I feel it was a great way to start. Maybe the same applies to beginners in TeX? (2) You haven't specified a TeX distribution, but you'll find format (e.g., plainTeX, LaTeX, ConTeXt) independent instructions for the creation of local texmf trees in MiKTeX here. – nnunes Jan 21 '13 at 17:53
  • 3
    @Ulrike: “… try to show them the best way.” That's all well and good, but you do realize that “best” is highly subjective? – morbusg Jan 21 '13 at 18:12
  • @NunoNunes:Thank you for your answer, I'll have a look at The LaTeX Companion next time I go to the library. You're right, I haven't specified a distribution because I want the most general answers possible (a texmf tree is independant of a distribution, the only thing it has to know is where it is located). I'm on Linux Mint with TeXlive and I've other questions about it but I leave them for another post ;-) – lvaneesbeeck Jan 21 '13 at 19:02
  • 10
    @Ulrike: I want to leave LaTeX (I play with it for 3 years) because I believe that things are much easier to do in TeX than in LaTeX, for example creating a page layout from zero. From my little experience, I see the link between LaTeX commands and TeX primitives a bit cloudy (in other words: there's a cloud of abstraction between low- and high-level) and that makes it difficult to modify existing things. – lvaneesbeeck Jan 21 '13 at 19:10
  • 3
    it would be interesting to learn why you've decided to switch to plain tex. as a user of both (since before latex existed) i am well aware that plain tex has advantages in some respects (not always recognized by users who are familiar only with latex or even context), but understand that every user has particular needs that may be served best by something other than what i prefer. what are your special requirements? – barbara beeton Jan 21 '13 at 19:13
  • 6
    @Barbara: my special requirements are that I do not want to browse the Internet for a preexisting package everytime I want something unusual from LaTeX (for example: increase the interline distance in a matrix when a parenthesis of the first line touches the one of the next line), I want to get awareness of what really happens beside the .tex code I write and I want to make my own page layouts with an impression of freedom. I don't understand why I should learn complicated commands to do that when 300 primitives are enough. – lvaneesbeeck Jan 21 '13 at 19:31
  • 1
    @JosephWright and Seamus: thank you for your welcome. I know my question is a bit complex but I don't know from where to start a first (real) document in TeX and I want a deep understanding of what I use, not a gimmick that solves a particular problem. Next time I'll ask simpler questions! ;-) – lvaneesbeeck Jan 21 '13 at 19:39
  • 1
    You should have a look also at TeX by Topic, freely available. –  Jan 21 '13 at 20:03
  • 1
    @morbusg: Yes I know "the best" is a subjective concept. All my answers (which try to give "the best" solution) are subjective. And it often happens that a user prefers some other answer. But this doesn't mean that I should stop to try to give my best- – Ulrike Fischer Jan 22 '13 at 16:10
  • 2
    @Ulrike: Yes, of course not, but I dislike any words of discouragement when someone wants to try out Plain (and/or someone dissing Plain), when that “adventure” – as you so aptly put it – has been so fruitful and fun experience so far for yours truly (still learning, mind you). I understand that in the middle of writing a thesis, if one gets the idea “Hey I'll just try and switch to Plain”, it is valid guidance to say “No you don't”. But as hobbies go, Plain is just as fun to learn as any other language. If not even more so because of the visual dimension to it. – morbusg Jan 23 '13 at 08:43
  • 4
    Ivaneesbeeck: Time spent learning Plain will repay itself. But if your complaint with Latex is the "there's a package for every ill" culture, you might take a closer look at Context, which tries to give a highly consistent base system that does everything needed for document publishing. It is also somewhat friendlier to Plain Texisms than Latex. – Charles Stewart Jan 23 '13 at 13:39

3 Answers3

32

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

enter image description here

morbusg
  • 25,490
  • 4
  • 81
  • 162
  • 3
    +1 (extra if I could for the choice of text!) – Alan Munn Jan 21 '13 at 19:37
  • ... though you're tying yourself to XeTeX tremendously by using all these primitives without any abstraction layer inbetween... – Stephan Lehmke Jan 21 '13 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. – morbusg Jan 21 '13 at 20:00
  • 1
    +1 for completeness to the answer will you please add texdoc xetexref – yannisl Jan 21 '13 at 20:45
17

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: http://www.amazon.com/The-Advanced-TeXbook-David-Salomon/dp/0387945563/ref=sr_1_1?ie=UTF8&qid=1358810302&sr=8-1&keywords=the+advanced+texbook – Mafra Jan 21 '13 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. – barbara beeton Jan 22 '13 at 14:07
  • 1
    I 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. – ShreevatsaR Dec 17 '16 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. – barbara beeton Dec 17 '16 at 21:56
2

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.

(personnal note: get information about multilingual support.)

David Carlisle
  • 757,742
lvaneesbeeck
  • 3,095