Skip to main content
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 ...
wipet's user avatar
  • 79.9k
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 ...
Skillmon's user avatar
  • 67.6k
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}} \...
wipet's user avatar
  • 79.9k
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? \...
cfr's user avatar
  • 219k
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{...
Mico's user avatar
  • 528k
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 ...
Ulrich Diez's user avatar
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 ...
cfr's user avatar
  • 219k
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 ,. \...
egreg's user avatar
  • 1.2m
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=...

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