Skip to main content

Questions tagged [plain-tex]

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

Filter by
Sorted by
Tagged with
2 votes
2 answers
123 views

Rescaling Kp-fonts in plain tex

I am using Kp-fonts in a plain tex (not LaTeX) document. I invoke them with the line: \input kp-fonts They work fine at the default size. But in some cases I would like to rescale these. So I type, ...
WillO's user avatar
  • 301
0 votes
0 answers
62 views

How to link URL without using packages (in Lua(La)TeX)?

How could I link a URL without using any packages (i.e. either in plain TeX or using Lua(La)TeX)? I am compiling with Lua(La)TeX.
fsr_j's user avatar
  • 75
11 votes
1 answer
1k views

Why Donald E. Knuth used obeylines + gdef instead of def

I am trying to understand Knuth's manmac.tex. At line 436 you can find the following code: \newwrite\ans \immediate\openout\ans=answers % file for answers to exercises \outer\def\answer{\par\medbreak ...
Alexey Ismagilov's user avatar
1 vote
2 answers
90 views

Macro copy, add/remove last token

Suppose I have a macro with only argument that has such a structure \def\foo#1{% {\textbf{#1}}{aaa}{bbb} } I need to create two copies: \bar that is \foo but withouot the last token: \...
antshar's user avatar
  • 4,632
8 votes
3 answers
388 views

How do I change the page size for a pdf-file generated by plain-TeX?

Situation, probably known I know the pdf-page-size can be changed in LaTeX using package geometry. But how to do it in plain-TeX? E.g. changing page related parameters, like \vsize or \hoffset, do ...
MS-SPO's user avatar
  • 13.7k
1 vote
1 answer
72 views

'Sub-commands' within an environment [closed]

I'm not sure if there's better terminology for this, but how does one create 'sub-commands' within an environment (preferably in plain TeX)? An example is the itemize environment, where \item is the '...
fsr_j's user avatar
  • 75
6 votes
3 answers
395 views

\phantom and \obeylines

I'm using Plain TeX (actually XeTeX for font reasons but I am using it basically like it's Plain, which I'm used to). I'm typing a poem up for someone and i want to create an effect along the lines of ...
marcelgoh's user avatar
  • 305
0 votes
0 answers
57 views

How to create hyperlinks in Plain TeX that points to exact positions of labels in another file?

Problem Cross-file hyperlinks always bring me the first page of another file, while I expect the links to bring me to the exact label position (or text) in the target file. Reproduction Steps ...
zacque's user avatar
  • 101
4 votes
1 answer
79 views

Forbidden control sequence found (newtoks)

I'm trying to convert some LaTeX macros from xespotcolor to Plain TeX, to be able to use a single spot color in my Plain TeX document. I managed to extract several macros, but I'm stuck on \def\...
Marcel Korpel's user avatar
2 votes
1 answer
60 views

Trying to align boxes with variable sizes

I'm trying to align some boxes, but having difficulty understanding why what I have isn't working and what I can do to get the desired effect with box primitives. I want x the quick brown fox ...
velve's user avatar
  • 35
1 vote
1 answer
76 views

Why does `\the\le` typeset `12820`?

TeX primitives reference says that the primivite \the can typeset a parameter value (integer, dimen, glue, or muglue) or internal quantity (except \font) produce a copy of the token list for a token ...
user615536's user avatar
1 vote
1 answer
67 views

Graphics changing alignment in second vbox

I am trying to top-align text next to a bare image in PlainTeX/OpTeX, using the idiom: \hbox to \hsize { \vtop{\hsize=... ...} \hskip... \vtop{\hsize=... ...}} And this seems to work well ...
Michal_Atlas's user avatar
1 vote
1 answer
74 views

Footnotes and subfootnotes in plain TeX

I've set myself a masochistic project: I'm trying to typeset (and then translate) Martin Wolf's 1906 doctoral dissertation (Google Books, HathiTrust) in plain TeX. (I chose plain TeX because I don't ...
Quuxplusone's user avatar
4 votes
2 answers
491 views

Is my method of practicing Knuth’s book good/correct?

I seek recommendations on how to approach learning Plain Tex. I am just starting my journey with TeX using Knuth’s reference The TeXbook. I Installed TeXlive 3.14 and use the command prompt to run Tex....
ِMars's user avatar
  • 43
2 votes
1 answer
59 views

Does \alloc@ change \allocationnumber globally?

I'm reading through plain.tex. This is the definition of \alloc@: \def\alloc@#1#2#3#4#5{\global\advance\count1#1 by 1 \ch@ck#1#4#2% make sure there’s still room \allocationnumber=\count1#1 \global#3#5=...
Marnanel Thurman's user avatar
1 vote
2 answers
166 views

How use cyrillic language support in plain Xe/luaTeX?

Unfortunately, I've never used plain TeX so I have no idea how to use the language support in that format. How to connect babel for plain Xe/luaTeX (not Xe/LuaLaTeX)? More specifically, I am ...
sergiokapone's user avatar
  • 5,598
3 votes
2 answers
152 views

Non-breaking hyphen in Plain TeX

I am asking the same question as this post: How to type a non-breaking hyphen (dash, "-" character) in scientific or technical documents but I don't want to use any package (just to ...
user avatar
2 votes
1 answer
114 views

Newline delimited macro arguments

Is it possible to define a macro, which takes newline delimited arguments? \def\triple#1#2#3{(#1,#2,#3)} Instead of this: \triple {First} {Second} {Third} lorem ipsum I would like to be able to ...
ceving's user avatar
  • 771
3 votes
2 answers
160 views

How can I use a halign in a macro definition?

I tried this: \def\Anschrift#1#2#3#4#5#6{\vbox to27.3mm{ \rmx\baselineskip=13pt \vfill \halign to8cm{#\hfil\cr #1\cr #2\cr #3\cr #4\cr #5\cr #6\cr}% \vfill \vss}\...
ceving's user avatar
  • 771
3 votes
2 answers
209 views

A simple UTF-8 adaption partially works in Knuth's TeX and do nothing in LuaTeX

Once more time I am (frustratingly losing time: true joke!) trying to use better TeX primitives. The next snippet doesn't work as expected in Knuth's Tex. The lower case version simply swallow the ...
Daniel Bandeira's user avatar
2 votes
1 answer
159 views

Space before italicized words

This may have an answer somewhere else, I have not found any. I apologize if it is a duplicate. The TeXBook recommends to add \/ after italicized words in order to adjust the spacing with roman text ...
Gibbs's user avatar
  • 143
0 votes
0 answers
43 views

Why does '\string' convert '\' to "? [duplicate]

On page 40 of the TeXbook, it says, \string\cs will produce tokens to be calssied to 12. But \string\TeX will produce `"TeX" as I once thought that the result should be \TeX. Why is there &...
Y. zeng's user avatar
  • 2,105
3 votes
2 answers
431 views

Is "plain.fmt" equal "plain.tex" in TeX?

When tex was input in terminal, there is preloaded format=tex. Is preloaded format=tex equal plain.tex? When input &plain \input story after the tex command, there is Sorry, I can't find the ...
Y. zeng's user avatar
  • 2,105
3 votes
2 answers
527 views

Get upright italic fonts in TeX

I can get italic fonts in TeX by \it command, but I see there is upright italic font on page 13 of the book The TeXbook. How did the author achieve this style? See the words while the letters in ...
Y. zeng's user avatar
  • 2,105
1 vote
0 answers
77 views

How to use my own format together with the plain format in Texpad

I managed to create a format file using \dump, but how do I set TeXpad to recognize it? I would like to use TeXpad. I always use the plain format, and TeXpad is heavy on LaTeX; it can run plain, but I ...
David Salomon's user avatar
5 votes
1 answer
125 views

Why does a \catcode-changed underscore work in math mode also without \mathcode set to "8000?

Something is puzzling me... consider %\begingroup %\catcode`\_=13 %\gdef_{\sb} %\endgroup \catcode`\_=11 \def\foo_bar{Foo bar} \foo_bar\ $a_b$ \bye Uncommenting the commented code yields (One can ...
campa's user avatar
  • 31.8k
4 votes
1 answer
298 views

French spacing in plain tex / optex

I've seen the answer here for Latex. How can I adapt this to plain TeX or OPTeX? \frlang \fontfam[Times] { \catcode`\:=\active \catcode`\;=\active \catcode`\?=\active \catcode`\!=\...
user574859's user avatar
1 vote
1 answer
122 views

How do I add quotation marks at the beginning of every line of a paragraph?

I am trying to do the same thing as what was asked in this question: Quotation mark at the beginning of each line of a paragraph, that is: Pieri uses an old style of quotation, where if the quote ...
user avatar
1 vote
1 answer
69 views

footnote from within halign

How do you create a footnote within an halign in plain TeX? The code below produces a line that looks like this: A B C2 which is as it should be, but the footnote reading ``How is this?'' simply ...
WillO's user avatar
  • 301
4 votes
1 answer
127 views

Vertical dashed lines (inside and outside of tables) in PlainTex / OpTex

Taking an idea from this question, what if I want to make a vertical dashed line in PlainTex or (preferably) Optex? I know I can use \dotfill in the text (horizontally), but how can I use it ...
user574859's user avatar
3 votes
2 answers
163 views

How to add a squiggle in the margin next to a paragraph in Plain TeX?

I am trying to reproduce the following in Plain (Xe)TeX (with more oscillations if possible): That is to add a squiggle in the margin next to a given paragraph. I was thinking of the following API: \...
user avatar
0 votes
1 answer
73 views

How do I access more sizes of TeX Gyre Schola in Plain TeX?

I am using the following line of (Xe)TeX code to include the TeX Gyre Schola font: \input cs-schola It works well with the \bf, \it, etc. commands but none of \ninerm, \small and \footnotesize are ...
user avatar
6 votes
1 answer
258 views

How to combine uparrow and sim in Plain TeX?

I am trying to produce the following symbol with Plain (Xe)TeX: I have tried some text $\uparrow\llap{$\sim$}$ some text but the spacing is wrong and \sim is not centered.
user avatar
8 votes
2 answers
2k views

Why do curly braces break this loop?

I was trying to solve 'Exercise 20.20' from the TeX Book which asks to create a macro \punishment capable of repeating a given sentence n times using the Plain TeX format. My first attempt was the ...
HomoVafer's user avatar
  • 294
1 vote
0 answers
140 views

How to increase line spacing in Plain TeX?

I want to increase the line spacing of my Plain TeX document (I use the XeTeX engine). Is setting \baselineskip=1.2\baselineskip enough or should I also update \lineskip and \lineskiplimit or other ...
user avatar
5 votes
3 answers
574 views

German opening (lower) quotation mark in plain TeX

Is there a good way to get the German opening (lower) quotation mark „ in plain TeX?
Thomas's user avatar
  • 153
2 votes
1 answer
168 views

Undefining/redefining already defined commands within expl3

I am not sure about the forum protocol regarding when to ask a new question and when to lump it in with an existing one, so I apologize if this is unorthodox. The question stems from ! Missing \...
Mike Pugh's user avatar
  • 319
3 votes
1 answer
61 views

Why does space matter while error-handling in plain TeX?

Following Chapter 6 of The TeXbook, I analyze the errors in the story.tex file containing \errorcontextlines=0 in the beginning, and an erroneous control sequence: \centerline{\bf A SHORT \ERROR STORY}...
Atom's user avatar
  • 665
6 votes
2 answers
108 views

Why overfull in terms of pts and underfull in terms of badness?

I am reading Knuth's The TeXbook, and experimenting around as directed in Chapter 6, I found that the quality of overfull warnings is reported by x pt too wide where x is a decimal; whereas, that of ...
Atom's user avatar
  • 665
1 vote
1 answer
90 views

Is italic correction different in different fonts?

I am reading Knuth's The TeXbook and in Chapter 4, he talks about italic correction \/. He always uses it in the scope of the preceding font, for instance: {\sl slanted\/} words {\it italics\/} for `{...
Atom's user avatar
  • 665
1 vote
1 answer
133 views

Plain TeX Image Workaround For Lab Manuals

I am working on importing physics lab manuals that were written in TeX to Overleaf so that our faculty can collaborate and update the content. Everything is working flawlessly, except for inserting ...
eagleradioastro's user avatar
8 votes
2 answers
527 views

TeXbook Exercise 14.32

In the end of Chapter14 of TeXbook, there is a macro called \signed: \def\signed #1 (#2){{\unskip\nobreak\hfil\penalty50 \hskip2em\hbox{}\nobreak\hfil\sl#1\/ \rm(#2) \parfillskip=0pt \...
Stephen's user avatar
  • 4,454
6 votes
1 answer
111 views

Number direction in Arabic using (plain) Luatex

Following the question here, I managed to write in Arabic using Luatex (plain/Optex), but all numbers are also written from the right to the left (and in Western numbers, not Arabic). It seems that ...
user574859's user avatar
2 votes
1 answer
192 views

Automatic vertical skip in margin notes in Optex

The image below shows the result for the second page of the following code: \fontfam[Myriad] \margins/2 a4 (2,6,2,2)cm \mnotesize=4.5cm \newcount\notenum %\fixmnotes\right \def\note#1{\global\...
user574859's user avatar
7 votes
3 answers
376 views

Increase letter spacing in plain TeX

I want to typeset the titles of the sections of my document in capitals, so I need to increase the spacing between the letters. I am currently using the following (ugly) trick \begingroup \catcode`/=...
user avatar
3 votes
2 answers
143 views

How do I put the hyphens in the margin in plain TeX?

I want to typeset the hyphens in the margin using plain TeX (I'm using the XeTeX engine, if that's important to you). For example: Lorem ipsum dolor sit amet, consecte- tuer adipiscing elit. Aenean ...
user avatar
1 vote
0 answers
60 views

Endnotes on same line in PlainTex/Optex by chapter

Both answers here and here provide solutions for endnotes in plain/optex. However, the latter solution cannot restart every chapter, whereas the former aren't sequential/one-line. Is there any way to ...
user574859's user avatar
3 votes
1 answer
58 views

Parameter text getter

To this snippet \def\arg#1#2{\#1 = #1 and \#2 = #2\par} \arg A B C \end I supposed the output like this one #1 = A and #2 = B C But I get (using PDFTeX) #1 = A and #2 = B C . Why such behavior? I ...
Daniel Bandeira's user avatar
2 votes
1 answer
76 views

Centering images in Plain TeX when using pdftex

An earlier post How to handle figures and images using MikTeX Plain TeX (not LaTeX) on a 35 year old document (that I am not allowed to comment on) suggested this simple solution. (I also am working ...
PaulVirtual's user avatar
5 votes
1 answer
100 views

How does \afterassignment work? [duplicate]

I've found the following code in another question: \def\scan#1{\scanA#1*} \def\scanA{\futurelet\next\scanB} \def\scanB{\expandafter\ifx\next\space \expandafter\scanC \else \expandafter\scanE \fi} \def\...
OrthoPole's user avatar
  • 113

1
2 3 4 5
18