10 votes
Accepted

Expandable case insensitive switch case for string comparison

With the kind help of expl3, this is expandable (if the code of the cases is, so with the normal definition of \selectlanguage it isn't). EDIT: as pointed out by @JosephWright, \str_foldcase:e is to ...
Skillmon's user avatar
  • 59.4k
5 votes
Accepted

how do I test for a unique string with multiple possibilities?

I would e.g. create command names: \documentclass{article} \usepackage{hyperref} \makeatletter \@namedef{aaa@link}{\href{example.com/aaa}{my aaa link}} \@namedef{bbb@link}{\href{example.com/bbb}{my ...
Ulrike Fischer's user avatar
2 votes

how do I test for a unique string with multiple possibilities?

You can use xparse: \pdfcompresslevel=0 \documentclass{article} \usepackage{xparse} \usepackage{hyperref} \ExplSyntaxOn \NewDocumentCommand{\newref}{mmm} {% #1 = key, #2 = URL, #3 = description, #...
egreg's user avatar
  • 1.1m
2 votes

how do I test for a unique string with multiple possibilities?

let biber do the searching for you: assuming there is a file test.bib with @online{tex, note={my aaa text}, url={tex.stackexchange.com} } @online{google, note={my bbb text}, url={www.google....
ian's user avatar
  • 304
1 vote
Accepted

Override macro with \renewcommand{} multiple times from different files - toc addcontentsline

\foreach executes its contents inside a group, so local definitions are unknown between iterations. You should make the definitions global by prefixing \global to \let and using \gdef: % ------------...
Phelype Oleinik's user avatar

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