provides macros manipulating strings of tokens. For a basic use, tokens can be alphanumeric chars, but the macros can also be useful for manipulating tokens

learn more… | top users | synonyms

12
votes
1answer
291 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? ...
10
votes
3answers
438 views

TeX capacity exceeded while parsing a date string

I'm trying to parse a date (say, a due date) in a DD-MMM-YYYY format, e.g., 06-May-2012 and create macros \dueday, \duemonth, and \dueyear. I use xstring's commands to extract the substrings. Then I ...
9
votes
4answers
3k views

How to cut a section title in the header

I redefine my headers as in the following MWE: \documentclass[12pt]{article} \usepackage{xstring} \usepackage{fancyhdr} \fancypagestyle{monstyle}{% \fancyhf{} % remove everything ...
4
votes
2answers
107 views

How to test if a given reference belongs to a list of labels?

This question is a prolongation of my previous question How to choose from a list for using result in \ref?. I got really good and interesting answers. Unfortunately I can not implement them for my ...
29
votes
5answers
1k views

Censoring Curse Words with Grawlixes

Suppose that I would like to censor a curse word <word> using grawlixes, e.g. "What the #@$! are you doing?!" How can I define a command \censor such that \censor{<word>} results in a ...
9
votes
3answers
1k views

Extract number from string and compare problem

I try to extract the year, month and day from a string and write different text depending on the given date. I thought I could use xstring and etoolbox, but I can'st get it to work. Here's the code ...
5
votes
5answers
1k views

Process a string with replacing and splitting

I have an input string like "123-45" or "1-3-5" or "2-4; 6-8" where the minus signed should be removed. This is easy with the xstring package. \StrSubstitute{#1}{-}{} The next step is to split the ...
6
votes
2answers
380 views

Using xstring to check .tex file name

I am having difficulty in using xtring to check the file name of the .tex file. All three of the cases shown below produce the wrong output. Surprisingly in my actual more complicated usage, the ...
11
votes
2answers
177 views

How to process a list and ignore spaces?

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 ...
8
votes
1answer
86 views

\IfStrEqCase having problem with last optional parameter

It's been a while since I asked an embarrassing question, and am pretty sure this is another one of those: This code below attempts to use \IfStrEqCase from the xstring package and results in: ...
8
votes
4answers
226 views

choose from a list with xstring

I want a command that does the following: \variation{1}{aaa;bbb;ccc} ----> aaa \variation{2}{aaa;bbb;ccc} ----> bbb \variation{3}{aaa;bbb;ccc} ----> ccc The string in the second input can ...
5
votes
1answer
66 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} ...
5
votes
2answers
78 views

How to choose from a list for using result in \ref?

Recently, in choose from a list with xstring, Geoff was asking about defining the command \variation that does the following: \variation{1}{aaa;bbb;ccc} ----> aaa \variation{2}{aaa;bbb;ccc} ...
5
votes
1answer
570 views

Generate labels using xstring and \Makelowercase

I am trying to write a command that allows me to reference a subsection with a generated label. The idea is that when I declare a step \step{Long Name With Many Uppercase Letters}, the generated ...
5
votes
1answer
156 views

Substituting strings only when not bounded by letters or numbers

Using StrSubstitute from xstring I can find and replace matches. For e.g.: \StrSubstitute{I like to eat fish.}{fish}{apples} gives "I like to eat apples." \StrSubstitute{Do you want to ...
5
votes
2answers
442 views

Feeding arguments to xstring macros

In Footnotes with automatic final period, the comment was made to provide the possibility to add a period . to a footnote conditionally, based on whether the footnote already has a period or not. I ...
4
votes
2answers
165 views

controling padding using the xstring package

in order to pad some text with a predefined padding, im using the xstrings package my current code is \documentclass{minimal} \usepackage{xstring} ...
2
votes
1answer
317 views

XeLaTeX - Devanagari page numbers in \tableofcontents [duplicate]

Possible Duplicate: How to get devanagari numerals in latex or xetex I am using XeLaTeX (XeTeX, Version 3.1415926-2.4-0.9998 on TeX Live 2012/W32TeX). I want Devanagari (Indic) page ...
1
vote
1answer
126 views

Customize text format of captions by parsing content of \@caption

I need the first sentence of my captions to appear on its own line in a \large, bold font. I also need to same document to easily produce standard captions (all same font, no line breaks). I have ...