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

learn more… | top users | synonyms

18
votes
4answers
544 views

Detect whether running on pdfTeX or Knuth's TeX for conditional include

Does anyone know a way to detect whether one is running in pdfTeX or Knuth's TeX? I want to be able to conditionally include extra features when a document is being built using pdfTex, but also ...
5
votes
0answers
53 views

Can I point Gummi to use TeX instead of LaTeX?

gummi is a great text editor since it has continuous re-fresh. Can I link it to TeX instead of LaTeX? Here is why: Some commands only work with TeX and not LaTeX. me@Lenovo:~/Documents$ latex ...
4
votes
2answers
639 views

IPA characters in plain TeX

Is there a way to type IPA characters in TeX? There is the tipa package for LaTeX, but what about plain TeX? I don't have any experience with installing fonts in TeX and can't find any good resource ...
2
votes
1answer
31 views

Why xdvi does not correct heights from pfb files?

In your working directory: $ tftopl cmr10.tfm > cmr10.pl Change cmr10.pl n order the character A has different width and B has different height: --- cmr10.pl.orig +++ cmr10.pl @@ -466,7 +466,7 ...
2
votes
1answer
32 views

What is the effect of \hsize and \vsize in plain TeX?

I was reading the TeXbook. From the instruction I use \hsize=4in and \vsize=4in in the tex program, and generate the output dvi file. There are several problems. Is the \hsize the horizontal size ...
4
votes
2answers
83 views

How to type Unicode in plain TeX

In plain TeX, \char<int> produces character with decimal code <int>. Similarly, \char'<oct> \char"<hex> produce character with octal code<oct>, and hexadecimal code ...
3
votes
1answer
37 views

How to go for Unicode substitution in plain TeX in the code below?

Backdrop : I am trying to generate some fonts. 1) In an .mf file, I have the following assignments. c_a := ASCII "a"; %%\def\odvowela{a} ...
6
votes
2answers
211 views

Style/macros for outlines in Plain TeX

I'm seeking a style file or other macros for creating an outline in Plain TeX, of the traditional indented style, eg. I. Big Idea A. Sub idea B. Sub idea 1. Thought ...
0
votes
0answers
46 views

How to limit the width of \halign?

The glues inside my \halign rows don't get reduced when they should. The contents of \halign behave as if they had infinite horizontal space. This is the source code for the first table (it's very ...
6
votes
3answers
2k views

Plain TeX vs. LaTeX Macros

I was wondering what's the (advantage) of doing something one way over the other in different systems. For instance, I read that users of plain TEX should use \def whenever they want to create a new ...
3
votes
1answer
47 views

Customize page numbering in plain TeX (not LaTeX)

I would like to change the page numbering from the default 1, 2, ... to the corresponding symbols in my native language. I have the fonts and typesetting ready and just want to replace the page ...
1
vote
2answers
89 views

Tikz curve without control points

Is there a way in Tikz to draw a smooth curve that passes through some specified points without the need of specifying control points, like you can do in Asymptote? For example, in Asymptote I can do ...
4
votes
0answers
88 views

Why cmyk colors are displayed wrong on screen? [closed]

If we compile this with pdftex and open in evince 3.18.2-1 (and other viewers), the color is violet, instead of blue: \pdfliteral{1 1 0 0 k} \vrule height 5cm width 5cm \bye Please somebody share ...
4
votes
1answer
61 views

Reset counter via macro with \ifcase in Plain

I am not able to reset a counter to zero using a macro in Plain TeX. This code uses \ifcase and the counter animalnum to output one of a list of animal names, incrementing the counter each time it is ...
2
votes
1answer
73 views

How to make pdf outlines work correctly in LuaTeX?

cwebmac.tex version 3.67 --- July 2006 The following Lua code converts string from UTF-8 to UTF-16BE with tex.write, which prints all with catcode 12, except space, which is what is needed. We add ...
3
votes
1answer
71 views

How to attach files in LuaTeX in pdf mode?

I have this code to attach files via dvipdfmx, and it works well: \def\attach#1{% \special{pdf:fstream @file (#1)}% \special{pdf:ann bbox 0 0 10 10 <</Type /Annot /Subtype /FileAttachment ...
11
votes
4answers
514 views

How to get old-style ligatures in plain TeX

I would like to typeset text with old-style ligatures like st, ct, is, es etc, but without the use of command sequences, e.g. street or construction instead of \st reet or constru\ct ion in Plain TeX. ...
4
votes
4answers
207 views

How to properly change page offsets?

Suppose that we need to change margins. This cannot be done only by changing \hsize and \vsize, because of the default offset of 1in. There is a possibility to change \hoffset and \voffset directly, ...
13
votes
2answers
698 views

How to input accents in PlainTeX with UTF-8 encoding?

I'm using TeX with the plain format. On my keyboard there is the 'è' character (as well as é, ò, à, ù, ì). I'd like to make it work so that, when put è in the input file, TeX transforms it into \`e, ...
6
votes
1answer
62 views

How is \obeylines different from \obeyspaces?

Let us look at dirty trick #3 in appendix D of TeXbook. The following code produces space of category 12: \def\uncatcodespecials{\def\do##1{\catcode`##1=12 }\dospecials} \def\setupverbatim{\tt ...
1
vote
1answer
50 views

How to separate pdf annotation from the file resource?

Let's suppose that we have an attached file: \immediate\pdfobj stream file {\jobname.tex} \pdfannot width 10pt height 10pt depth 0pt { /Subtype /FileAttachment /FS << /F (file) /Type ...
2
votes
2answers
60 views

How to change character code in Type1 font?

I needed to make spaces at the beginning of line copyable in pdf, and came up with the following trick. In lm-rmtt.enc I change /tilde to /nbspace and then use this code: \font\myfont=rm-lmtt10 ...
4
votes
2answers
68 views

Adding crop marks to legacy document

I have a legacy book written in Plain TeX which contains code that centers the page in A4 paper. I need to add crop marks to these A4 pages at the correct positions for the target book size. I have ...
9
votes
1answer
64 views

Why does unboxing lose margin kerning in pdfTeX?

Consider the following code: \showboxdepth=20 \showboxbreadth=200 \hsize=5.33333in \pdfoutput=0 \pdfprotrudechars=1 \input protcode.tex \setprotcode\tenrm \vbox{\noindent Test. Test. Test. Test. ...
6
votes
2answers
86 views

Prevent \topinsert on chapter page (Plain TeX)

How to define chapter to prevent insertion of floating figures and tables (\topinsert) on chapter page. I would like to place an object at the top of the next page. \def\chap#1{\vfil\break \vglue1cm ...
0
votes
0answers
19 views

Slight variation of plain \topinsert [duplicate]

I would like to use \topinsert for placing figures at the top of the pages. But I don't want to insert figures at the top of the first page of a chapter. So I was thinking about creating a macro ...
3
votes
1answer
41 views

\leaders when at the start of the line

I'm encountering an issue where I have \leaders that occasionally fall at the beginning of the line and as a result, there are no leaders appearing. I have for example: \hsize 9.2cm Lorem ipsum ...
7
votes
1answer
106 views

How can I have my ordinary delimiters come from the same font but 1 pt larger?

This question is general, but arises because I am using Times fonts; in CM, I would not make these changes. In CM, delimiters have a height that is larger than that of a capital letter, whereas in ...
1
vote
1answer
48 views

cross-referencing a list item in OPmac

I need to give a reference to a list item in plain TeX. I have a numbered list with a custom style. \begitems \sdef{item:F}{\bf FP\the\itemnum\kern.25em} \style F * List item 1 * List item 2 ...
1
vote
1answer
53 views

footnote with smaller characters

How can I write a footnote with smaller characters? How can I write a formula in a footnote, with the same character size (fonts) as the main text of the footnote? Example: \footnote{${}^1$}% ...
2
votes
2answers
136 views

Setting font in OPmac or other Plain macros

The OPmac manual explains how to set the font size and discusses the style variations \bf, \it, \em etc. but I do not see a way to set the actual font in use. I'm using XeTeX and would like to access ...
10
votes
1answer
148 views

Question about exercise 23.3 in TeXbook

This is exercise 23.3: Explain how to change the output routine of plain TeX so that it will produce twice as many pages. The material that would ordinarily go on pages 1, 2, 3, etc., should go ...
7
votes
2answers
131 views

Write an \unpar macro

I would like to write an \unpar macro which removes last \par. For example, the TeX code This is a \par \unpar paragraph should be equivalent to This is a paragraph (Note that by equivalent I ...
8
votes
3answers
205 views

Smart macro to produce stanzas

I want to typeset a booklet of poetry, in Plain. Thus far I've been able to make TeX obey spaces and lines with the following code: \def\startline{\par\noindent} \obeylines\obeyspaces ...
10
votes
2answers
131 views

assign penalty to one discretionary (not all paragraph)

For a quite complex problem that would be too long to describe, I need to set different penalties for different discretionaries in the same paragraphe. It doesn't seem to be possible with pdfTeX (and ...
7
votes
3answers
189 views

Macro like `\ignorespaces` for ignoring `\par`s

I would like to have a macro \ignorepars that removes all \pars following it. I wrote the following code: \def\eat{} \def\ignorepars{\futurelet\next\ignoreparsA} ...
3
votes
1answer
47 views

Check for sufficient number of tokens left

I want to use a command that takes a large number of arguments, possibly more than left in the input stream. \def\consumeseven#1#2#3#4#5#6#7{} \consumeseven \space In this scenario \consumeseven ...
1
vote
1answer
36 views

How do I provide a ddot accent in text using the stix-mathsf font within plain TeX?

If I use the font stix-mathsf and try to type H\"o, then the o will have a large inverted breve accent over it (because the position of the character \" is different from most fonts), whereas ...
3
votes
1answer
80 views

superellipse with pdfliterals

I don't know if this is possible, since I know nothing about PDF literals, so can I draw a superellipse with \pdfliterals, and how? I'd like to write a presentation theme for lecturer which draws a ...
3
votes
3answers
258 views

ç doesn't work in \write and \read

In Plain TeX when I do a \write containing ç or Ç in the string it gets expanded generating a lot of code in the output file, which can't be read back. I got this problem when reading a TOC: This is ...
2
votes
2answers
67 views

How to stop a custom \section macro from adding whitespace to the beginning of a paragraph?

I lifted a \section macro from the TeXbook. \outer\def\section#1{\medbreak\noindent{\bf#1}\smallskip\par\nobreak\noindent} When I use this macro like this: \section{\TeX nical documenation} Blah ...
3
votes
1answer
70 views

How can the font Open Baskerville be used with plain TeX?

I downloaded the font Open Baskerville from here, but I don't know how to use it. How can it be loaded in plain TeX? I can use any of tex, pdftex or xetex. (I am using texlive on Linux.)
4
votes
2answers
115 views

Plain TeX end of proof macro

I am writing a macro to typeset proofs of theorems. By getting rid of irrelevant (for this question) things, it simplifies to \def\demo#1\enddemo{\noindent{\it ...
5
votes
3answers
121 views

How to draw a box around something with the dimensions of something else?

I'm using plain TeX and I've lifted a macro \boxed from the TeXbook (where it is called \cstok and slightly different) to put boxes around things in math mode: ...
1
vote
0answers
171 views

Reference of Latex/Plain Tex control sequences [closed]

I'm looking for a reference of the control sequences defined in Latex and plain Tex similar to this one for the build-in primitives. The Texbook states that there are about 600 macros in plain Tex. ...
8
votes
4answers
869 views

Vertically aligned table in plainTeX / LaTeX / Context etc

My last answer about vertically aligned table inspired me to write my first question at this site. How to create the following table in various TeX approaches: plainTeX, LaTeX, Context, eplain, OPmac ...
2
votes
2answers
328 views

Why use plain TeX exclusively and eschew LaTeX2e entirely, nowadays? [duplicate]

I was surprised to learn that some users, as show in this post, stil insist on working exclusively in plain Tex, as opposed to LaTeX. I most certainly understand the benefits of occasionally ...
0
votes
0answers
427 views

Why do some people still use TeX instead of LaTeX? [duplicate]

Possible Duplicate: Reasons to use plain TeX Is it still worth it to learn TeX? I'm utterly curious to know why some people still use TeX instead of full featured LaTeX?
7
votes
2answers
188 views

Editing ligature table

It is suggested in TeXbook (p. 46) that in adapting TeX to type Norwegian, You can arrange the font metric file so that TeX will interpret ae, o/, aa, AE, O/, and AA as ligatures that produce ...
6
votes
2answers
193 views

What's the way to change the size of a math symbol in plain TeX?

I find that \diamondsuit in ntxsy is too small, so I want to define a macro that will enlarge it and take into account the current font size being used. To illustrate below, I have a partial attempted ...