Questions tagged [plain-tex]
Plain TeX is Knuth's original default format for TeX documents.
870
questions
1
vote
1
answer
270
views
Weird spacing around large brackets in Plain TeX
I use Plain TeX on a daily basis and a frequent annoyance when typesetting large displays is weird spacing that occurs around bigger parentheses/braces/etc. For example, here is \exp(-x) with the five ...
3
votes
2
answers
469
views
How to insert a image in plain TeX using no helping library?
How could I insert a image in plain TeX, having a good control over its positions and scale, using no additional library (supposedly, a lot of ps commands as argument of \special)? I am intend to work ...
1
vote
0
answers
107
views
Typesetting using TeX in the long run
In short: how accurate is TH.'s claim here?
Say I want all my written works to be archived so that people are able to access it 10, 50, 100 years from now. If I have a finished LaTeX project right now,...
4
votes
2
answers
272
views
Use Small Caps of ttf font with xetex in plain tex (without fontspec)
I want to use the small caps of the font CormorantGaramond-Light.ttf. With XeLaTeX I could just do
\documentclass {article}
\usepackage{fontspec}
\setmainfont{Cormorant Garamond Light}
\begin{...
6
votes
3
answers
244
views
Why is \char not expandable? [duplicate]
\char<number> is a TeX primitive that results in the character of ASCII code <number> with category code 12. However, it isn't expandable, unlike it's many cousins \romannumeral, \number, ...
3
votes
1
answer
106
views
Ordinary math mode enclosed by display math mode
Purely academic TeX question! The solution of Exercise 13.5 in The TeXbook
Vertical mode can occur only as the outermost mode; horizontal mode and display math mode can occur only when immediately ...
5
votes
4
answers
123
views
Store the expanded version of a macro into another macro in the plain format
I wrote the following macro that prints a range of numbers separated by commas:
\newcount\tmpnum
\def\range#1#2#3{\tmpnum=#2
\loop\the\tmpnum\advance\tmpnum by #1
\ifnum\tmpnum<#3,\...
0
votes
2
answers
777
views
most tfm fonts are not found
I had the same problem with texlive 2020 and did a full installation of texlive 2021:
\font\tenrm=mdugmm7y at 10pt
\tenrm
Hello World!
\bye
doesn't work with tex, pdftex, xetex or luatex. All of ...
1
vote
0
answers
113
views
Will LaTeX compile Plain TeX? [duplicate]
I'm really new to TeX and I'm trying to learn how the different levels of TeX relate to each other. As far as I understand LaTeX is a set of macros for Plain TeX with the purpose of making life easier,...
1
vote
1
answer
154
views
plain tex. beginsection doesnt break line
I'm typing a math article for someone. He asked me to type it in plain TeX (rather than LaTeX) because he is used to plain TeX and would like the option to edit my typing, I think.
Anyway, I am new to ...
5
votes
1
answer
230
views
Plain TeX \loop \repeat tracing output is incorrect
\tracingall=1
\newcount\n \n=20
\loop\the\n \advance\n by-1 \ifnum\n>0 \repeat
\bye
will get out like:
*\loop #1\repeat ->\def \body {#1}\iterate
#1<-\the \n \advance \n by-1 \ifnum \n >...
2
votes
1
answer
91
views
Some strange shipout behaviors (plain tex)
I was trying to understanding how the size of a page is determined in terms of TeX primitives. As first attempt, I've tried to occupy completely the page with a simple header (a line) , a footer (in ...
1
vote
1
answer
145
views
plain XeTeX bold font does NOT work for tibetan fonts
I am using Plain XeTeX to typeset some Tibetan books. But found that the /B option of \font didn't give me the bold version of that font. I did noticed some English fonts have a standalone version of ...
3
votes
1
answer
218
views
Computer Modern not raster. Why?
The fonts produced by METAFONT should be raster rather than vector, as far as I know. The Computer Modern font is produced by METAFONT, hence it should be raster. The following code
\font\testfont= ...
2
votes
1
answer
131
views
Can I make \directlua understand unicode chars like ≥, ≤, ≠, ∙, and −?
MWE:
\directlua{%
local abs=math.abs
function gcd(x, y)
if y \csstring\~= 0 then
return gcd(y, x \csstring\% y)% I would like to write "≠" instead of "~=".
else
...
1
vote
1
answer
50
views
Why does the third column shift to the right? Columns by picturewidth
The center column is defined by \picwidth. All the other columns should have the same or another size. Why is the third column shifted to the right?
\parindent=0pt
Dies ist ein Beispiel. \vskip\...
1
vote
1
answer
428
views
MiKTeX file location for plain TeX macros using WinEdt
I use plain TeX (not LaTeX) on a Windows 10 PC to create worksheets for my HS math classes. I've been using MiKTeX 2.4 and WinEdt5 (since 2001) but decided to try upgrading to the latest of each (...
10
votes
1
answer
344
views
How has plain.tex been updated?
I've noticed that on CTAN there is a new version of the file plain.tex, dating 2021-01-17. But nowehere I see what the changes are. What has changed?
2
votes
2
answers
290
views
$\displaystyle{#1}$ versus $\displaystyle#1$
In reading Appendix B of the TeXBook, I've noticed that Knuth consistently defines macros in Plain TeX with style switches of the form $\displaystyle{#1}$ as opposed to simply $\displaystyle#1$ (e.g., ...
2
votes
1
answer
144
views
How does \over work?
I don't mean this necessarily in the sense of diving into code, but \over seems to function differently to other commands, which scoop up only following arguments. Instead, 11\over2 gobbles up the ...
1
vote
1
answer
285
views
Outline text in plain XeTeX?
I use plain XeTeX. I've been asked to include a shamrock character in a typeset document (which I've found at Unicode 2618), but only in outline. The examples in the excellent PST-Text package (page ...
1
vote
2
answers
167
views
Automatically add space after parenthesis in math mode if followed by certain characters
I'm using plain TeX with the luatex engine (actually it is OpTeX, but you can just assume it is the "plain" luatex). For my document I'm using the font EBGaramond. When I have a fomula like ...
6
votes
1
answer
463
views
catcode 12 spaces
I would like to understand TeX's behaviour when the catcode of the space character is set to 12.
The following two example input files differ in just one position: where the first has the character 4 ...
7
votes
2
answers
252
views
Underbrace under square root sign plain TeX
$$
\rlap{$\sqrt{\phantom{\displaystyle\pmatrix{A^{-1} b(x)\cr -1}^T
\pmatrix{A & b(x) \cr b(x)^T & \Phi(x,x)}
\pmatrix{A^{-1} b(x) \cr -1}}}$}
\mskip14mu
\...
3
votes
2
answers
153
views
TeX primitive for streachability inside a math formula
In a math formula the glue between symbols can stretch or shrink. Which is the TeX primitive which establishes the badness of this kind of stretch/shrink?
0
votes
1
answer
150
views
Shading in Tikz not working in Plain Tex
Shading is not working on my Plain Tex code. I use xetex.exe -synctex=1 -interaction=nonstopmode in TexStudio. No error message or warning. However, the code works on LaTex. Could anyone help check ...
2
votes
1
answer
55
views
Questions about arguments of tikz macros
I'm a novice at coding.
I'm reading the code of the macro \tikz@scan@one@point,
but I have lots of troubles:
Question 1:
How to distinguish the arguments of a macro? For example
the definition ...
1
vote
0
answers
131
views
How to define a command that takes the word before it as one of its parameters?
I want to define a macro \foo that behaves similarly to \over and \atop, such that the code
#1 \foo #2
outputs
foo #1 #2
6
votes
3
answers
206
views
Strange error when unvboxing in `\hbox`
and merry Christmas!
I've encountered a strange error message on TeX level which cost me quite some time to unravel because it was so exceptionally unhelpful...
Here's a minimal plain TeX example:
\...
2
votes
6
answers
262
views
Plain TeX: Problems when \loop to set parameters for \parshape
I was trying to write a macro for wrapping text around a figure. I aware that it is available in Latex and there is another package, figflow for plainTex. I am just learning to write my own. My first ...
2
votes
2
answers
322
views
Stretch spaces within a box
Example:
\noindent
abcd abcd abcd abcd abcd abcd abcd aaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
abcd abcd abcd abcd abcd abcd abcd aaaaaaaaaaaaaaaaaaa
...
2
votes
1
answer
387
views
Definition of \magstep in Plain TeX
On page 349 of the TeXbook the definition of \magstep is given as
\def\magstep#1{\ifcase#1 1000\or
1200\or 1440\or 1728\or 2074\or 2488\fi\relax}
But in plain.tex of texlive the line 391 says:
\def\...
4
votes
2
answers
2k
views
Force footnotes to bottom of page in plain TeX
I have a large (~3000 pages) document typeset using plain TeX plus some local macros. The document uses the plain TeX \footnote macro for footnotes. The document also uses \raggedbottom. This means ...
5
votes
1
answer
218
views
How to skip horizontally by the negative amount of \hoffset?
I tried the following but nothing seems to work:
\hskip -\hoffset
\hskip -\the\hoffset
\hskip 0pt minus\hoffset
\hskip 0pt minus\the\hoffset
What is the right syntax to reference hoffset?
Update
...
0
votes
1
answer
480
views
How can I set a different \topskip for different pages?
I tried to write a letter with a different value for \topskip on the first page because of the the address field. This works fine:
\tracingoutput=1%
\pdfpagewidth=210mm%
\pdfpageheight=297mm%
\hsize=\...
7
votes
1
answer
314
views
\vbox to 0pt creates small vertical space
I have the following plain TeX file:
\tracingoutput=1%
\pdfpagewidth=210mm%
\pdfpageheight=297mm%
\hsize=\pdfpagewidth \advance\hsize by -50mm%
\vsize=\pdfpageheight \advance\vsize by -50mm%
\advance\...
0
votes
0
answers
72
views
Plain Tex and Tikz: pgfsys-dvi.def does not support color
Here it is my little example
\magnification 1200
\def\pagetop{792}
\def\pgfsysdriver{pgfsys-dvipdfm.def}
\input tikz.tex
\usepgflibrary{arrows}
\tikzpicture
\draw[color=red,line width=2pt] plot (...
3
votes
1
answer
171
views
eplain packages with plain tex no longer have all needed definitions
If one uses tex rather than pdftex, one gets errors when inputting certain packages with eplain. For example, let test.tex be this file:
\input /usr/share/texlive/texmf-dist/tex/eplain/eplain
\...
0
votes
1
answer
133
views
Plain Tex error using tikz and dvips
Here is my Plain Tex file (example taken from the manual)
\input tikz.tex
\baselineskip=12pt
\hsize=6.3truein
\vsize=8.7truein
We are working on
\tikzpicture
\draw (-1.5,0) -- (1.5,0);
\draw (0,...
0
votes
1
answer
272
views
Plain TeX (MiKTeX) installed Oct 7'20 on Windows 10 is not working as before (of Jan/Feb. 2019)
After a MiKTeX package update on 26.9.2020 Plain TeX (\input ngerman.sty) is no longer working as it used with my previous version MiKTeX 2.9 of January/February 2019, even after a fresh installation ...
1
vote
0
answers
83
views
No hyphenation for ngerman with Plain-TeX after a recent MiKTeX package update
German hyphenation worked fine with my MiKTeX installation of February 2019 for Plain TeX input with just ngerman.sty as control sequence. But after I executed a package update on 26 September 2020 I ...
1
vote
0
answers
263
views
latex pmatrix without begin
I'm quite new to LaTeX, and I'm wondering why do LaTeX use to \begin notation for environments. Is there a way to use \pmatrix directly in latex documents compiled with pdflatex?
I recently dug up ...
2
votes
1
answer
135
views
Cannot get small caps with OTF font and XeTeX
I am working on a project which requires me to use plain TeX, which I compile with XeTeX.
The font I use is available as the following OTF files: MyFontSerif-{Regular,Bold,Italic,BoldItalic}.otf
I am ...
0
votes
1
answer
35
views
Centering contents horizontally in \halign
\input luaotfload.sty
\catcode`\@=11
\pageheight 23mm
\pagewidth 67mm
\hoffset -1in
\voffset -1in
\advance\hoffset 2mm
\hsize 63mm
\vsize 23mm
\topskip\z@
\baselineskip 17.5\p@
\abovedisplayskip\z@
\...
6
votes
3
answers
432
views
Tabular edge-to-edge dotted line: suppress overshoot, reduce dotsize, align dots to edges
I am trying to add dotted line from left-edge to right-edge of tabular after rows. There are 3-problems with my best attempt (code & screenshot below): 1) The length of the dotted line equals ...
3
votes
1
answer
365
views
\vadjust example on Tug.org
I was on Tug.org reading about some of TeX's primitives. I came across this example usage of \vadjust.
1. \def\strutA#1#2{\vrule height#1 depth#2 width0pt}
2. \def\ta#1%
3. {%
4. \strutA{8.5pt}{3....
1
vote
0
answers
99
views
How to also vertically align horizontally aligned image and text **while allowing page-breaks**?
This question is not asking for snippets of code.
It is asking for describing general practices with words.
In plain TeX I'd like to place an image/a rectangular box at the left of some piece of text ...
1
vote
2
answers
97
views
Justify box at the left margin while keeping \parindent glue/obeying \noindent if present
How to define a command which takes two arguments and from the first argument makes a new paragraph where the right margin of a box containing the second argument is justified at the left margin of ...
4
votes
4
answers
199
views
Iterating through a list and modifying elements one at a time to construct new list
Long time reader, first time poster.
I have a question about creating a macro that iterates through a list. I've read through some questions posted by other users, but all of those have something to ...
4
votes
1
answer
363
views
\lowering \leaders
I'm using \leaders to make a flexible width rule, with the statement \leaders 0pt plus 1fil\hrule, but I also want to put text above this line. \rlap{text}\leaders works fine, except that the text is ...