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

learn more… | top users | synonyms

6
votes
2answers
257 views

\hrule with indents in Plain TeX

I am trying to learn the 'metal' of TeX after 20 years of using higher level packages, such as LaTeX. In my test document I have an indented block representing simple recipes. I've created this with ...
5
votes
1answer
125 views

Plain TeX: missing symbol

I've tried to compile (both pdfTeX and XeTeX) simple code: ☺ \bye But in result I have a plain page, without anything. What's wrong?
10
votes
1answer
127 views

TeX doesn't recognize built-in control sequences?

I'm trying to learn to build things from the ground-up with TeX (not LaTeX---I've used LaTeX before, so I know how easy a solution "\usepackage{amsthm}+\begin{theorem}" is) and I'm trying to build my ...
6
votes
4answers
158 views

How to write a TeX macro that accepts a number or a \count register as argument?

What's the most simple way, in plain TeX, to define a \macro that can be used as: \macro{10} \macro{\mycount} such that I can then assign the number to a \count and manipulate it? Note: ...
5
votes
1answer
189 views

Using \show in nonstopmode causes TeXmaker to raise false alarms. Any fix?

I'm currently reading the TeXbook, and I use \show a lot to see how Knuth defined plain-TeX macros in terms of TeX primitives. For instance, to have access to the definition of \centerline, I would ...
5
votes
1answer
178 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 ...
9
votes
2answers
217 views

Still having difficulty with use of `\expandafter`

Firstly, my apologies for any previous confusion, I've separated out various questions onto distinct pages. This problem came up in the context of trying to split a decimal number. Good solutions to ...
6
votes
2answers
864 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
437 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
309 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
170 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
210 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
731 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
148 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
277 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
114 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} ...
23
votes
4answers
1k 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
131 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
297 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
271 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
273 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
73 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
79 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
424 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 ...
7
votes
1answer
727 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
222 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: ...
6
votes
1answer
130 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
187 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
92 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
123 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
45 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
325 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
87 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
119 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
484 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 ...
18
votes
4answers
3k 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 ...
15
votes
1answer
554 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
225 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
379 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
154 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
80 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. : ...
3
votes
2answers
163 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
141 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
672 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
175 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 ...
12
votes
1answer
166 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 ...