Linked Questions

16
votes
2answers
2k views

Removing a backslash from a character sequence

For indexing I wanted to write a macro \macroname that removes leading backslashes from macro names but leaves the names of environments untouched. That is \macroname{\relax} --> relax \...
10
votes
5answers
507 views

Count number of entries with specific value

Assume I have a list with quite a few entries (all integer values, in case it's relevant), e.g., 1 2 4 0 3 1 0 0 2 1 7 1 4 2 3 0 0 6 5 2 1 2 3 0 Can LaTeX somehow count the number of 0's, 1's, ..., ...
8
votes
6answers
465 views

Can one avoid typing double quotes in this TikZ-involving macro?

I need to draw many similar complicated colored shapes; I made a macro for them, and it works, but to call it I seemingly have to place several color names in double quotes. Can I avoid this? The ...
12
votes
2answers
740 views

How are parameter tokens (#1,#2,…,#9) processed?

I wonder how the TeX token muncher processes parameter arguments. It seems that parameter arguments are sent token by token. Is this true? Consider the following code based on wipet's answer used to ...
8
votes
2answers
474 views

What is the limit number of \label in a document?

With a group of teachers friends we are compiling the national and international tests applied in my country from 1980. These are "multiple choice" tests, with most of the tests already ...
5
votes
3answers
362 views

Split input at hyphen or space

I need to treat input differently, depending on whether it contains a space or a hyphen. That is, the following \foo{foobar} \foo{foo bar baz} \foo{foo bar-baz} \foo{foo-bar baz} \foo{foo-bar-baz} ...
3
votes
1answer
745 views

Storing data in a two-dimensional array

I'm trying to draw diagrams for the board game Go in TikZ. To reuse board positions in subsequent variations I need a way to store the current board position. I learned from this question that two of ...
7
votes
1answer
182 views

How to automatically invoke all defined macros?

First of all, make sure you have installed Kanji Stroke Order font before trying to compile the following MWE. The font can be downloaded here (click). I want to create a note about my study in ...
4
votes
2answers
141 views

In TeX how can I define a list of data such that I can use a numerical argument to call for one entry out of the list

I would like to be able to have a defined macro something like this: \def\testmacro[1]{[54.7],[74.1],[98.5]} Such that when I call \testmacro{2}, in a document, 74.1 is printed. Is this ...
1
vote
1answer
472 views

Create a fake “\meaning” (verbatimized) for content stored in seq?

I'm trying to create a command that represents the code that is stored in a sequence without executing it (something like \meaning) . When using \cs_log:N \l_scontents_macro_tmp_tl I get in the .log ...
5
votes
1answer
197 views

How do use {<setup>} in \tl_set_rescan:Nnn to replace \scantokens?

This question is related to (Changing escape character in \tl_set_rescan:Nnn) and (https://tex.stackexchange.com/a/496258/7832) but is not the same. I've tried to change this: \exp_args:NNx \...
2
votes
1answer
229 views

Create a fake label ref using list

Hello everyone once again, after having resolved my doubt regarding the use of \label and \ref. Reading the comments, I have noticed that in many occasions do not need to use the referencing system, ...
3
votes
1answer
175 views

Counting the number of strings stored in array

I stored a list of strings (command strings) in an array following the answer here: https://tex.stackexchange.com/a/215571/61517 . Now I wanted to access them randomly, and therefore I added a random ...
1
vote
1answer
134 views

Change the use of label ref by data save in an array (list)

Following the comments of my previous question What is the limit number of \label in a document? After analyzing the comments (@UlrikeFischer, @DavidCarlisle) on memory usage, especially the idea of ...
1
vote
1answer
208 views

How to expand a \macro (or a copy) to save in a list at end of environment in xparse (expl3)?

I am trying to encapsulate a couple of environments to pass them to lists using xparse/expl3. I have defined a one command and two environments and I have had a problem with one of them. I use the ...

15 30 50 per page