Questions tagged [primitives]

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

Filter by
Sorted by
Tagged with
40
votes
2answers
12k 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 (...
60
votes
3answers
86k 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
1k views

Prevent scaling of printout of PDF without using hyperref

pdftex produces PDF. We need a viewer to view the PDF and print it. Some of those viewers tend to scale the printout: the letters shrink. This is a bug especially of the Adobe Reader and explained ...
19
votes
3answers
1k views

Is there a list of expandable TeX primitives? LaTeX? e-TeX? others?

According to Christian Hupfer's comment I understood that calculations are possible in a keyval list when the macro is expandable. The macro \numexpr being expandable, calculations are possible. ...
12
votes
1answer
2k views

Can one safely redefine \jobname?

I want to access labels from an external document -- in general this is not a problem with the xr package. But in this case both documents are compiled on sharelatex, and there \jobname is always set ...
20
votes
3answers
2k 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 ...
6
votes
1answer
407 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 ...
13
votes
1answer
290 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 ...
8
votes
1answer
514 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 ...
12
votes
2answers
3k 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}{% \...
6
votes
2answers
751 views

hide/show complete row of tabular

I need to toggle on/off full rows of a tabular via changing my preamble. My workflow only permits me to alter the first cell of each table in order to make it toggleable. My idea was to use the ...
5
votes
1answer
153 views

\string-primitive works in unexpected ways in LuaTeX — Where can I find exact documentation of the \string-primitive in LuaTeX?

This question refers to LuaTeX-engines prior to luatex 1.10.0 in texlive 2019. With luatex 1.10.1 in texlive 2019 and later the \string-primitive works as expected. Where can I find exact ...
28
votes
2answers
2k views

What is a primitive, a macro, and how do they compare?

The title pretty much says it all. If it helps, I found myself asking this question when reading this post about \par vs. \\.
29
votes
1answer
373 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 ...
1
vote
1answer
158 views

What is “# Notation”? How does the # syntax work?

Closely Related: How to implement \expandbefore, similarly to \expandafter? In the related question, a reference is made to the "# Notation". How does the syntax work? From an answer on the other ...
14
votes
3answers
3k 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? \the\...
10
votes
2answers
10k views

Practical consequences of using \over vs. \frac?

This question explains the difference between \over and \frac and it seems as though the most experienced members unanimously agree that \over is inferior (if not something to be outright regretted); ...
5
votes
2answers
283 views

Trying to understand \def\def@ sintax primitives

I am trying to understand this syntax of primitive \def \DeclareOption{man}{% \def\def@man{\@manmode} } Why this primitive nesting? And I do not get to understand why there is two \def sentences ...
4
votes
0answers
76 views

What is the essential/crucial difference between \scantokens/\tex_scantokens:D and \tl_rescan:nn?

Part III The l3names package—Namespace for primitives, Section 1 Setting up the LaTeX3 programming language of interface3.pdf says: This module is entirely dedicated to primitives (and emulations of ...
3
votes
1answer
517 views

Converting command to result

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

Where should I specify pdftex primitives? [duplicate]

I would like to suppress this type of warning by pdftex: PDF inclusion: multiple PDFs with page group So one solution proposed here is to use this primitive: \pdfsuppresswarningpagegroup=1 Where ...
1
vote
5answers
320 views

Error trying to use \edef

Feel free to skip past this explanation to the code below. My issue is trying to get \Q@Selection to work with edef. I have a macro that uses a for loop to assign some dynamic macros that I am toying ...