3
votes
2answers
187 views

Extract first letter of each word in a sentence

I don't know if already exists a question like this, but after 20 minutes I haven't found one. There are similar ones, like How to define a command that bolds the first letter of each word in the ...
3
votes
2answers
68 views

Replace and add a/to a specific sequence of tokens

Is there a way to find a specific sequence of tokens and add after it a command? Or is there a way to find a specific sequence of tokens and replace it with another one? And do it only if the sequence ...
1
vote
2answers
171 views

Spacing depending on optional subscripts and superscripts

I am totally new to LaTeX (use it for 2 days), so I am sorry if this has already been asked, but I spent the last 6 hours searching for a solution, but to no avail. (I stumbled upon a package xpeek ...
4
votes
3answers
217 views

How are space tokens and empty lines processed by long commands (as their potential arguments)?

How are spaces and empty lines processed by long commands (i.e., those that do not accept paragraph breaks inside)? Are there different space tokens aside from " " and an empty line? It appears that ...
5
votes
2answers
158 views

Macro for a code translator

Is there an existing macro that "translate" tokens using some code ? For example : \def\code{{{a,b},{b,c},{c,a}}} \translate[\code]{caac} % => would typeset "abba" or even better something like ...
4
votes
2answers
367 views

Passing multiple arguments from ProcessList (xparse) to a macro. Result to be used in tabular

I am making a macro that will take user input of a grading scheme and place it into a tabular environment. I would like the syntax to be as simple as possible and decided on: \tabulate{ eval1,%1 ; ...
15
votes
4answers
463 views

How does one remove material from a token list?

This is a follow-up question to How does one append material to a token list? The macros \prependto and \appendto work nicely to add content to token lists. How would one go about creating macros ...
19
votes
5answers
962 views

How does one append material to a token list?

Several times, the floatrow package uses \newtoks which (according to this website) means that a token register is allocated. An example code snippet is ...
7
votes
2answers
941 views

Iterate over space-separated list

I’ll briefly explain the background in case this can be solved simpler but I’d still be interested in an answer to the actual question, too. My chapter titles are very narrow and use a large font so ...