Questions tagged [plain-tex]
Plain TeX is Knuth's original default format for TeX documents.
810
questions
4
votes
1
answer
80
views
Plain TeX floating Figures
I wonder if someone can point me to some macros that effect floating figures. I'd like something along the lines of a footnote. i.e. auto-increment the Figure number and then create a floating box ...
3
votes
3
answers
146
views
How can I use these PostScript fonts on Overleaf with plain TeX?
How can I use these fonts on Overleaf with plain TeX?
\font\tenpalatino=Palatino at 10pt
\font\bighelvetica=Helvetica at 30pt
This is a test. \tenpalatino This is Palatino font at 10pt. \par
\...
5
votes
3
answers
369
views
How to get lesssim in Plain TeX?
How can I get something like the lesssim symbol in Plain TeX? I found a comprehensive-looking list of Plain TeX codes online, but it didn't include anything that did what lesssim does.
5
votes
2
answers
117
views
How to use expression to set margins using \hoffset in TeX?
\def\leftmargin{1.25in} % custom margin
\hoffset \leftmargin - 1in % subtract 1in from \leftmargin, !Not working
\hoffset \leftmargin minus1in % also tried this with no success
% In ...
3
votes
2
answers
87
views
PSTricks and color not useable together in Plain TeX?
% Plain LuaTeX
\input luaotfload.sty
\input pstricks
\input pst-circ
\input color% destroys everything
\pspicture(-1, 0)(3.5, 4.5)
\circledipole[labeloffset = 0](0, 3)(3, 3){V}
\coil[dipolestyle=...
4
votes
3
answers
309
views
Expandable way to tell apart a character token and an equivalent control sequence
As the title says: is there any completely reliable, expandable method to differentiate between a control sequence that has been made equivalent to a character token and the character token itself? (...
1
vote
1
answer
79
views
How to use sans serif font in math mode?
It is rather common to typeset theories (that is a set of statements) such as ZFC in a sans serif font family.
I tried the following:
\font\ss=ecss1000
\def\ZFC{\ss ZFC}
\ZFC
$\ZFC\models\exists X\...
1
vote
1
answer
29
views
Page layout in XeTeX
I want to create a presentation using XeTeX but I am having trouble with the page layout. The expected result show be a pdf with a 4:3 aspect ratio, centered content and margin of 1/8th of the total ...
0
votes
1
answer
57
views
What is the picmac package useful for?
I recently found this package on CTAN by Don: https://ctan.org/pkg/picmac
But there does not seem to be any documentation online about it, could someone provide some minimal examples of it?
Apparently ...
0
votes
1
answer
76
views
About text floating into columns (vboxes again)
With the help of others, I managed to have text flow smoothly into columns. Finally, I got rid of the overflow, TeX does with limited vboxes. Now,a solution always implies the next question:
If I ...
1
vote
1
answer
35
views
Wrong spacing with math mode inside sl in plain TeX
Here is a minimal example of a problem I encounter sometimes:
{\sl Let $\cal U$ be}
\bye
In the output U is much closer to "Let" than to "be".
Is there an equivalent to the italic ...
1
vote
2
answers
123
views
How `rotatebox` could be defined in plain TeX?
I was wondering if it is possible to define rotatebox in plain old TeX (without importing eplain, pstricks, miniltx or what not or using pdfrotate or other pdf-specific commands).
The word "...
1
vote
2
answers
65
views
How can I typeset vDash in plain TeX?
I am working on a model theory document in plain TeX, and I use the vdash and vDash symbols a lot.
\vdash is already part of plain TeX, so no problem, but what's the way to get \vDash to look ...
0
votes
1
answer
37
views
How to magnify with a factor < 1 in plain Tex?
I want to reduce the size of everything in a document to read it on a specific device.
I tried to use
\magnification=833
as 1/1.2 * 1000 = 833 and I think that Knuth uses this kind of formulas to get ...
3
votes
2
answers
180
views
How to create a bibliography in plain TeX?
I know that you can use BibTeX using eplain and btxmac.tex but I am looking for a minimalist solution with at little code as possible.
I am almost tempted to do everything by hand (see Appendix B of ...
4
votes
2
answers
177
views
How to define underleftarrow in plain TeX?
I want to typeset the lim symbol with an arrow under it (pointing to the left or to the right).
The following works for putting the arrow over lim
\def\limleft{\mathop{\overleftarrow{\rm lim}}}
$\...
3
votes
1
answer
66
views
Mixing text and image in Optex
I've tried to mix text and images in Optex, but the solution is far from perfect. It throws an error -- Missing } inserted. Besides, I'm quite unsure about whether the use of \valign and \vtop (...
10
votes
2
answers
205
views
Why changing the catcode of : cause epsfbox to fail?
I have the following very simple TeX file:
\input epsf
\catcode`\:=\active\def:{\thinspace\string:}
a: b
\centerline{\epsfbox{test.1}}
\bye
with test.mp containing
beginfig(1);
draw (0,0) -- (100,...
2
votes
1
answer
81
views
negative glue and hbox of same size do not cancel each other out
This code:
\hskip-1cm \hbox to 1cm{\hfil}\hbox to \hsize{\hfil Hello World}
\bye
yields
Overfull \hbox (20.0pt too wide) in paragraph at lines 1--2
Why is that? I would assume that applying negative ...
6
votes
3
answers
325
views
How to produce display style fractions in plain tex
How to produce display style fractions in plain tex?
I know that plain tex uses \over for fractions, for example {1}\over{2}.
But how to do displaystyle fractions? I tried to use \displaystyle and it ...
4
votes
1
answer
168
views
How to install LuaMetaTeX to MikTeX on Windows 11?
On GitHub you can find the Plain and LaTeX format for LuaMetaTeX. I am a Plain LuaTeX user and would like to switch to Plain LuaMetaTeX for some reasons. Examples: unpacking the contents of \left and \...
3
votes
2
answers
86
views
Using `\<char> notation to work in replacement text (macro argument) - plain TeX
I'm still trying (again) to not succumb to the TeX syntax.
I'd like to create a "if/when" that checks if a character is letter (catcode 11).
\def\whenletter#1{\expandafter\expandafter\...
2
votes
1
answer
81
views
Two-column macro in PlainTeX
While reading the TeXbook, I became curious to make my own double-column macro. I have tried to split content with \vsplit and boxes, but I have had no success thus far. Using a LaTeX package is a ...
1
vote
1
answer
27
views
extra vertical space in edge
i wrote this code to get output without margin spaces.
but i saw there is some extra vertical space between charater A and up edge of pdf file.
1 inch vertical and horizontal extra space is the ...
2
votes
2
answers
97
views
weird error (again) in plain TeX
Sorry all... the "missing number, treated as zero" error again. I can usually find it and fix it, but this time I need help.
I have a macro \twoup to produce output consisting of two A5 ...
1
vote
2
answers
78
views
pstricks won't even start in new TeX installation - Plain TeX
Did a clean install via TeX-Live 2022 onto a new mac. None of my old TeX files would compile. Reduced to the following and still won't compile.
Plain TeX using TeXShop, TeX+DVI.
\input pstricks
\...
0
votes
1
answer
44
views
horizontal centering within \valign cells
I'm trying to use \valign to make an array of items. (See my self-answer to another question.) I'm doing this because I want to specify the items per column instead of per row, and because I want ...
1
vote
1
answer
52
views
Prevent parskip after special at beginning of vbox
If I understand correctly, when entering unrestricted horizontal mode, TeX inserts a parskip if the containing vertical list is non-empty. That applies even when the only item on the list is not ...
2
votes
2
answers
92
views
How to get width of parameter in plain TeX?
I am trying to get the width of a macro parameter using
\def\getwidthof#1{%
\newdimen\myl%
\settowidth\myl{#1}%
\the\myl%
}
where \settowidth is defined as
\catcode`\@=11
\newbox\@...
3
votes
1
answer
187
views
What's the easiest way to define an inline verbatim with |...| and display verbatim with ||...|| in plain TeX?
I have been trying to define a verbatim environment in plain TeX with |...| for inline and ||...|| for display. Optimally, with an easy way to alter so that the visibility of spaces can be toggled (e....
1
vote
2
answers
68
views
How might one print the \tt prime character while in taocpmac's begintt mode?
I am using \begintt and \endtt from Knuth's taocpmac.tex and I would like to typeset the prime character, not the apostrophe. My code looks something like this:
\input taocpmac
\begintt
a' = a + 1
\...
1
vote
3
answers
63
views
Changing spaces into dashes in Plain-TeX
In Plain-TeX, how can I change a string that is stored in a macro so that each space in that string is turned into a dash? E.g. if \def\a{This little example}, I will like to have some procedure that ...
2
votes
1
answer
49
views
\widehat in text mode in Plain (Xe)TeX?
Is there a way to emulate the behaviour of \widehat in text mode in Plain (Xe)TeX? That is, take a single accent1 and “stretch” it over two or more letters. I need it in text mode, because it's not ...
0
votes
2
answers
48
views
Vertically align first image in a 3 image combination [optex]
Following the tip from the answer here, I could align three (sub)figures:
\def\figure#1#2{\vbox{\hbox{\picw=.45\hsize \inspic{#1.jpg}}\medskip\hbox{\qquad#2}}}
\hbox to\hsize{\figure{S10} {(a) Bird}\...
16
votes
2
answers
696
views
Is there microtype support for plain TeX?
Is there code to make the microtypography primitives, particularly font expansion, usable with the plain TeX format running with native PDF-output engines (namely pdfTeX and LuaTeX)?
I don't think the ...
2
votes
1
answer
64
views
Need help wih \expandafter
In OpTeX there is a macro \addto which adds some text to the definition of another macro. It is defined like this: \long\def \addto #1#2{\expandafter\def\expandafter#1\expandafter{#1#2}}. Why are all ...
1
vote
1
answer
63
views
Text along a curve in Metapost
Does anyone have any suggestions on how I might get text along a curve in Metapost?
4
votes
1
answer
250
views
Create macro with variable number of comma separated arguments in plain TeX?
I wish to create two macros: one that takes a known number, and another that takes an unknown number of arguments that are comma-separated and does something with them. There have been a few answers ...
1
vote
3
answers
72
views
Putting a brace across multiple lines with text in Plain TeX
I'm changing a document prepared in Plain TeX and I'm trying to get a brace to cover multiple lines for example:
S is P { cannot both be true (L. of Contradiction)
S is not P { cannot both be ...
3
votes
1
answer
148
views
Why are \showboxbreadth and \showboxdepth set to 2^{30}-1 in \loggingall?
The plain TeX format defines
\def\loggingall{\tracingcommands\tw@\tracingstats\tw@
\tracingpages\@ne\tracingoutput\@ne\tracinglostchars\@ne
\tracingmacros\tw@\tracingparagraphs\@ne\tracingrestores\...
1
vote
0
answers
65
views
Where is the reference point of a VBOX?
From the TeXbook,
Therefore, the actual rules for the depth of a constructed vbox a somewhat TeXnical. Here they are: Given a vertical list that is being wrapped up via \vbox, the problem is to ...
2
votes
1
answer
325
views
Why double curly brackets in `\long\def\bold#1{{\bf#1}}`
I'm reading The TeXbook by Knuth.
Page 205 has
If you actually want a control sequence to allow arguments with \par
tokens, you can define it to be a “long” macro by saying ‘\long’ just
before ‘\def’. ...
2
votes
2
answers
134
views
Plain TeX simple horizontal alignment in table
Beginner's question: Why doesn't horizontal alignment work as I expect in this simple table?
I just have a set of variables with values in the left column which I want to align under the heading "...
1
vote
1
answer
36
views
adding footnotes to columns in plain-tex / optex
Accorging to this answer, it's possible to add footnotes to columns in optex/plain tex.
Although I have a vague idea about what the author has in mind, where/how exactly do I add \penalty-10013 and \...
0
votes
1
answer
43
views
Under what circumstances does TeX produce a series of tokens with space after a control sequence?
On page 39 of The TeXbook, Knuth said,
Furthermore, spaces
are not ignored after control sequences inside a token list; the ignore-space rule applies
only in an input file, during the time that ...
4
votes
2
answers
275
views
How to use mlmodern fonts with Plain TeX or OpTeX?
I would like to systematically use mlmodern fonts with Plain TeX and even OpTeX, but I am unable to convert the code of mlmodern.sty into a code which could be understood by the tex or optex ...
3
votes
1
answer
160
views
\if compares text literal?
Knuth's tex book introduced \if<token1><token2>. I wrote the following to test it
\def\tOne{abc}
\def\tTwo{abc}
\ifx\tOne\tTwo
True
\else
False
\fi
\if\tOne{abc}
True
\else
False
\fi
\...
0
votes
0
answers
99
views
How to align = symbol of several equations vertically?
I want to do something quite particular with PlainTeX, though I'm not one hundred percent sure it's possible.
Say I have a few equations, each on a separate line, which represent the simplification of ...
4
votes
2
answers
216
views
How to typeset the numero sign in Plain TeX?
I want to typeset the numero sign № in Plain TeX.
My first guess is to use
\def\numero{$\rm N^{\underline o}$}
but the line under the o is too long and I don't really want to mess up with arbitrary ...
1
vote
1
answer
67
views
Table column spacing in Plain TeX with \settabs
In Plain TeX I need to reduce the space between 2 columns in a 2 column
table. How to do this? I am simply using \settabs 2 \columns, but one column is
at the left of the page, but the second is on ...