# Tag Info

Accepted

### \let equivalent in LaTeX2e

There is no need to replace \let in your example, your \newcommands are simple. But if you define commands with an optional argument or robust commands then you should copy them with \NewCommandCopy (...
• 294k
Accepted

### Recursively update macro

Your code seems to work. Let's add some tracing in order to better see what happens: \documentclass{article} \begin{document} \def\temp{} \def\update#1_#2{ \xdef\temptemp{\temp} \gdef\temp{\...
• 993k

### Recursively update macro

You are doing full expansion (\xdef) of previous macro declated by \update but \underbrace is more complicated macro which uses \halign with # in its preamble and this cannot be fully expanded without ...
• 53.6k
Accepted

### Accessing TeX's internal tokens

No idea why nobody have posted an answer for the \endwrite token, but here it is. %! TEX program = pdflatex \documentclass{article} \begin{document} \ExplSyntaxOn % starting state of the input ...
• 2,243

### How to define \newcommand as number from file using \input

In LaTeX the TeX-primitive \input is renamed to \@@input and \input is redefined to be a macro which does not work out in expansion-contexts like gathering and expanding tokens that belong to a TeX-⟨...
• 23.5k

### How to define \newcommand as number from file using \input

It cannot work, because \input is not expandable. \documentclass{article} \usepackage{catchfile} \newcommand{\foo}{}% for safety \CatchFileDef{\foo}{page.tex}{} \setcounter{page}{\foo} \begin{...
• 993k

### Recursively update macro

\temp with many LaTeX-packages is a scratch-macro. So code not stemming from you might override (re)definitions of \temp stemming from code written by you. In order to prevent such clashes in the ...
• 23.5k
Accepted

### How do I create macros that take + (plus) or - (minus) separated arguments as inputs and stores them to variables (e.g., coefficients of polynomials)?

You can read numbers to registers \coefnum and \expnum and run next macro using \afterassignment. \newcount\coefnum \newcount\expnum \def\polycoeff#1{\polyA#1\relax} \def\polyA{\afterassignment\...
• 53.6k

### TikZ \foreach loop with macro-defined list

Starting with version 3.1.7 (November 2020), TikZ supports the expand list option for \foreach. From the TikZ & PGF manual: /pgf/foreach/expand list={<boolean>} (default false) If this key ...
• 2,913

### Recursively update macro

underbrace is a robust command protected by LaTeX's \protect mechanism. For the mechanism to work properly you need the protected@ functions. \documentclass{article} \begin{document} \def\temp{} \...
• 2,243

### How to use new line command while using multicolumn in tabular?

Like this? With talltblr defined by the tabularray package: \documentclass{article} \usepackage{tabularray} \begin{document} \begin{talltblr}[ caption = {Overview of statistic. Diff.: Differened}, ...
• 255k

Some other points, which I think is not mentioned or only briefly mentioned in other answers. Only fully-expandable functions can conveniently "return result" as argument to another ...
• 2,243

### How to define \newcommand as number from file using \input

Your problem is that you are using LaTeX, no plain TeX. If you use plain TeX then the task can be simply solved: \newcount\page \page=\input page.tex The page is \the\page. \bye
• 53.6k
1 vote
Accepted

### Is it safe to use \globaldefs for setting global pgf key-value pairs?

As David Carlisle pointed out in his comment: "It is never safe to use \globaldefs anywhere, unless you have reviewed every line of code in its scope, and you personally maintain that code, so ...
• 23.5k
1 vote

### Math Symbols Palette?

Check out: https://www.caam.rice.edu/~heinken/latex/symbols.pdf This is a pdf document listing all mathematical symbols with Latex coding. Nice document to have for reference.

Only top scored, non community-wiki answers of a minimum length are eligible