This question is part of a new package:
metrix. Typeset metric/prosodic symbols standalone and above syllables.
I’m wrinting a new package and I need to process a list (using etoolbox at the moment but that can change …). Everything works but I want the list to do two things that don’t work:
- Ignore spaces, because
xstringdoesn’t get the right strings otherwise. - Process an empty list element. It is ignored at the moment.
\documentclass{article}
\usepackage{etoolbox}
\usepackage{xstring}
\setlength{\fboxsep}{0pt}
\DeclareListParser{\dolist}{-}
\newcommand{\mylist}[1]{%
\renewcommand{\do}[1]{%
\IfStrEqCase{##1}{%
{}{0}%
{a}{1}%
{b}{2}%
{c}{3}%
}[?]%
}%
\dolist{#1}%
}
\begin{document}
1. \mylist{a-b-c--a}
2. \mylist{ a- b- c- - a}
3. \mylist{ a - b - c - - a }
\end{document}
The output is
- 1231
- 1231
- ????
but it should be the following in all three cases
12301
What I really wan’t to know ;-)
I’m implementing a package to typeset the metrics of (latin) verses, and I’d like to have a macro like
\metrics{_ u u _ }
{quid co-me-dent}
that renders as

What I’ve got so far is a macro that works with this syntax
\metrics{_-\ -u-u-_}
{quid-\ -co-me-dent}
Obviously there are two differences the space between two words must be separated with hyphen as if it is a syllable and it must be escaped with \. It would be great if the first list (the symbols) can be a space separated list and the second on a combination of hyphen and space separated.
You may download my full code from my web site: http://tweh.de/texsx/metrics.tex

texdoc expl3– egreg Jul 18 '13 at 09:41_tobis by_<packagename>since I’m building a new module, right? 2. Is it bad practice to mix up L2 and L3 syntax? – Tobi Jul 18 '13 at 10:37l3docbut I didn’t found a documentation on that class. – Tobi Jul 18 '13 at 11:00l3doc, so my packages aren't an example. ;-) – egreg Jul 18 '13 at 11:02\Large\u{}with a{tikzpicture}. – Tobi Jul 18 '13 at 11:13arc (1:2:3)syntax. I guess the:caused an error. – Tobi Jul 18 '13 at 11:27\ExplSyntaxOn– egreg Jul 18 '13 at 12:13\newcommand{\mytikz}{...}) and use this inside of\cs_new:Npn \metrix_x_mark:? – Tobi Jul 18 '13 at 14:52