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

learn more… | top users | synonyms

7
votes
3answers
201 views

Macro like `\ignorespaces` for ignoring `\par`s

I would like to have a macro \ignorepars that removes all \pars following it. I wrote the following code: \def\eat{} \def\ignorepars{\futurelet\next\ignoreparsA} ...
3
votes
1answer
48 views

Check for sufficient number of tokens left

I want to use a command that takes a large number of arguments, possibly more than left in the input stream. \def\consumeseven#1#2#3#4#5#6#7{} \consumeseven \space In this scenario \consumeseven ...
1
vote
1answer
43 views

How do I provide a ddot accent in text using the stix-mathsf font within plain TeX?

If I use the font stix-mathsf and try to type H\"o, then the o will have a large inverted breve accent over it (because the position of the character \" is different from most fonts), whereas ...
3
votes
3answers
288 views

ç doesn't work in \write and \read

In Plain TeX when I do a \write containing ç or Ç in the string it gets expanded generating a lot of code in the output file, which can't be read back. I got this problem when reading a TOC: This is ...
2
votes
2answers
86 views

How to stop a custom \section macro from adding whitespace to the beginning of a paragraph?

I lifted a \section macro from the TeXbook. \outer\def\section#1{\medbreak\noindent{\bf#1}\smallskip\par\nobreak\noindent} When I use this macro like this: \section{\TeX nical documenation} Blah ...
3
votes
1answer
81 views

superellipse with pdfliterals

I don't know if this is possible, since I know nothing about PDF literals, so can I draw a superellipse with \pdfliterals, and how? I'd like to write a presentation theme for lecturer which draws a ...
3
votes
1answer
75 views

How can the font Open Baskerville be used with plain TeX?

I downloaded the font Open Baskerville from here, but I don't know how to use it. How can it be loaded in plain TeX? I can use any of tex, pdftex or xetex. (I am using texlive on Linux.)
4
votes
2answers
131 views

Plain TeX end of proof macro

I am writing a macro to typeset proofs of theorems. By getting rid of irrelevant (for this question) things, it simplifies to \def\demo#1\enddemo{\noindent{\it ...
5
votes
3answers
129 views

How to draw a box around something with the dimensions of something else?

I'm using plain TeX and I've lifted a macro \boxed from the TeXbook (where it is called \cstok and slightly different) to put boxes around things in math mode: ...
6
votes
2answers
203 views

What's the way to change the size of a math symbol in plain TeX?

I find that \diamondsuit in ntxsy is too small, so I want to define a macro that will enlarge it and take into account the current font size being used. To illustrate below, I have a partial attempted ...
5
votes
1answer
52 views

Can lineskip depend on how close the boxes are horizontally?

TeX adds lineskip when two lines would get too close together. However, this ought to depend on whether the conflicting boxes in question are near each other horizontally, not just vertically. Is ...
2
votes
1answer
77 views

MathTime Pro 2 with luatex

I'm using Tex Live on Linux (Ubuntu). I have the MathTime Pro 2 (lite version) fonts installed, using the script I found here. I always used them with tex, pdftex or xetex and they worked correctly. ...
8
votes
3answers
217 views

Smart macro to produce stanzas

I want to typeset a booklet of poetry, in Plain. Thus far I've been able to make TeX obey spaces and lines with the following code: \def\startline{\par\noindent} \obeylines\obeyspaces ...
6
votes
2answers
144 views

Extra interline glue between \vbox'es?

In the following example I use \strut's in both lines, but nevertheless there is gap between the rules. Why there is this gap between two rules? Example 1: \vbox{X\strut\hrule} \vbox{\hrule ...
0
votes
1answer
49 views

How to set the width of last column in \settabs?

The last column in sample line in tabbed alignment is not used for anything. If we use sample line in \settabs, we must put there the widest cell for corresponding column (which may not be the first). ...
1
vote
1answer
30 views

Why vrules are not aligned between rows of tabbed alignment?

How to make \vrules aligned against each other in the following example? Why the sample line after \settabs does not work as needed? \magnification=\magstep5 \nopagenumbers \font\ttl=rm-lmtl10 ...
1
vote
0answers
57 views

Asymptote in plain TeX [closed]

Is there a way to directly embed Asymptote code in plain TeX as it can be done in LaTeX? (For example by using miniltx or something like that?) Can labels in figures be typeset using plain TeX instead ...
3
votes
0answers
60 views

Why zero lccode does not stop hyphenation in LuaTeX?

Compile the following example with tex and luatex: \nopagenumbers \parindent=0pt \parskip=0pt \def\par{\endgraf\hbox to 15em{\hrulefill}} \hsize=1pt \hfuzz=15em 1 'supercalifragilisticexpialidocious ...
7
votes
2answers
167 views

Problem in a macro definition (plain TeX)

I'm trying to write a \multicenter macro that acts as \centerline, except that it splits the text in different lines whenever it encounters the command \\. For example, \multicenter{ciao\\a\\tutti!} ...
5
votes
1answer
96 views

How to put characters between every paragraph

I'd like plain TeX (pdftex) to put a specific sequence of characters between every paragraph of its output. For example: Original text might be: This is paragraph 1. This is paragraph 2. This ...
4
votes
4answers
283 views

How to properly change page offsets?

Suppose that we need to change margins. This cannot be done only by changing \hsize and \vsize, because of the default offset of 1in. There is a possibility to change \hoffset and \voffset directly, ...
8
votes
1answer
185 views

How does \halign differ from \hfil?

Suppose we have three blocks of text aligned horizontally. Why Example 1 differs from Example 2 and what should be changed in the latter to make it look like the former? NOTE: I added rules just to ...
4
votes
1answer
259 views

What is the purpose of \raggedright?

I thought that \raggedright is used to get text: 1) not exceeding certain width, 2) with natural interword spaces, 3) without hyphenation. But it turns out that hyphenation is done with \raggedright. ...
4
votes
1answer
123 views

Why is \leftskip glue not automatically inserted?

TeXbook says (page 100): TeX has two parameters called \leftskip and \rightskip that specify glue to be inserted at the left and right of every line in a paragraph ... Consider this example: ...
4
votes
1answer
76 views

How do I type a brace-enclosed, numbered equations in plain TeX?

Basicly it looks like: I tried \eqalign, but it cannot have equation numbers on the right. I also tried \eqalignno, but it cannot have a brace on the left.
5
votes
1answer
110 views

QR code for plain TeX

I am looking for a macro package for QR codes applicable in plain TeX. The QR code should be calculated from string at TeX macro level like in qrcode.sty, but this package is usable only for LaTeX. I ...
1
vote
0answers
17 views

Non-equal spacing comparing between \left, \right and their \big equivalents [duplicate]

The following two examples differ only with that in the first \left and \right are used, and in the second they are replaced with equivalent \Biggl and \Biggr. But spacing differs slightly. Why? $$ ...
3
votes
2answers
53 views

What are the rules for style change in formulas (Plain TeX)?

Both numerator and denominator in the following two formulas are of the same size, namely \textstyle (from which we conclude, that: 1) style change does not affect the digit, which immediately ...
1
vote
1answer
44 views

Weird spaces after \magstepN

Consider example1: hello% world \bye In example2 a space is added between o and w, in comparison with example 1: hello% \magnification\magstep0 world \bye (It seems that space (which appeared ...
2
votes
1answer
88 views

Plain TeX and XeTeX

Will all plain TeX code also work with XeTeX?
7
votes
2answers
130 views

Why does the redefinition of \par disable \nopagenumbers?

Let's disable page numbers: \nopagenumbers Hello world. \bye Page numbers appear if we redefine the nearest \par: \begingroup\def\par{\endgraf\endgroup} \nopagenumbers Hello world. \bye If we ...
1
vote
1answer
49 views

How to get last box in vertical mode?

I'm trying to get the contents of a paragraph with \showbox via \vadjust, by overloading \par. I came up with this: \showboxdepth\maxdimen \showboxbreadth\maxdimen \let\oldvadjust\vadjust ...
4
votes
1answer
119 views

moving from old plain TeX to XeTeX

I have a style file I used for a project in pre-Unicode age. Now I want to convert it for use in XeTeX. I used Computer Modern and now would like to use CMU Serif. Pointers on what to do with the ...
4
votes
3answers
39 views

Setting headlines with widths which differ from the width of the body text

Using (plain) TeX, I'm trying to set the headline to a different width from that of the body of the text (i.e. hang page numbers to the outside of the text, as seen in the TeX Book).
1
vote
0answers
44 views

Short footnotes on same line or centered in plain TeX

Is there in plain TeX a way to print two short footnotes on the same line (spaced as if in columns) or a single footnote centered?
2
votes
2answers
138 views

How to align vertically by right border?

Consider this example: \hsize.1in \noindent \parfillskip=0pt \leftskip=0pt plus 1fil \hfuzz=2em hello world \bye The result is: The expected result is: Why the example does not produce the ...
10
votes
1answer
149 views

Question about exercise 23.3 in TeXbook

This is exercise 23.3: Explain how to change the output routine of plain TeX so that it will produce twice as many pages. The material that would ordinarily go on pages 1, 2, 3, etc., should go ...
3
votes
1answer
86 views

How much space is occupied by footline?

This is said in TeXbook about page dimensions: Plain TEX sets \vsize=8.9in (not 9in, since \vsize doesn't include the space for page numbers at the bottom of each page)... According to ...
6
votes
1answer
127 views

Weird error after \showthe

I'm trying to understand the meaning of \p@ from plain.tex: \newdimen\p@ \p@=1pt % this saves macro space and time While trying to figure it out, I stumbled upon strange behavior. Consider this: ...
5
votes
1answer
79 views

How is a page produced in the output routine?

Compare this \nonstopmode \tracingonline=1 \showboxdepth=\maxdimen \showboxbreadth=\maxdimen \output={\shipout\vbox{ \unvbox255 \showlists }} \nopagenumbers \noindent A \bye and this ...
6
votes
1answer
123 views

How to draw borders around page contents

During learning, while conducting different experiments, it's useful to see actual page borders. So I wrote the code which does this and would like to know whether it is the proper way to accomplish ...
17
votes
1answer
332 views

What is the equivalent of \usepackage[T1]{fontenc} in plain TeX?

I have inherited a semi-small TeX project in which I, after syncing across various computers and OS'es, had some problems with encodings of special characters like åäö. My initial approach for fixing ...
4
votes
1answer
46 views

Description list in plain TeX with optional break after tag

I'd like to have a desription list in plain TeX where there is only a line break after the item tag if the tag width exceeds a certain value. Lets say the indentation of the tags is zero and the ...
7
votes
2answers
200 views

Editing ligature table

It is suggested in TeXbook (p. 46) that in adapting TeX to type Norwegian, You can arrange the font metric file so that TeX will interpret ae, o/, aa, AE, O/, and AA as ligatures that produce ...
3
votes
1answer
96 views

Plain TeX: Wrong \folio for heading at top of page

I have the following chapter macro (uses code from Heiko Oberdiek): \def\ChaptTocEntry#1#2{% \line{\hbox to1em{\hfil\bf#1}\hskip1em#2\leaderfill\folio}} \def\ChaptWr#1{{% \let\folio\relax ...
6
votes
1answer
141 views

two column footnotes, Plain TeX

I’m trying to get footnotes set in two columns in Plain TeX. This is my minimum working example: %!TEX TS-program = pdftex \output{\ifvoid\footins\else\vskip\skip\footins\rigidbalance\footins 2 7pt ...
5
votes
2answers
63 views

How to expand a register value in a \write argument (plain TeX)?

I am using \write to output table of contents information. While the correct heading counter information apears in the headings itself, the TOC headings have the number of the last heading of a page. ...
2
votes
2answers
65 views

Is there an equivalent to roff's .ns (no-space mode) in plain TeX?

Is there something like roff's .ns in plain TeX (or something even better)? E.g. a command which says that the directly following vskips are ignored or (additional) a special "vskip" which makes all ...
0
votes
1answer
89 views

Plain TeX pdf2ps page numbering offset for front matter in PDF viewer [duplicate]

The good: When I use plain TeX, and then run dvips to get the Postscript output, I see negative page numbers for the front matter in the thumbnail pages on the left in evince and gv (ghostview), ...
3
votes
2answers
94 views

Does the concatenation of two text files, which compile under tex, always compile under tex?

In other words, does the set of all text files that compile under tex form a monoid under concatenation? I have recently dabbled a bit in plain tex and my algebraic spider senses were immediately ...