Plain TeX is Knuth's original default format for TeX documents.

learn more… | top users | synonyms

19
votes
2answers
1k views

The mysteries of \mathpalette

I would like to make a macro, \vfrac, which output would look like: $$\displaylines{ \displaystyle\raise.25ex\hbox{$\displaystyle1$}\!/\!\lower.5ex\hbox{$\displaystyle2$} \cr ...
38
votes
7answers
3k views

Reasons to use plain TeX

Given the active development in LaTeX and ConTeXt, and how LaTeX insulates the writer from typographical details and ConTeXt gives the user extensive control over formatting thus taking useful ...
19
votes
3answers
1k views

How to make continuous (but breakable) vertical rule along left side of paragraph?

I'm looking for a way in Plain TeX to make a continuous vertical rule along the left side of a paragraph (or arbitrary block of text), such that it observes normal page-break rules. I started with the ...
20
votes
3answers
365 views

Strange behaviour with PGF/TikZ and Plain TeX output routine

I noticed a strange behavior when running PGF/tikZ with pdfTeX on my Debian box : a simple session without tikz: pdftex **\relax *Hello World *\bye do output the page number on the page footer. On ...
35
votes
1answer
4k views

\setbox vs. \sbox and \savebox - What are the differences I need to know about?

What's the difference between using TeX's \setbox and LaTeX's \sbox and \savebox?
3
votes
2answers
2k views

Template for cheat sheet

I have been working with LaTeX for a couple of years but I don't know anything about pure TeX. I find this LaTeX cheat sheet useful to remember some commands. So I'd like to have a LaTeX template for ...
4
votes
1answer
2k views

Make an invisible vbox

I'm placing a PDF meta information in a \vbox in a plain XeTeX document, and I would like it to behave as if there were no box at all (so any additional \vskip after the \vbox will appear). Right now, ...
5
votes
2answers
798 views

Create my own mapping for XeTeX fonts

I'm trying to create mapping files, to make use of Cambria Math italic calligraphic and double stroke letters in Plain XeTeX. However, I'm unable to do so. This is what I tried to create for the ...
11
votes
2answers
693 views

Background baseline grid with output routine

I am trying to get a baseline grid in the background of every page. I am using the plain format with XeTeX. This is what I have tried: \baselineskip=13pt \topskip=0pt \parskip=0pt \newbox\gridbox ...
20
votes
4answers
1k views

Now that I can run TeX on my iPad, what shall I TeX?

I have just learnt that there is a TeX implementation now on the iPad (original source this answer to Is there a (La)TeX distribution running on iPad?). As the author of the blog post I TeX therefore ...
14
votes
4answers
1k views

Conversion pt to mm or cm

Is there any way how to convert pt to mm or cm in plain TeX?
10
votes
5answers
1k views

Can I see a plain TeX source file please?

all the LaTeX-tutorials tell me how LaTeX is an extention simplifying the building of TeX documents. Understandably, no one uses plain TeX anymore, right? But I seem to learn better when I grasp the ...
7
votes
2answers
1k views

Inserting an image in plain TeX

I used the OzTeX implementation of TeX, also I used to typeset my docs in plain TeX, not LaTeX for me, so I had no problem to insert an image using the OzTeX, now I'm back to TeX docs, am using the ...
11
votes
2answers
582 views

How to use OpenType fonts with plain-LuaTeX?

Is it possible to have OpenType fonts with LuaTeX using the plain format? I have tried: \font\test="texgyrepagellaregular"\test test\bye but I get ! Font \test=texgyrepagellaregular not loadable: ...
9
votes
2answers
589 views

overstruck \diamond and plus in plain TeX?

I need a character in plain TeX that combines a plus with a quadrilateral whose corners are the four endpoints of the plus. Is there a way to create such a thing? I apologize for editing the ...
8
votes
1answer
676 views

Can \usepackage{color} and \input tikz work together in Plain TeX/eplain?

I use Plain TeX and Eplain. In my document I'm using both the color and url packages inside the \beginpackages..\endpackages block. Just now I tried adding \input tikz.tex (as the TikZ manual states) ...
5
votes
1answer
133 views

Separating a decimal in any format into integer and fractional parts in basic LaTeX

Note: I've separated this question from what was becoming a very tangled discussion. I know egreg already has a solution, so I'll just wait until he posts it here. Question: The solution has to take ...
5
votes
1answer
278 views

Sectioning macros with Plain

Plain is awesome up until you'd want to make some structure for your document(s), because getting the sectioning macros right seems to be painfully difficult. Plain comes with a single sectioning ...
4
votes
2answers
667 views

How to get hanging hyphenation?

I am using XeTeX from TeXLive-2010-Basic in OSX with plain-format. My try was to follow the TeXbooks setup for commas et such (which I already have working nicely): \defaulthyphenchar=`‐% it is ...
4
votes
1answer
801 views

Is it a bad practice to declare variables locally inside macros or environments?

For me, declaring variables globally will clutter the project. Especially when there are many variables to be declared. In addition, declaring variables locally will save our time because we don't ...
0
votes
0answers
249 views

Why do some people still use TeX instead of LaTeX? [duplicate]

Possible Duplicate: Reasons to use plain TeX Is it still worth it to learn TeX? I'm utterly curious to know why some people still use TeX instead of full featured LaTeX?
12
votes
3answers
575 views

Is there a printable version of a reference manual for all TeX primitives?

Everywhere in the TeX community, I see suggestions like \parskip, \obeylines, \parindent, etc. I'd be surprised not to find them even in the most basic LaTeX packages. So I figured they must be deeper ...
11
votes
3answers
2k views

Is there a good plain TeX tutorial that explains about doing automation and making layout?

I am interested in learning plain TeX especially in automation: looping, conditional branching, jumping, iterating, etc. layout: creating custom smart tables and boxes that can span cross pages. ...
5
votes
2answers
393 views

Wrapping \obeylines with \halign into a macro

In the TeXbook, Knuth gives an example: Are you tired of typing \cr? You can get plain TEX to insert an automatic \cr at the end of each input line in the following way: \begingroup \let\par=\cr ...
13
votes
4answers
2k views

Hard whitespace

I am using plainTeX and would like to typeset some (python) code examples. Switching to \tt gets me partway there, but I (obviously) need the whitespace respected. Is there a trick for doing this? The ...
11
votes
1answer
238 views

No indent in the first paragraph in a section in Plain TeX

I have checked no indent in the first paragraph in a section? but I think my question warrants a new thread, because my question is about Plain TeX. I am using Plain TeX. I would like to write a ...
25
votes
4answers
2k views

Is it actually illegal to TeX `texbook.tex`? [closed]

At the top of texbook.tex, it is written: % This manual is copyright (C) 1984 by the American Mathematical Society. % All rights are reserved! % The file is distributed only for people to see its ...
17
votes
2answers
340 views

plain TeX theory, \afterassignment

Is there a real difference between \newcount\acounter \def\dosomething{\afterassignment\dosomesecret\acounter=} \def\dosomesecret{I do something with \the\acounter} and \newcount\acounter ...
16
votes
1answer
270 views

What does `\ ` exactly do?

In the The Not So Short Introduction to LATEX2e - Version 5.01, April 06, 2011 it is suggested that: A backslash in front of a space generates a space that will not be enlarged. (page 39) It ...
15
votes
1answer
209 views

Behavior of \\ in Plain TeX

According to \show, the pre-defined control sequence \\ is supposed expand to its argument without the suffix "pt": This is TeX, Version 3.1415926 (TeX Live 2012/Debian) **\show\\ > \\=macro: ...
15
votes
1answer
495 views

Transition from LaTeX to Plain TeX

For several reasons I need to typeset in Plain TeX, however I have always worked with LaTeX. So how hard will this be? I basically need something like the book or report documentclass (with toc, ...
11
votes
2answers
370 views

Is there any software that converts latex file to tex file?

I was asked to convert a file from LaTeX format to TeX format, so it could be compiled by TeX. I use LaTeX a lot, but I'm quite unfamiliar with TeX. And the file is pretty long. So I was wondering if ...
5
votes
2answers
269 views

%& magic line has no effect

I am using the %&format magic line in a plain TeX file. On older versions of TeX the result produces the expected results. On TeXLive 2009 (under Gentoo), however, this line has no effect. When I ...
2
votes
1answer
406 views

How to convert “plain TeX” to LaTeX

I want to convert to LaTeX from plain TeX. I try use Emacs, but I can't. The document is this.
13
votes
1answer
111 views

How can we detect that we are right after display math mode? (for vertical spacing)

I need a "\smartmedskip" feature/macro in plain TeX which is in usual identical to \medskip, however, if we are right after display math mode, then it should be just "disabled", i.e. it should then ...
13
votes
2answers
366 views

What is “plain TeX”?

I occasionally see a statement that plain TeX is not the same as TeX, because plain TeX is already a format. What is plain TeX, and what is the difference to TeX proper? Some answers are here (The ...
10
votes
1answer
132 views

How to get the natural width of the last box in a paragraph?

I want to get the natural width of the last line in a paragraph. For example, the last line of the following paragraph Georg Friedrich Bernhard Riemann (September 17, 1826 – July 20, 1866) was an ...
7
votes
1answer
493 views

Is there a counterpart/antidote for \obeylines?

The \obeylines command tells TeX to preserve line endings, which is useful for poetry and various other things. I can limit the effect of \obeylines by wrapping it in a scope, like so: {\obeylines ...
6
votes
1answer
2k views

“Missing \cr inserted”, but it looks to me like it's already there!

I'm trying to create a Plain TeX macro for typesetting two-column proofs with automatic step-numbering and step cross-referencing; currently, the "best" I have is: \newcount\stepno \def\twocols#1{% ...
5
votes
1answer
178 views

How to create a page with two columns that can span pages to achieve my special goal?

I am a Chinese plain TeX user and also a beginner. Now I encounter a hard question, that is I must write some numbered English paragraphs at the left column and its corresponding Chinese ...
5
votes
3answers
789 views

Non-vertically-centered TikZ matrix of nodes cell content

How can you make the matrix cell contents aligned to the top? I am using plain format with XeTeX. \input tikz \usetikzlibrary{matrix} $$\hbox{I'd like for the cells to be top-aligned}\cases{ ...
4
votes
2answers
180 views

How can I get interline spacing to ignore a vbox? [duplicate]

Possible Duplicate: Make an invisible vbox I want to insert a \vbox between paragraphs, but I do not want it to affect interline spacing. I'm using Plain TeX. Here is my MWE: \input plain ...
4
votes
1answer
136 views

What's special about \def\\ vs. \def\mksp?

In the following definitions, \\ captures a space token but \mksp does not. \documentclass{article} \begin{document} {\def\\{\global\let\sp= } \\ } {\def\mksp{\global\let\spx= } \mksp } \show\sp ...
3
votes
1answer
477 views

Convert from LaTeX to Plain TeX

Is there a way to convert a LaTeX document, which uses a lot of packages and macros, into Plain TeX, such that all macros are expanded and all dependencies on external packages are gone?
3
votes
2answers
615 views

setting \tabskip in a repeating \halign preamble

Is it somehow possible to set the \tabskip glue to zero for the first and last column in a repeated \halign? Eg. % tabskip=0pt \halign{&#\hfil\tabskip1em plus1em minus.5em\cr ...
2
votes
1answer
186 views

Can I write a macro for placing a vertical, breakable rule along arbitrary paragraphs without an output routine?

I answered a question last week about creating a continuous but breakable rule next to an arbitrary number of paragraphs in Plain TeX. My solution gathered the paragraphs to rule in a vbox; my output ...
1
vote
4answers
680 views

How to get started with plain TeX

I am using TeX Live 2010 on Windows 7. I have no experience to compile a plain TeX input file. Is my input file below correct? % gettingstarted.tex \input pstricks \topmargin=-72.27pt ...