Questions tagged [plain-tex]

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

Filter by
Sorted by
Tagged with
3 votes
0 answers
80 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
78 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\...
0 votes
0 answers
50 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
25 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 ...
  • 11
2 votes
2 answers
86 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 ...
  • 151
1 vote
2 answers
65 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
40 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 ...
  • 3,327
1 vote
1 answer
49 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 ...
  • 113
2 votes
2 answers
80 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\@...
  • 545
3 votes
1 answer
147 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....
  • 545
1 vote
2 answers
58 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 \...
  • 135
0 votes
3 answers
55 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 ...
  • 1
2 votes
1 answer
48 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 ...
  • 237
0 votes
2 answers
43 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
659 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 ...
  • 1,728
2 votes
1 answer
55 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 ...
  • 69
1 vote
1 answer
51 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
188 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 ...
  • 545
0 votes
3 answers
67 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
128 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\...
  • 9,348
1 vote
0 answers
53 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,639
2 votes
1 answer
260 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’. ...
  • 449
2 votes
2 answers
114 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
0 answers
23 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
41 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 ...
  • 2,639
3 votes
2 answers
177 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 ...
  • 531
3 votes
1 answer
145 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 \...
  • 449
0 votes
0 answers
92 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 ...
  • 1
4 votes
2 answers
109 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 ...
user avatar
1 vote
1 answer
48 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 ...
4 votes
2 answers
278 views

How to define a math bold font in Plain TeX?

Consider the following code: \font\rm=ecrm1000\rm \font\bf=ecbx1000 R{\bf R} $R{\bf R}$ \bye The result I get is RR RR. However I was expecting RR RR Why the second R in the math formula not ...
user avatar
-4 votes
3 answers
203 views

Left \mapsto arrow

I am looking for a way to make a command for left version of \mapsto arrow with (AMS)TeX . This is what I tried to do: \mathchardef\mapstochar="322F \def\leftmapsto{\leftarrow\mapstochar} \def\...
  • 215
4 votes
1 answer
131 views

Is this way of defining \section in Plain TeX correct?

I am relatively new to Plain TEX and I wanted to define a \section command to typeset a bold and centered text with some spacing around it. Here is what I came up with. \def\section#1{\bigbreak\...
user avatar
0 votes
0 answers
68 views

Why doesn't \hfil work to right align?

I don't understand why {\bf Title}\hfil A.\ Uthor \bye and {\bf Title}\hfill A.\ Uthor \bye do not give the same result. Only \hfill works to right align text but there is not other infinity, I ...
user avatar
1 vote
1 answer
74 views

Upper-case programmatic data with expl3 in TeX Live 2019

I use the following expl3 code to upper-case the first character of a programmatic string. The code is from the body of a control sequence definition and is not supposed to be fully expandable. \...
  • 1,089
0 votes
1 answer
54 views

Breaking lines of TikZ pictures

Doing a lot of pictures sequentially with TikZ, I would like a break line behavior, resulting in more uniform lines. But I couldn't. \input{tikz} \def\maxangle{30} \pgfmathsetseed{7} \foreach \...
0 votes
0 answers
55 views

How to use plain XeTeX for emoji and words of non-English alphabet?

I am trying to create documents with emojis and words of non-English alphabet (Farsi, Chinese, Korean etc), but I heard that plain TeX does not support this, but plain XeTeX does offer support. ...
  • 359
2 votes
1 answer
92 views

Plain TeX input Tikz package not found

I ran \input tikz.tex \bye and the Tikz package is not found This is pdfTeX, Version 3.141592653-2.6-1.40.22 (TeX Live 2021/MacPorts 2021.58693_2) (preloaded format=pdftex) restricted \write18 ...
  • 359
3 votes
1 answer
64 views

Why do log files show only the first letter of a word?

If I create hello.tex thus: \tracingcommands 1 Hello world then hello.log contains This is TeX, [etc] **hello.tex (./hello.tex {vertical mode: the letter H} {horizontal mode: the letter H} {blank ...
3 votes
2 answers
103 views

Bad positioning of slanted (italic) math accents

The math accents are usually taken from textfonts (only \vec from the math italic font). I would like to have an italic accent over an italic letter also in math mode. To present the problem quickly I ...
1 vote
1 answer
52 views

Question about TeXBook Exercise 8.6

In exercise 8.6 the characters ^^A, ^^B, ^^C, ^^M are defined to belong to categories 0, 7, 10, and 11 respectively. The question ist what tokens are produced from the input line ‘^^B^^BM^^A^^B^^C^^M^^...
  • 69
0 votes
1 answer
55 views

How to AMSTeX in TeXMaker

I am trying to TeX the following on texmaker in linux, however I'm running into errors, mainly for the first line. However I have pictex already downloaded. I used the default Quick Build in texmaker. ...
user avatar
2 votes
2 answers
100 views

Line numbers for Optex

I tried to run this answer (using edmac) with optex but it failed. I know that Optex has the \ttline macro, but still couldn't find out how to number text lines. I started creating a simple macro that ...
3 votes
1 answer
88 views

Modify footnote properties in optex

How do I modify the behavior of the footnote line and text with optex? I'd like to change the width and height of the rule, and the footnotes to hang thus: ¹ Text text text text text text text ...
3 votes
1 answer
137 views

macros from plain TeX fail to work in xelatex

I find some macros from plain TeX fail to work in XeLaTeX. The following MWE for example. Why? \documentclass[a4paper]{article} \usepackage{geometry} \geometry{showframe} \geometry{left=1cm,right=1cm,...
  • 2,619
0 votes
1 answer
44 views

Change rules for spacing in formulas

The following note is given in Donald Knuth 's TeXbook (page 170): How can I change these rules? More specifically, I am interested in changing the Punct line from (1) (1) * (1) ... to 1 1 * 1 .... ...
3 votes
2 answers
98 views

Detect end of \input-file (not \read-file) in Knuthian TeX?

In Knuthian-TeX I'd like to have a macro which switches to verbatim-category-code-régime and then calls another macro which processes characters from the current input-file one by one until reaching ...
5 votes
3 answers
168 views

Testing "sequentiality" of \expandafter (plain Tex) - weird results

Trying to have a better understanding/controlling over \expandafter, I wrote this code. \count100 = 0 \count101 = 1 \def\c{% \the \count100 \advance \count100 by \count101\relax}% % \everypar{\...
1 vote
1 answer
53 views

What is causing punctuation to appear around my matrices?

I have an input file called mathchar.tex, which I rely on pretty heavily: \mathchardef\Gamma="7400 \mathchardef\Delta="7401 \mathchardef\Theta="7402 \mathchardef\Lambda="7403 \...
  • 257
3 votes
1 answer
144 views

why is latex's ltluatex.sty required for plain luaotfload?

I tried (successfully) to compile a sober Plain LuaTeX format and discovered, with some surprise, that loading the standard luaotfloader in Plain requires a piece of code, ltluatex.tex which requires ...
  • 4,003

1
2 3 4 5
16