9
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 ...
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 ...
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, #...
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....
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:
% ------------...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
pdfstrcmp × 5tex-core × 2
strings × 2
macros × 1
table-of-contents × 1
pdftex × 1
conditionals × 1
expl3 × 1
expansion × 1
latex3 × 1
include × 1
comparison × 1
e-tex × 1