I'm working on a document command that has a variety of optional arguments for different results. I need to add an option that yields 'true' for an optional argument within a range of numbers, for example 100-200. The command is as follows (MWE):
\documentclass{article}
\usepackage{xparse,xstring,xspace}
\NewDocumentCommand{\Foo}{ o }{%
\IfNoValueTF{#1} {%
\emph{Foo}\xspace}{%
\IfBeginWith{#1}%
{b}{\emph{Foo} Bar\xspace}{%
\IfStrEqCase{#1}{%
{f}{\emph{Foo}\xspace}%
}%
[\emph{Foo}~#1\xspace]%
}%
}%
}
\begin{document}
\Foo
\Foo[b]
\Foo[3]
\end{document}
xstring does not appear to have a range option.



xstringworks with strings, not numbers. – Steven B. Segletes Feb 11 '14 at 14:38egreg: actually, in my specific case it just has to be above 343 rather than in a range, but I wanted to make the question more general/applicable.
– DavidR Feb 11 '14 at 14:44bsomething should be done, otherwise it should be a number and this number should be examined? – egreg Feb 11 '14 at 14:49