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

learn more… | top users | synonyms

4
votes
2answers
143 views

New primitives and grammar for replacing horrible \expandafter

Time and time when I am trying to read or write some macros, I'm always frustrated by lots of \expandafters inside them. Why don't we add some new primitives and grammar into TeX engines to make ...
9
votes
1answer
112 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 ...
10
votes
3answers
312 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? ...
3
votes
1answer
114 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 ...
25
votes
1answer
219 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 ...
13
votes
1answer
195 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 ...
5
votes
1answer
293 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 ...
1
vote
0answers
75 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 ...
8
votes
1answer
139 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 ...
25
votes
1answer
408 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 ...
4
votes
2answers
269 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 ...
6
votes
1answer
211 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 ...
11
votes
3answers
434 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 ...
20
votes
3answers
20k 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 ...
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}{% ...
3
votes
1answer
273 views

Converting command to result

Consider this example: \documentclass{article} \newcommand{\foo}{} \newcommand{\currentbar}{\thebar} \newcounter{bar} \setcounter{bar}{0} \makeatletter ...
22
votes
2answers
3k 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 ...
10
votes
2answers
259 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 ...
3
votes
1answer
231 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 ...
7
votes
1answer
324 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
341 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 ...
16
votes
1answer
915 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
614 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 ...