{plain-tex} commands used for macro {programming}.

learn more… | top users | synonyms

25
votes
1answer
338 views

Using elastic lengths — when do they work?

I was wondering why elastic lengths like \fill seem to work only under certain conditions. For instance if I write A \hspace{\fill} B I get A left aligned, B right aligned as wanted. If however ...
23
votes
1answer
207 views

Which primitives does LaTeX2e rename/move?

TeX's primitives can be renamed by macro formats/packages: this allows new/altered features or behaviours. Usually this is done such that the originals are still available ('renamed'): certainly ...
21
votes
2answers
2k views

What are the exact semantics of \detokenize?

How does \detokenize work? The e-TeX Short Reference Manual states: When followed by a <general text>, expands to yield a sequence of character tokens of \catcode 10 (space) or 12 ...
18
votes
3answers
17k views

how to suppress “Underfull \vbox (badness 10000) … while \output is active”?

when using an inflexible document class, one is often faced with the warning Underfull \vbox (badness 10000) has occurred while \output is active [] on pages that contain no display math. in ...
16
votes
1answer
873 views

What does \marks do?

Recently I had cause to define a macro called \marks. If I try something like \newcommand{\marks}{fred} I get the error ! LaTeX Error: Command \marks already defined. In LaTeX, if I do ...
14
votes
3answers
598 views

Is there a printable version of a reference manual for all TeX primitives?

Everywhere in the TeX community, I see suggestions like \parskip, \obeylines, \parindent, etc. I'd be surprised not to find them even in the most basic LaTeX packages. So I figured they must be deeper ...
13
votes
1answer
166 views

Which primitives does ConTeXt rename/move?

TeX's primitives can be renamed by macro formats/packages: this allows new/altered features or behaviours. Usually this is done such that the originals are still available ('renamed'): certainly ...
11
votes
3answers
371 views

A command to replace \middle| when it's missing?

I'm using this LaTeX plugin for a Wiki (Confluence, blech), and it doesn't support the \middle| command. I'm guessing it doesn't have eTex primitives or some such backwardness. Anyway, I guess I can ...
11
votes
2answers
1k views

Is it safe to temporarily redefine \and, \or, and \not?

I'm writing lots of logic expressions in LaTeX and I'd much rather write $p \and \not q \or r$ than $p \land \lnot q \lor r$. I was thinking of doing something like this: \newenvironment{logic}{% ...
10
votes
3answers
281 views

Change \the\year

Is it possible to make LaTeX believe that the current year is 2012, so that \the\year prints 2012? \documentclass{article} \begin{document} % What to do so that the following prints 2012? ...
10
votes
2answers
256 views

Which TeX primitives can be recovered after their initial definitions are overwritten?

This is mostly an academic question out of curiosity, but I think it may give some interesting answers. The question is, given a TeX file beginning with \def\someprimitive{}, for which values of ...
9
votes
1answer
75 views

List of all control sequences let to primitives in common formats

I would like to know a list of all control sequences which are let equal to primitives in common formats. For plain TeX for instance, we would get the list \endgraf % = \par \endline % = \cr \repeat ...
8
votes
1answer
130 views

How can \ifx\\\\ be false?

It appears that I have a case where \ifx\\#2\\ is false, even though #2 is empty. Here is the relevant excerpt from the log file, with \tracingcommands and \tracingmacros turned on: \lastpageref ...
7
votes
1answer
314 views

\let a control sequence to a redefined primitive

pdfTeX version 1.40.0 introduced the primitive \pdfprimitive which the manual describes as follows. This command executes the primitive meaning of the following control sequence, if it has been ...
7
votes
1answer
334 views

Use case for pdfTeX's \quitvmode

While reading one of Lev's answers, I encountered a pdfTeX primitive \quitvmode that I have never noticed before. The pdfTeX manual states that this causes TeX to leave (internal) vertical mode and ...
6
votes
1answer
193 views

How to emulate \pdfstartlink and \pdfendlink with xetex?

In my ocgx package, I would use the new ocg-p package instead of the ocg package. With pdflatex or lualatex, all is good. But with xelatex, I obviously can't use \pdfstartlink and \pdfendlink (these ...
5
votes
1answer
255 views

Why should some TeX primitives never be set directly in LaTeX?

In an earlier question More economic and robust command for abstract at the beginning of chapters, David Carlisle told that one should never use directly some TeX primitives. How can I distinguish ...
4
votes
2answers
250 views

ConTeXt doesn't implement some Knuth TeX primitives?

I try to use new TeX format ConTeXt, but I find that some TeX primitives don't act any more. How sad I am when I find that. An simple example is that in plain TeX, we can set the spaces between ...
3
votes
1answer
110 views

Can I use a TeX primitive in a “before” and “after” macro? (and how?)

The Question Can I use a TeX primitive in a "before" and "after" macro? (and how?) There are two questions that I found useful and related to my question, which sent me in the right direction: how ...
3
votes
1answer
226 views

Recursion - splitting a group.

I've been trying to understand the notion of recursion in TeX - not easy given that my background is the high-level stuff in LaTeX. The only examples I can (just about) understand are very basic ...
3
votes
1answer
241 views

Converting command to result

Consider this example: \documentclass{article} \newcommand{\foo}{} \newcommand{\currentbar}{\thebar} \newcounter{bar} \setcounter{bar}{0} \makeatletter ...
1
vote
0answers
70 views

About those magic primitives [closed]

While learning TeX, I found some primitives are magic (e.g., \expandafter \futurelet \aftergroup). These primitives can change the expansion order of the input stream. Have anyone made any ...