3
votes
2answers
46 views

Generate comma separated list with some non-empty strings

I'm trying to generate a comma separated list that uses strings that may or may not be empty. For example \mylist{\stringA,\stringB,\stringC} would expand to A, C if B is empty or B, C if A is empty, ...
5
votes
1answer
52 views

Using xstring macros in edef

I've tried to use \protect to make the following \edef work but no luck. Can it be done somehow? \documentclass{article} \usepackage{xstring} \begin{document} \def\abc{a,b,c} ...
9
votes
3answers
158 views

Command doing the same job as StrBefore but being expandable

I am looking for a command allowing me to get 3 as output if the input is 3.2. \StrBefore{3.2}{.} works fine for this purpose but is not expandable and I need to call it in another macro inside a ...
2
votes
1answer
153 views

Cutting string with formula or cite

I am trying to define a macro that would take a string and paint its ending, for example: \def\paintString#1{% \saveexploremode% \exploregroups% \textcolor{white}{\StrGobbleRight{#1}{5}}% ...
4
votes
1answer
119 views

Expanded StrSubstitute

I am trying to use \StrSubstitute, but what I want is to expand it all the way to get the result string. \StrSubstitute{Řepa}{Ř}{Rzzz} then i use it with % somehow define \a as the result string ...
6
votes
2answers
427 views

Nesting of test commands (IfStrEq, IfSubStr etc.) of xstring

The following code does not work: \documentclass{article} \usepackage{xstring} \newcommand\checkempty[1]{ \IfStrEq{#1}{}{% Empty }{% NonEmpty } } \begin{document} ...
12
votes
1answer
287 views

Text being output when none should be

I am confused as to why the MWE below produces any black text. As the code is below, the output is: However, if you comment out the \IfStrEq line then it works fine and the black text goes away? ...
3
votes
3answers
300 views

Arguments expansion in IfSubStr

EDIT: Simplified question How can I make the following code print "Yes"? \IfSubStr{\textbf{AAA}}{AAA}{Yes}{No} Full question I'm playing with xstring's IfSubStr, but I don't really understand ...
5
votes
2answers
216 views

\StrMid and \MakeUppercase problem

What's wrong with this: \documentclass{minimal} \usepackage{xstring} \begin{document} \newcommand{\cim}{c1095} \StrMid{\MakeUppercase{\cim}}{1}{1} \StrMid{\cim}{2}{100} \end{document} ...