« Phabricator LDAP (and other) account integration table | Home | Make fails silently »
LaTeX macros ending in numbers
By admin | February 13, 2016
Only letters are directly permitted in macro names, but by using csname to create definitions along with a variable command, we can simulate them.
First, define the macros with numbers using \csname:
\expandafter\def\csname xR1\endcsname{-3} \expandafter\def\csname xR2\endcsname{9}
Now, create a command which takes in one variable argument, and simply expands it to call the appropriate macro (“xR” + variable) defined above.
\newcommand{\xR}[1]{\expandafter\csname xR#1\endcsname}
And to use the macros:
The first is \xR1 and the second is \xR2.
If you found this article helpful or interesting, please help Compdigitec spread the word. Don’t forget to subscribe to Compdigitec Labs for more useful and interesting articles!
Topics: Linux | 7 Comments »
September 14th, 2024 at 19:57
… [Trackback]
[…] There you will find 33170 more Info on that Topic: compdigitec.com/labs/2016/02/13/latex-macros-ending-in-numbers/ […]
September 14th, 2024 at 23:30
… [Trackback]
[…] Read More on that Topic: compdigitec.com/labs/2016/02/13/latex-macros-ending-in-numbers/ […]
September 16th, 2024 at 21:27
… [Trackback]
[…] Info on that Topic: compdigitec.com/labs/2016/02/13/latex-macros-ending-in-numbers/ […]
September 20th, 2024 at 22:35
… [Trackback]
[…] Info on that Topic: compdigitec.com/labs/2016/02/13/latex-macros-ending-in-numbers/ […]
September 25th, 2024 at 20:11
… [Trackback]
[…] Find More Information here to that Topic: compdigitec.com/labs/2016/02/13/latex-macros-ending-in-numbers/ […]
September 30th, 2024 at 18:54
… [Trackback]
[…] Find More on that Topic: compdigitec.com/labs/2016/02/13/latex-macros-ending-in-numbers/ […]
October 24th, 2024 at 07:23
… [Trackback]
[…] Find More on on that Topic: compdigitec.com/labs/2016/02/13/latex-macros-ending-in-numbers/ […]