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

learn more… | top users | synonyms

6
votes
2answers
756 views

Left-aligned display math mode

How could one achieve, as primitively as possible, left-aligned display math so that \abovedisplayshortskip would still work as intended? It is my understanding that one can achieve left-alignment ...
6
votes
1answer
413 views

PSTricks and Tikz in plain TeX

I would create both pstricks and tikz picture in my plain TeX documents. If I try, I get an error, maybe caused by the use of the xcolor package. The error is the following: \\color@black ...
6
votes
2answers
303 views

What is the simplest yet complete question to assess whether or not a person has a strong skill in plain TeX?

If I have to hire a person for doing a plain TeX related jobs, what question should I ask to the person? I want the question to be as simple as possible and it has to accommodate the maximum number of ...
5
votes
1answer
153 views

Reversing the effect of \nopagenumbers in plain TeX

I'm happy with Plain TeX's page-numbering format, except that I want to turn it off for the first few pages of my book. I can do this with the \nopagenumbers macro, but is there a macro with the ...
7
votes
3answers
200 views

How to scale/resize a box in plain TeX?

How can I resize (anamorphically) the contents of a box in plain TeX, that is, give it new width, height and depth? \setbox0=\hbox{Hello!} \copy0 % output at orig. size % % code which resizes box 0 ...
23
votes
1answer
679 views

Use of \relax after \ifnum … \fi construction

I'm reading Malcolm Clark's A Plain TeX Primer. On page 111 there's an exercise to define a macro that prints the current time. I've reproduced Clark's answer below: \newcount\minleft ...
10
votes
2answers
144 views

How to rigidly chop long lines in plain TeX

I am using plain TeX and want to typeset an appendix that contains several hundred URLs. When a URL goes past the right margin, I would like TeX to stop printing (i.e. not carry into the margin, not ...
8
votes
1answer
259 views

Math symbols in plain TeX

I would be much obliged if you cold tell me how can I make an arc over a letter (or a group of letters) in TeX. The command in LaTeX is \stackrel{\frown}{AB} but in TeX it proves to be useless. ...
5
votes
1answer
111 views

Break between words when line becomes too full

This example: \font\standard="Arial Unicode MS" at 10pt \standard \newlanguage\nohyphens \language=\nohyphens \hsize = 150mm \parindent = 0pt \vbox{ \setbox2=\hbox{\hskip12pt‣\hskip3dd} ...
22
votes
4answers
981 views

How to add, subtract, multiply, and divide in plain TeX?

I find many cases where I need to calculate many numbers, using adding, subtracting, multiplying, and dividing, but it would save much time if TeX could simply compute these for me. This is a sample ...
9
votes
2answers
125 views

How to use \pdfcolorstack?

Consider this code: \chardef\Color=\pdfcolorstackinit page direct{0 g} \pdfcolorstack \Color push {1 0 0 rg 1 0 0 RG} red \pdfcolorstack \Color pop {} black \hrule height 1pt width 50pt \bye I try ...
7
votes
1answer
264 views

What is the purpose of \crcr in an \halign preamble?

I know that the point of \crcr is to be a kind of "backup \cr" in \halign/\valign, in that it only adds a \cr if it wouldn't result in two in a row. Nonetheless it seems to find its way into the ...
18
votes
1answer
269 views

Plain TeX online documentation/references?

I am a non-beginner plain TeX user, mostly typesetting cheat sheets for computer science. I own The TeXbook and have seen some TeX manuals for the compilers, such as pdfTeX manuals and so forth. My ...
5
votes
2answers
260 views

How can I use plain TeX with TeXnicCenter or another IDE?

Currently I use TeCnicCenter and MiKTeX with LaTeX on a Windows machine. I am contemplating using plain TeX for certain purposes. I would like to know how to use TeXnicCenter with plain TeX. I like ...
7
votes
1answer
69 views

I need an hrule, but not when at the top of the page

I have a multi-page document that has many small sections split with \hrule lines. Occasionally a section will end immediately before a page break, and so the next section will begin right at the top ...
4
votes
1answer
77 views

Penalty inserted by output routine

I am using plain TeX (actually plain e-TeX) processed by a relatively recent version of MiKTeX (pdfTeX). Consider the following fragment of code that can be processed with plain TeX: \noindent A\par ...
6
votes
0answers
58 views

Why importing pgfplots changes behavior of \vfill? [duplicate]

When I import pgfplots, it affects behavior of \vfill. The following code works as expected: This should be at the top of the page. \vfill This should be at the bottom of the page. \eject \end ...
13
votes
1answer
410 views

How can I achieve having logical page numbers shown in acrobat reader?

I am using (plain) TeX (not LaTeX or any other ...TeX). I want a pdf file made from my TeX-source/output that is able to have acrobat reader shown logical page numbers. My document’s preface page ...
6
votes
1answer
654 views

Page Layout in plain tex

I'm trying to start using plain tex (in fact, the pdftex that comes with texlive2010) to write a document but I'm having some trouble with the page layout. My question is at which point is it decided ...
15
votes
1answer
221 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: ...
5
votes
1answer
122 views

Using end-of-line delimiter in plain Tex macro

How is it possible to use the end-of-line character as a macro parameter ? I would like something along the lines of : \def\mymacro#1\endlinechar{Content:#1} \mymacro First content \mymacro Second ...
13
votes
2answers
177 views

An hbox-vbox-halign permeable macro, is it possible?

I currently have a Plain TeX file which does something like this in a multitude of places: \indent\hbox{\vbox{\halign{#\hfil\quad&#\hfil\cr ... table content here ... }}} I would love to ...
5
votes
1answer
89 views

A question about <token2> in \expandafter<token1><token2>

I am getting confused about the \expandafter command in TeX. In TeXbook, Knuth said that \expandafter token. TeX first reads the token that comes immediately after \expandafter, without ...
5
votes
2answers
118 views

why I can't use footnote(insert) in nested boxes?

Sometimes, I need insert footnotes in nested boxes, but it seems that I can't use footnotes in nested boxes. % ok \hbox{a\footnote{$^1$}{a footnote}} but not this % won't get a footnote ...
1
vote
1answer
43 views

I need to install the package 'cjwplain' on Fedora 17

I need to compile old books typeset using Plain Tex. But I need to compile them using LaTeX instead of TeX because I need to process them using the package {preview}. I have found out about a package ...
17
votes
2answers
322 views

Is there a “smoking gun” to distinguish between ConTeXt and plain TeX

I'm writing a tool to streamline some typesetting jobs, and I am having trouble distinguishing between plain Tex and ConTeXt. LaTeX is straightforward to recognise by the \documentclass command (or ...
4
votes
2answers
83 views

plain tex: break \line and \vbox through pages

I'm trying to break the following command %\hsize=380 true pt \line{% 1 \hfil\vtop{\hsize 365 truept{% Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod ...
6
votes
1answer
115 views

amstex: operator definition error

I can't understand why the following code give me an error \input amstex.tex $\mathop{\rm arctg}(x)$ \bye Thus, the input does not work with my macros that include the use of \rm, \mathop, etc., ...
1
vote
0answers
32 views

headlines are not shown with tikz input (plain TeX) [duplicate]

I'm usign plain TeX with custom headlines. If I load Tikz packages with \input tikz then headlines are blank. The following are my headlines (some commands don't belong to plain TeX, but I think ...
9
votes
2answers
456 views

Embedding a flv (or mp4) video using pdfTeX (plain TeX only)

I am attempting to find out how to embed a flv video in a pdf file created using plain TeX and pdfTeX. I was successful at manually (via Adobe Acrobat's menu: Tools->Multimedia->Video Tool) embedding ...
17
votes
3answers
2k views

How to compile the source code of TeX

I am more and more interested in the system TeX (and LaTeX) and I want to study it more deeply. I am not telling that I want to learn how to use it, but I want to understand its mechanism now. The ...
4
votes
2answers
95 views

How to put some comment-like text in a formula?

I have the following formula: $$\bot \dashv\vdash \bot \land A /* not derivable */$$ But the phrase /* not derivable */ doesn't show correctly. For example there is space between / and *, but no ...
45
votes
2answers
2k views

Electronic version of Knuth's “TeXbook”?

I have a printed copy of the TeXbook (from D.E. Knuth) at home. Now that I travel a lot, I don't want to take my library with me every time. Question: Is there a legal way to obtain (=purchase) a PDF ...
14
votes
1answer
470 views

When does TeX execute the \catcode=`\… assignment?

TeX always scans the input and converts it into some tokens, then expands some tokens according to the latest definition of that command ... stomach -> lists -> page but when does TeX execute the ...
8
votes
4answers
218 views

Special macro definition (2opt, 1mand)

How can you define a macro \cmd in TeX primitives using two optional arguments (and a mandatory one) that fulfills the property that calling \cmd[opt]{mand} is equivalent to \cmd[][opt]{mand}. Yet, I ...
6
votes
2answers
344 views

How to not have widows and orphans without using raggedbottom

I know I can set \clubpenalty and \widowpenalty to 10 000 to make them “really bad”, but then TeX sees it equally bad to cut the page short when there is no vertical stretch (i.e. \parskip=0pt), and ...
4
votes
2answers
144 views

Change display style in xlop package

I recently discovered the package xlop to typeset automatically elementary school calculations. Using this for division for example like this, gives the output below. \documentclass{article} ...
5
votes
1answer
79 views

Doubts about hbox behavior

Why when I write a hbox at the beginning of a paragraph, TeX puts the next word in the next line, but when the paragraph starts with a 'normal' letter TeX puts all together in a line? i.e. : ...
2
votes
2answers
130 views

Kind of spurious space

I'm trying to write a \spaced macro: it takes a string as parameter, decompose that string and then recompose it spreading avery token from the others according to a given \spreadratio. Here are the ...
10
votes
2answers
138 views

Plain TeX macros contains \par as parameter delimiter, but doesn't work with \obeylines, why?

I just wanted to format a .csv file, so I do a test (1), shown as below: \global\let\xpar=\par \def\format#1,#2,#3\par{$#1\times #2=#3$\xpar} \begingroup \everypar={\format}\obeylines% 11,2,22 ...
2
votes
1answer
616 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.
1
vote
1answer
169 views

How to write a parameter-driven macro?

An specific question is as follows: I hope that I can define a macro that can switch to different typefaces. We assume that this macro is named \myfonts, so, if I type {\myfonts throughout his ...
10
votes
1answer
149 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 ...
4
votes
1answer
191 views

Getting the current page in plain TeX

What was the control sequence to get the current page in plain TeX? I thought it was \thepage, and this works in LaTeX, but it returns a undefined-control-sequence error in plain TeX.
10
votes
1answer
201 views

How to install or replace fonts in old TeX files?

I got interested in a research paper from 1991, which I cannot get an electronic online version of. The author was kind enough to send me his tex sources, but is himself unable to produce a pdf file ...
8
votes
1answer
219 views

Why I can't use \footnote inside \vbox or \hbox in horizontal mode?

The definition of \footnote is as follows in plain TeX % all from the Appendix B of The TeXbook \newinsert\footins \def\footnote#1{\let\@sf=\empty % parameter #2 (the text) is read later ...
10
votes
2answers
283 views

How to put signature number in footer (derived from page number)?

To make my book easier to bind I'd like to automatically put the signature number with small type in the footer of the first page of each octavo signature (except the first one which is given since it ...
8
votes
2answers
139 views

How can we decide a glue or a kern when we are writing a macro?

I don't know if I am right. Let's read the codes :) \setbox0=\vbox{a\par \vskip2pt \kern2pt b} \showbox0 the snippet of the log file: .\glue 2.0 .\kern 2.0 .\glue(\parskip) 0.0 plus 1.0 ...
6
votes
2answers
237 views

In plain tex, how to use Small Caps in equations?

In LaTeX, we can write $T_{\textsc{max}}$ In plain TeX, we can do thing like \font\scshape=cmcsc10 {\scashape max}. But this method does not work inside $$. We cannot write ...
11
votes
2answers
792 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: ...