Articles of tex core

Hiding particular output files: namely, .aux and .log files

Is it possible to hide .aux and .log files? If so, what would be the most low-maintenance/simple way of doing so? They create quite a bit of clutter. I have a folder where I’m tending to a bunch of tex files, and ideally I’d like it so that I just see the .tex and output […]

Delimiting-a-macro-with-itself-chain

Reading this question and the answer of @Werner made me think about if it is possible to have chains of self-delimiting macros like \XX abc \XX def \XX xyz or lets say \begin{someenv} \XX abc \XX def \XX xyz \end{someenv} The original definition will obviously fail here – insufficent number fo \XXs. So, a first […]

\ifx doesn't treat \noexpand as \relax

The TeXbook (20th printing, Addison-Wesley 1991) describes how the primitive \noexpand<token> is expanded (p. 213): The expansion is the token itself; but that token is interpreted as if its meaning were ‘\relax’ if it is a control sequence that would ordinarily be expanded by TeX’s expansion rules. In light of this I expect the following […]

Wrapping \obeylines with \halign into a macro

In the TeXbook, Knuth gives an example: Are you tired of typing \cr? You can get plain TEX to insert an automatic \cr at the end of each input line in the following way: \begingroup \let\par=\cr \obeylines % \halign{⟨preamble⟩ ⟨first line of alignment⟩ … ⟨last line of alignment}\endgroup How would one wrap this up into […]

Redefining line break (double backslash) for align environment

I am trying to figure out if it is possible to (locally) redefine \\ (double backslash) within amsmath‘s align environment. On the one hand, I’d like to be able to dynamically insert extra columns, on the other I’d like to manipulate spacing. Here is an example, which does not work: \documentclass{article} \usepackage{amsmath} \begin{document} \begin{align*} \renewcommand{\\}{& x […]

What Pascal procedure inserts \mathon and \mathoff?

TeX surrounds inline math formulae with \mathon and \mathoff, which appear to be nodes. For instance, running TeX on $ $\showlists\bye gives ### horizontal mode entered at line 0 \hbox(0.0+0.0)x20.0 \mathon \mathoff spacefactor 1000 ### vertical mode entered at line 0 prevdepth ignored Where are those defined or documented? Neither the string mathon nor mathoff […]

Empty/blank lines in LaTeX code

I hope this question is in order here although it rather asks for a “best practice” than for some “solution”. I am wondering to what extent blank/empty lines in the code (I am using pdflatex) should be avoided and e.g. be replaced by %. My source code is full of single blank lines e.g. before […]

TeX at the Command Line

How does TeX work at the command line? More specifically, after having installed LaTeX, I found that typing tex in the command line opened up an interpreter. However, I have no idea what I can do here! If I type something like \pi, nothing happens! What does this TeX interpreter at the command line do?

How to make latex parse `x` as an argument of a macro definition instead of `#1`

When I define a mathematical function for plotting in pgfplots or pstricks I usually to it in the following way: \def\f(#1){(#1)^3 + 3*exp(#1)} just as suggested by Jake in his answer to a question about how to define a function consistently for plotting and computations in pgfplots with and without gnuplot. However is it possible […]

Why does \shipout start a new page?

The Tex Book (20th printing, 1991) describes the \shipout<box> primitive as follows (p. 279). After the <box> is formed — possibly by constructing it explicitly and changing modes during the construction, as explained for \hbox earlier — its contents are sent to the dvi file Based on this description, I would expect the pdf for […]