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

learn more… | top users | synonyms

18
votes
3answers
332 views

Is there an “Appending \let”?

After \def\MyText{\textbf{My Text}} \let\MySaved\MyText \MySaved and \MyText have the same \meaning. What I would like to have further down in the document is % \MyText = \textbf{My Text} ...
4
votes
1answer
68 views

Difference between measures of \vskip in plain TeX and LaTeX

I have recently heard the argument that "plain TeX is superior to LaTeX because TeX gets the measures right". The example given was that a \vskip 2 cm, when run in tex, would measure exactly 2 cm from ...
8
votes
1answer
153 views

Problems understanding definition of \newif

Reading http://profs.sci.univr.it/~gregorio/introtex.pdf, I have come across the definition of \newif on page 75: \def\newif#1{\@ifdefinable{#1}{\@newif#1}} \def\@newif#1{\count@\escapechar ...
4
votes
1answer
66 views

How to type argmin over a variable in plain TeX

I am forced to use plain TeX instead of LaTeX and I don't know what is the proper way to type argmin with some variable under it. I know $$ \min_b. $$ And I would like to do someething similar, ...
1
vote
0answers
56 views

How can I make TeX find tikz's files without moving all of them?

I'm trying to recreate my file system on a cloud server so I can SSH into it from my new tablet. So I have def.tex, my main list of custom macros, which accesses tikz.tex: \input ...
1
vote
2answers
79 views

amsmath, vec and if not working together

I am trying to define some macros in which I need an "if" which test contains an argument of the macro. The issue arises when this argument is \vec{<arg>} and the amsmath package is loaded. Here ...
4
votes
1answer
51 views

Using \multispan in plain tex to give a caption to an array

I am trying to modify some code that WeBWorK uses to generate pdf hard copies of students' online math assignments. My aim is to improve WeBWorK's accessibility. My task at the moment is to endow ...
11
votes
2answers
275 views

How to make the character è “work” in PlainTeX?

I'm using TeX with the plain format. On my keyboard there is the 'è' character (as well as é, ò, à, ù, ì). I'd like to make it work so that, when put è in the input file, TeX transforms it into \`e, ...
5
votes
3answers
194 views

Greek capital letters with Latin Modern and TeX

Copying the plain TeX format, my formatting file contains the lines \font\tenrm="[lmroman10-regular.otf]:mapping=tex-text" \textfont0=\tenrm \def\rm{\fam0 \tenrm} to load a unicode font. However, ...
13
votes
1answer
129 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 ...
1
vote
0answers
85 views

Reference of Latex/Plain Tex control sequences [closed]

I'm looking for a reference of the control sequences defined in Latex and plain Tex similar to this one for the build-in primitives. The Texbook states that there are about 600 macros in plain Tex. ...
8
votes
2answers
243 views

How can I use times fonts in Plain TeX?

I'd like to use Times fonts in Plain TeX. What would be the Plain-TeX equivalent of the LaTeX command \renewcommand{\rmdefault}{ptm}?
1
vote
0answers
73 views

Is there a version of pdfTex that does not ignore non-pdf special commands?

To make hyperlinks to theorems in plaintex one can use commands that are available in a file called Hyperbasics. When running pdftex instead of tex on the file, Miktex ignores some of the special ...
8
votes
2answers
211 views

Matrix column spacing

I am using a matrix in Plain TeX, and the spacing between columns is too large. Since I'm also changing the paper size, the matrix runs off the side of the page. A minimal example is \input eplain ...
2
votes
2answers
118 views

Cite a range of references

I have a very long list of citations in my TeX file. Rather than each bibliographic key appearing in the list, I would like a range of values, e.g. given \cite{ref1,ref2,ref3,ref4} I get [1,2,3,4] ...
7
votes
1answer
100 views

Formatting Eplain Table of Contents Entry

I need to define a macro for formatting an entry in a list of tables: \def\toctableentry#1#2#3{...} where the first argument is the table caption, the second is the table number, and the third is ...
6
votes
3answers
293 views

Creating my own \tableofcontents in plain TeX

I'd like to define my own table of contents in TeX (not LaTeX, so without packages) to have a fine control on what goes there, how the numbers are displayed, etc. Basically what I would like is to ...
1
vote
1answer
105 views

Harvmac, Amstex

I am writing a file with Plain TeX using the harvmac macro. I have always used LaTeX until now. Two related questions about harvmac Vs. mathematical fonts: I tried adding \input amstex to get the ...
13
votes
1answer
129 views

Number Sets in Plain TeX

Okay, I know how to enter the standard number sets such as Z, Q, R, etc. into LaTeX, but how can I do this in plain TeX? I ask because I can't seem to find it anywhere, and really need them in the ...
18
votes
1answer
359 views

How to check if a variable contains a word in plain TeX?

I have a variable that contains a long list of keywords, e.g.: \keywords{computers, business, biology, fine art, literature, zoology} I need to make an if-then statement that checks for the ...
5
votes
1answer
241 views

Changing page margins in {pdf-,Xe-}TeX

In TeX, changing the \hsize and the \vsize changes the main text size and the page size of the dvi output. When I compile a document with pdftex or xetex, the page size remains at A4. How can I change ...
2
votes
1answer
75 views

Left aligning a displayed equation in plain TeX

This one seems to be a rather simple question but right now I just run out of ideas. I simply want to left align a displayed equation using plain TeX, that is, I want the equation to start from the ...
6
votes
1answer
76 views

Getting the page breaks right for a \beginsection macro

I've found this code in the question No indent in the first paragraph in a section in Plain TeX \def\mysection#1{% \goodbreak \vskip2\baselineskip \noindent #1\par \nobreak ...
9
votes
1answer
140 views

Multilevel bullets

I want to write something that I could use for multilevel bullets, for example: I. Title Subtitle a. sub-subtitle ... In LaTex I got \def\startitems { \begingroup \parindent\z@ ...
7
votes
2answers
124 views

Append a token list to \everymath

I've mimicked Donald Knuth by setting | as a verbatim delimiter. To give it its normal meaning in math mode, I've set \everymath{\catcode`\|=12} \everydisplay{\catcode`\|=12} However I'd like to ...
7
votes
1answer
148 views

TeX question: how to switch between languages?

I am using TeX, with the macro package AmS-TeX. I'd like to use it with the Italian language, so that words are hyphenated the right way (e.g. the Italian word 'distante' should be broken as ...
3
votes
1answer
47 views

help about macro \uparrowfill

Is there in plain TeX a macro similar to \leftarrowfill but vertically oriented, something like \uparrowfill? I know it exists in LaTeX, but I'm interested only in plain TeX.
4
votes
1answer
151 views

Plain TeX macro to read a document in Pig Latin

Say I have a file eng.tex: \def\encounter (#1){Hello, #1!} \encounter (World) \bye I convert it to Pig Latin and save it as pig.tex: \efday\encounterway (#1){Ellohay, #1!} \encounterway (Orldway) ...
11
votes
1answer
144 views

XeTeXpicfile in vertical mode

Given a minimal like \line{% \vtop{\hsize=.6\hsize Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse tempor lectus sit amet laoreet convallis. Quisque at est lacinia, porttitor ...
6
votes
2answers
194 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
120 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
112 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
149 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
141 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
161 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
212 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
641 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
384 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
300 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
137 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
188 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
630 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
142 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
244 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
107 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
890 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
123 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
242 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
261 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
241 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 ...