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

learn more… | top users | synonyms

18
votes
4answers
562 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
54 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 ...
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 ...
2
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} ...
2
votes
1answer
32 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 ...
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 ...
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 ...
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
90 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
89 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
74 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 ...
11
votes
4answers
516 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. ...
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 ...
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 ...
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 ...
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. ...
4
votes
2answers
69 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 ...
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
42 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 ...
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$}% ...
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 ...
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 ...
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 ...
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
37 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
3answers
260 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
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
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
116 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: ...
6
votes
2answers
195 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 ...
5
votes
1answer
49 views

Can lineskip depend on how close the boxes are horizontally?

TeX adds lineskip when two lines would get too close together. However, this ought to depend on whether the conflicting boxes in question are near each other horizontally, not just vertically. Is ...
2
votes
1answer
63 views

MathTime Pro 2 with luatex

I'm using Tex Live on Linux (Ubuntu). I have the MathTime Pro 2 (lite version) fonts installed, using the script I found here. I always used them with tex, pdftex or xetex and they worked correctly. ...
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 ...
6
votes
2answers
125 views

Extra interline glue between \vbox'es?

In the following example I use \strut's in both lines, but nevertheless there is gap between the rules. Why there is this gap between two rules? Example 1: \vbox{X\strut\hrule} \vbox{\hrule ...
0
votes
1answer
42 views

How to set the width of last column in \settabs?

The last column in sample line in tabbed alignment is not used for anything. If we use sample line in \settabs, we must put there the widest cell for corresponding column (which may not be the first). ...
1
vote
1answer
30 views

Why vrules are not aligned between rows of tabbed alignment?

How to make \vrules aligned against each other in the following example? Why the sample line after \settabs does not work as needed? \magnification=\magstep5 \nopagenumbers \font\ttl=rm-lmtl10 ...
1
vote
0answers
56 views

Asymptote in plain TeX [closed]

Is there a way to directly embed Asymptote code in plain TeX as it can be done in LaTeX? (For example by using miniltx or something like that?) Can labels in figures be typeset using plain TeX instead ...
3
votes
0answers
55 views

Why zero lccode does not stop hyphenation in LuaTeX?

Compile the following example with tex and luatex: \nopagenumbers \parindent=0pt \parskip=0pt \def\par{\endgraf\hbox to 15em{\hrulefill}} \hsize=1pt \hfuzz=15em 1 'supercalifragilisticexpialidocious ...
7
votes
2answers
161 views

Problem in a macro definition (plain TeX)

I'm trying to write a \multicenter macro that acts as \centerline, except that it splits the text in different lines whenever it encounters the command \\. For example, \multicenter{ciao\\a\\tutti!} ...
5
votes
1answer
81 views

How to put characters between every paragraph

I'd like plain TeX (pdftex) to put a specific sequence of characters between every paragraph of its output. For example: Original text might be: This is paragraph 1. This is paragraph 2. This ...
4
votes
4answers
208 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, ...
8
votes
1answer
168 views

How does \halign differ from \hfil?

Suppose we have three blocks of text aligned horizontally. Why Example 1 differs from Example 2 and what should be changed in the latter to make it look like the former? NOTE: I added rules just to ...
4
votes
1answer
245 views

What is the purpose of \raggedright?

I thought that \raggedright is used to get text: 1) not exceeding certain width, 2) with natural interword spaces, 3) without hyphenation. But it turns out that hyphenation is done with \raggedright. ...
4
votes
1answer
116 views

Why is \leftskip glue not automatically inserted?

TeXbook says (page 100): TeX has two parameters called \leftskip and \rightskip that specify glue to be inserted at the left and right of every line in a paragraph ... Consider this example: ...
3
votes
1answer
65 views

How do I type a brace-enclosed, numbered equations in plain TeX?

Basicly it looks like: I tried \eqalign, but it cannot have equation numbers on the right. I also tried \eqalignno, but it cannot have a brace on the left.