Questions tagged [plain-tex]

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

Filter by
Sorted by
Tagged with
2 votes
1 answer
51 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
99 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,454
3 votes
2 answers
132 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 ...
richardIII's user avatar
2 votes
1 answer
105 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
  • 761
3 votes
2 answers
153 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
  • 761
3 votes
2 answers
202 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
120 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
40 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
  • 1,865
3 votes
2 answers
415 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
  • 1,865
3 votes
2 answers
497 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
  • 1,865
1 vote
0 answers
68 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
119 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
  • 30.8k
4 votes
1 answer
288 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
113 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
63 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
  • 279
4 votes
1 answer
119 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
141 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
64 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
253 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
  • 274
1 vote
0 answers
107 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
4 votes
2 answers
548 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
  • 143
2 votes
1 answer
162 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
3 votes
1 answer
57 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
  • 623
6 votes
2 answers
101 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
  • 623
1 vote
1 answer
87 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
  • 623
1 vote
1 answer
113 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
519 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
  • 3,434
6 votes
1 answer
106 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
164 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
6 votes
3 answers
341 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
138 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
57 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
56 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
68 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
87 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
4 votes
3 answers
343 views

Is there a book explicitly about TeX programming?

I'd like to learn basic TeX programming (as a programming language instead of a tool of typeset) systematically, but I find "the Tex Book" by Knuth spends much time on typeset matter. Is ...
OrthoPole's user avatar
  • 113
4 votes
1 answer
226 views

Defining a vskip that possibly becomes vfill

I hope this is not a duplicate; I tried to search around and didn't find anything, but perhaps I used the wrong keywords. I'm using Plain TeX and have the following defined: \newskip\hugeskipamount \...
marcelgoh's user avatar
  • 231
5 votes
2 answers
172 views

Section title inside the indentation of a par in plain TeX

I am trying to reproduce in plain TeX the following section style (that is placing text inside the indent of a paragraph): Here is what I have done so far: \font\rm=ecrm10 \font\bf=ecbx10 \rm \llap{\...
user avatar
1 vote
1 answer
102 views

Set AMS Euler as the default maths font (XeTeX)

I am trying to use the AMS Euler fonts in my plain XeTeX document, and by taking inspiration from various sources online (including Knuth's macros for Concrete Mathematics), I thought the following ...
user avatar
4 votes
2 answers
224 views

How to fix this simple verbatim macro (plain TeX)?

I have written a simple macro to typeset everything enclosed in angle brackets with a special font and to ignore the backslash character. \catcode`\>=\active \def>{\endgroup} \catcode`\<=\...
user avatar
3 votes
2 answers
178 views

How can I create a plain TeX macro that performs differently depending on whether or not it is called from within an \item?

I'd like to create a macro that behaves differently depending on whether or not it is called from within an \item, such as \def\mymacro{\if<INSIDE_ITEM> do this \else do that\fi} Here is an ...
Ruy's user avatar
  • 183
6 votes
2 answers
138 views

Why should I not use EC fonts with XeTeX?

In the comments on a question I asked earlier today How to define \sc in TeX?, two users said it is not a good idea to use the ec fonts with plain XeTeX. I am curious to know why since I have been ...
user989070's user avatar
6 votes
1 answer
381 views

How to define \sc in TeX?

Taking inspiration from the TeXbook (page 350) I defined: \font\tensc=eccc1000 \font\twelvesc=eccc1200 For example, the following works as expected: \font\tensc=eccc1000 \centerline{Donald {\tensc ...
user989070's user avatar
3 votes
1 answer
119 views

Better interactive TeX shell

I'm using the command-line interactive TeX shell on Linux, accessible via the tex command (Artix, package texlive-bin 2022.62885-3, available at https://tug.org/texlive). I've found it a very helpful ...
Wilson's user avatar
  • 35
0 votes
1 answer
108 views

Is it possible to redefine a macro's parameter?

I would like to redefine a macro parameter. This is what I have tried so far: \def#1{$#1$} But it throws this nasty error that I don't know how to fix. ! Missing control sequence inserted. <...
CATboardBETA's user avatar
0 votes
1 answer
92 views

hfill using any characters

Not that I badly need this but I thought it could be useful to have: What would be an efficient code for a command like \hfillwith such that, say, \hfillwith{bla} would output blablablablabla... from ...
მამუკა ჯიბლაძე's user avatar
2 votes
2 answers
100 views

Why do these macros not evaluate to the same so that \ifx is true?

I have a document with paragraphs that were transcribed from an interview. Each of the paragraphs is from one author, alternating. Starting with "Author 1" I want to add the author name in ...
Fabian Schneider's user avatar
1 vote
2 answers
118 views

Error while running code

Below my code that I am trying to run. I am getting multiple errors, such as ! Undefined control sequence. \input pictex\magnification and ! I can't find file `pictex=1200'.<to be read again>\...
quant's user avatar
  • 11
1 vote
1 answer
183 views

What TeX engine is recommended?

I am a very long-time user of TeXtures, publishing multiple books using PlainTex (figures in Adobe Illustrator) with TeXtures. Since TeXtures will no longer work with Macs (I'm currently using ...
David Kreps's user avatar

1
2 3 4 5
18