I have strings such as
2011-10-29--2-03
but I want to display them as
2011-10-29, p. 2, fig. 3
I tried
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{xstring}
\begin{document}
\def\ConvertID#1{%
\StrMid{#1}{1}{10},
p.~\StrMid{#1}{13}{13},
fig.~\StrMid{#1}{15}{16}
}
See \ConvertID{2011-10-29--2-03}.
\end{document}
and then tried various methods (from ideas at Remove leading zeroes from an integer) to handle the last 2 characters, e.g.
\num[minimum-integer-digits=1]{\StrMid{#1}{15}{16}}
from siunitx, but it did not work.
How can this be done?






2011-10-29:2-03should be better to use. – projetmbc Dec 30 '23 at 16:10