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

learn more… | top users | synonyms

35
votes
1answer
4k views

\setbox vs. \sbox and \savebox - What are the differences I need to know about?

What's the difference between using TeX's \setbox and LaTeX's \sbox and \savebox?
6
votes
1answer
2k views

“Missing \cr inserted”, but it looks to me like it's already there!

I'm trying to create a Plain TeX macro for typesetting two-column proofs with automatic step-numbering and step cross-referencing; currently, the "best" I have is: \newcount\stepno \def\twocols#1{% ...
7
votes
2answers
392 views

Syntax Highlighting for Plain TeX

I would like to find out what options there are for applying syntax highlighting to Plain TeX, to turn Plain TeX documents into highlighted HTML. The aim is to facilitate sharing tracked changes to ...
4
votes
1answer
240 views

how can I break the rows of an halign nicely across pages?

I'm trying to print large tables for my own consumption (I'm using Plain TeX and eplain). They are tables of publications and I just want to be able to look at them. Each table will have a variable ...
2
votes
1answer
116 views

gensym for TeX?

In other macro systems (notably Lisp's), one often needs to store results into "temporary" variables which shouldn't clash with any variables in the environment where the macro is called. In Lisp, the ...
6
votes
3answers
401 views

Retrieve the current font, scale it, and change the font to that version

I'm using Plain TeX (and eplain, if that matters). I would like to be able to generically scale the current font, no matter how the current font has been set. For example, I want to write a macro ...
10
votes
2answers
693 views

Can TeX/LaTeX draw lines at precise positions?

I need to draw lines at specific distances (in mm). For example: ---- line 0 ---- line 1 at 35.64 mm below line 0 ---- line 2 at 33.64 mm below line 1 The macro I'm using is as follows (I don't ...
9
votes
2answers
593 views

overstruck \diamond and plus in plain TeX?

I need a character in plain TeX that combines a plus with a quadrilateral whose corners are the four endpoints of the plus. Is there a way to create such a thing? I apologize for editing the ...
5
votes
1answer
238 views

PGF align plain TeX

I don't get the excepted result with the following code \input tikz \tikzpicture \node[draw,align=center] {Hello \hfil\break World}; \endtikzpicture \bye There is no break after Hello. I don't ...
2
votes
1answer
183 views

Why does tikz change the behavior of \vfil on my first page?

Note the way this renders when using pdftex. \input eplain \beginpackages \usepackage{url} \usepackage{color} \endpackages % comment in the following 4 lines % \input tikz % \enablehyperlinks % ...
8
votes
1answer
677 views

Can \usepackage{color} and \input tikz work together in Plain TeX/eplain?

I use Plain TeX and Eplain. In my document I'm using both the color and url packages inside the \beginpackages..\endpackages block. Just now I tried adding \input tikz.tex (as the TikZ manual states) ...
5
votes
3answers
945 views

Why does TeX not like \usepackage?

My prof writes papers with harvmac, which is apparently incompatible with LaTeX. Fine, I switch to tex. Now TeX gives me Undefined control sequence when I type \usepackage{amsmath}. There's gotta ...
11
votes
2answers
693 views

Background baseline grid with output routine

I am trying to get a baseline grid in the background of every page. I am using the plain format with XeTeX. This is what I have tried: \baselineskip=13pt \topskip=0pt \parskip=0pt \newbox\gridbox ...
4
votes
1answer
167 views

TeX4ht and Plain TeX

According to tug.org TeX4ht can be used with Plain TeX. I've tried the commands listed in the site above, but nothing works! All I can have is a simple text file, with .html extension, but without any ...
5
votes
1answer
353 views

Loading fonts in LuaTeX (plain TeX)

I am trying to understand how fonts work with (plain) LuaTeX. I use the standard ConTeXt suite, and I made a luatex-plain format using the file luatex-plain.tex from the distribution: luatex --ini ...
2
votes
1answer
186 views

Can I write a macro for placing a vertical, breakable rule along arbitrary paragraphs without an output routine?

I answered a question last week about creating a continuous but breakable rule next to an arbitrary number of paragraphs in Plain TeX. My solution gathered the paragraphs to rule in a vbox; my output ...
6
votes
3answers
460 views

Controlling text overflow when using \hfill to left- and right-align parts of title

I’m creating a template in plain (Xe)TeX which must have, in the first line, a location and reference number. The location is left-aligned and the reference number is right-aligned. (See example 1, ...
9
votes
1answer
124 views

Why does the list of recent contributions contain exactly two boxes?

In the transcript of \nonstopmode \tenrm \vsize=2cm \output={\shipout\vbox{ \showlists \unvbox255 }} \hbox{blah} \hbox{blah} \hbox{blah} \hbox{blah} \hbox{blah} \hbox{blah} \hbox{blah} ...
5
votes
1answer
117 views

Read manuscript in to output

I want to put my source plain TeX file in the output of the same plain TeX file. As I remember coming through a macro, that can put a file's content in to the output, but only \input comes to mind. ...
3
votes
1answer
322 views

Loading a math font with stylistic set in plain XeTeX

How does one activate a stylistic set in plain XeTeX? I have tried: \font\test="XITS Math:+ss01" % for calligraphic \textfont2=\test $ \fam2 A $ \bye but with no luck.
4
votes
2answers
180 views

How can I get interline spacing to ignore a vbox? [duplicate]

Possible Duplicate: Make an invisible vbox I want to insert a \vbox between paragraphs, but I do not want it to affect interline spacing. I'm using Plain TeX. Here is my MWE: \input plain ...
14
votes
4answers
1k views

Conversion pt to mm or cm

Is there any way how to convert pt to mm or cm in plain TeX?
19
votes
3answers
1k views

How to make continuous (but breakable) vertical rule along left side of paragraph?

I'm looking for a way in Plain TeX to make a continuous vertical rule along the left side of a paragraph (or arbitrary block of text), such that it observes normal page-break rules. I started with the ...
5
votes
3answers
1k 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 ...
6
votes
2answers
202 views

Toggling Phantom In Macros (plain TeX)

I am using plain TeX / pdfTeX. Is there a way to build a set of macros, say \showOn / \showOff, such that I can nest them for a given piece of text, it "looks up the parse tree", find the first ...
4
votes
1answer
136 views

What's special about \def\\ vs. \def\mksp?

In the following definitions, \\ captures a space token but \mksp does not. \documentclass{article} \begin{document} {\def\\{\global\let\sp= } \\ } {\def\mksp{\global\let\spx= } \mksp } \show\sp ...
20
votes
2answers
1k views

The mysteries of \mathpalette

I would like to make a macro, \vfrac, which output would look like: $$\displaylines{ \displaystyle\raise.25ex\hbox{$\displaystyle1$}\!/\!\lower.5ex\hbox{$\displaystyle2$} \cr ...
6
votes
2answers
176 views

Executing TeX commands s.t. (1) produces empty boxes (2) and no other output

EDIT: I need plain TeX, not LaTeX. Furthermore, I don't want to use an existing package -- I want to reinvent the wheel. [This is part of a complicated set of TeX macros I have set up; and I need to ...
8
votes
4answers
272 views

Subscript sizing of text in math formulas

I am using Plain TeX, not LaTeX. Right now, I have \def\text#1{\hbox{#1}} This works for things like $$A + \text{foo bar}$$. However, not for things like: $$\Sum_{ \text{foo} = a}$$. How do ...
16
votes
1answer
249 views

Why are \new… defined as \outer in the plain TeX format?

In plain.tex, D.E.Knuth decided to define as \outer all the macros which allocate registers: \newcount, \newdimen, \newskip, \newread, \newwrite. This forbids them from entering the argument of ...
5
votes
1answer
745 views

Producing arXiv-submittable documents with figures using plain TeX

I am proficient with TeX but have never used LaTeX and would prefer not to learn it - though perhaps that preference is the sole source of my difficulties. I am trying to figure out how to produce ...
3
votes
1answer
271 views

Create my own NSD

I'm trying to create a set of macro-s for plain [Xe]TeX to be able to create Nassi-Shneidermann Diagrams that produces a table (\halign). (I would note the cases slant lines differently in a way, that ...
16
votes
1answer
271 views

What does `\ ` exactly do?

In the The Not So Short Introduction to LATEX2e - Version 5.01, April 06, 2011 it is suggested that: A backslash in front of a space generates a space that will not be enlarged. (page 39) It ...
4
votes
1answer
1k views

How do I change font in pgfplots with plain XeTeX?

I have tried: \font\figfn="Myriad Pro:mapping=tex-text" at 8pt \input tikz \tikzset{font=\figfn} \input pgfplots \pgfplotsset{ width=\hsize, compat=1.3, every axis label={font=\figfn}, tick ...
4
votes
3answers
456 views

Verbatim in plain-format with XeTeX

(I'm aware there has been a similar question before, but this one has a twist) I wanted a verbatim macro to use which would use an unlikely character as an end-of-verbatim -marker (unlikely as in it ...
5
votes
1answer
498 views

pitchfork in plain TeX

I was asked the following question: How do I get get \pitchfork in plain TeX? He tried \input mssymb and \input amssymb but neither works. More generally, is it possible to get ams symbols to ...
3
votes
2answers
2k views

Template for cheat sheet

I have been working with LaTeX for a couple of years but I don't know anything about pure TeX. I find this LaTeX cheat sheet useful to remember some commands. So I'd like to have a LaTeX template for ...
8
votes
1answer
349 views

Execute token after \halign

I like to create a macro which processes a following brace group as "argument" using \halign. After it has been processed a token (a macro) should be executed. With an \hbox I can use ...
2
votes
2answers
303 views

pst-text with plain XeTeX

How, if possible, can I use pst-text with plain XeTeX? I have TeX Live 2011. When I try to run the minimal example: \input pst-text \pscharpath{TeXnik} \bye , I get a bunch of ** WARNING's, ...
6
votes
2answers
915 views

Using hyph-utf8 with plain TeX

I want to use the UTF-8 hyphenation patterns (for Croatian) with plain TeX (pdftex). I've read the documentation on the hyph-utf8 package but I haven't found it very useful. There's mention of a ...
0
votes
2answers
1k views

How to define font size in plain TeX such that it works as font size defined in article?

% gettingstarted.tex \hoffset=-72.27pt \voffset=-72.27pt \hsize=72.27pt \vsize=72.27pt \special{papersize=\the\hsize,\the\vsize} \parindent=0pt \nopagenumbers \input pstricks ...
1
vote
4answers
681 views

How to get started with plain TeX

I am using TeX Live 2010 on Windows 7. I have no experience to compile a plain TeX input file. Is my input file below correct? % gettingstarted.tex \input pstricks \topmargin=-72.27pt ...
4
votes
2answers
257 views

How to obtain PlainTeX in LaTeX environment?

In The TeXbook it is written that \char13 is <return> and \char32 is space. But when I use this symbols I receive fl ligature for \char13 and something like hyphen for \char32. What do I do ...
4
votes
1answer
2k views

Make an invisible vbox

I'm placing a PDF meta information in a \vbox in a plain XeTeX document, and I would like it to behave as if there were no box at all (so any additional \vskip after the \vbox will appear). Right now, ...
2
votes
1answer
604 views

Plain TeX: running header with section name

I want to create a TeX document with sections and a running header containing the name of the current section. I know I can use \mark{} to mark the section headings and then use \topmark or \firstmark ...
3
votes
1answer
481 views

Convert from LaTeX to Plain TeX

Is there a way to convert a LaTeX document, which uses a lot of packages and macros, into Plain TeX, such that all macros are expanded and all dependencies on external packages are gone?
6
votes
3answers
207 views

How to define a macro containing a tabbed line (\+…\cr)?

\def\test{\+test\cr} \test \vfill \eject The above gives error: ... Runaway definition? -> ! Forbidden control sequence found while scanning definition of \test. ...
2
votes
1answer
367 views

Scope of catcode change for escape character ?

In the following macro, I change the category code for the escape character (\) to "other" (12): \def\xxA{\begingroup \catcode`\\ = 12 \gdef\xxB ##1z{\tt ##1\endgroup} \xxB} How the heck does ...
5
votes
3answers
790 views

Non-vertically-centered TikZ matrix of nodes cell content

How can you make the matrix cell contents aligned to the top? I am using plain format with XeTeX. \input tikz \usetikzlibrary{matrix} $$\hbox{I'd like for the cells to be top-aligned}\cases{ ...
4
votes
2answers
560 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 ...