4
votes
Trim spaces off end of a TeX command argument
If we want to remove initial spaces and trailing spaces from a parameter of a macro at expand processor level using TeX primitives only, then we can do following:
\long\def\nospaces #1#2{\nospaceafter ...
3
votes
Trim spaces off end of a TeX command argument
This answer focuses on the aspect of trimming white space from an argument and forwarding the result to anything else (as there already exists an excellent answer tackling the more complex problem OP ...
3
votes
Text/string variable
The \CsNameToCsToken macro from the accepted solution can be implemented a little simpler:
\def\CsNameToCsToken#1#{\csnamecsA{#1}}
\def\csnamecsA#1#2{\expandafter\csnamecsB\csname#2\endcsname{#1}}
\...
2
votes
Accepted
keep number-printing and number-storing/calculating distinct
Clearly, if you want to store both the non-rounded value and the ability to reproduce the rounded one, you need to store 2 pieces of information rather than only 1.
So perhaps something like this?
\...
2
votes
Illegal control sequence name for \newcommand
If you need to typeset \mathbb{R}^2 sufficiently frequently to contemplate creating a shortcut macro for this expression, I will assume that you also need to typeset \mathbb{R}, \mathbb{R}^3, \mathbb{...
1
vote
Accepted
Shortcut for newtcblisting and tcolorbox
I cannot recommend this, but as long as you don't intend to nest \bmybox..\emybox you can have \bmybox switch to verbatim-catcode-régime, gather an argument that is delimited by \emybox tokenized in ...
1
vote
Accepted
Create a table with \newcommand where the values are input as the argument?
I'm not sure why you would want this particular command, so I fear this may not address your actual need, but this answers the question as asked.
tblr parses the content of the environment and so ...
1
vote
Trim spaces off end of a TeX command argument
You can use expl3 features regarding absorbing key-value pairs.
The \makemacros command stores the key-value pairs in a property list and the procedure trims off spaces around = and also around ,.
\...
1
vote
Recording the contents between two macros and save them for later usage
As mentioned in the comments, it seems like you're looking for the scontents package.
\documentclass{article}
\usepackage{scontents}
\begin{document}
\begin{abstract}
\begin{scontents}[store-env=...
Community wiki
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
macros × 8389expansion × 494
tikz-pgf × 474
environments × 438
math-mode × 387
conditionals × 354
tex-core × 324
tables × 289
spacing × 270
optional-arguments × 215
expl3 × 212
xparse × 198
errors × 197
arguments × 154
cross-referencing × 138
counters × 136
sectioning × 132
formatting × 127
packages × 124
programming × 123
strings × 110
beamer × 107
etoolbox × 105
color × 103
symbols × 102