Quantcast
Channel: Create programmatically a macro whose name contains the value of a counter - TeX - LaTeX Stack Exchange
Browsing all 3 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

Answer by egreg for Create programmatically a macro whose name contains the...

If you're afraid of the access time to a sequence, you can use \csname:\documentclass{article}\ExplSyntaxOn\NewDocumentCommand{\newarray}{m} { % keep the next free index \int_new:c {...

View Article



Answer by wipet for Create programmatically a macro whose name contains the...

If you define\def\sdef#1{\expandafter\def\csname#1\endcsname}\def\cs#1{\csname#1\endcsname}then an equivalent of python'smyArray[0] = "mystyle"is\sdef{myArray[0]}{mystyle}and the value is accessible...

View Article

Create programmatically a macro whose name contains the value of a counter

I often need to define macros whose name contains the value of a counter, notably to attribute a value to multiple objects: in python I would do:myArray[0] = "mystyle"Unfortunately, I can't use...

View Article
Browsing all 3 articles
Browse latest View live




Latest Images