{strings} are sequences of characters (most commonly literal constants).

learn more… | top users | synonyms (1)

5
votes
1answer
416 views

TikZ: pgfutil-common: pgfutil@in@ - how does it work?

Having been writing small lib for TikZ, I tried to use this macro in order to search for @. Code compiled, but the result was false, despite that I was sure it was in tested string. So, I decided to ...
2
votes
1answer
1k views

How to pass a \def parameter to an inner command (StrSubstitute)?

I'm attempting to create 2 macros to simulate an array list as in Java for example. I'm using xstring StrSubstitute for this purpose, but I'm having a problem. Below is the code, it's a bit long as it ...
6
votes
1answer
857 views

How to capture the result of \StrSubstitute into a macro?

I have a macro, say defined as follows: \edef \temp{A.input 1} I want to replace the dot with hyphen and have the result being stored in \mystart. Something like that: \edef ...
6
votes
2answers
988 views

Nest StrLen and ifthenelse commands

Here is a sample of code I am working on: \documentclass[10pt]{report} \usepackage{xstring} \usepackage{ifthen} \begin{document} \StrLen{123456}\\ %Prints 6 ...
2
votes
4answers
292 views

Replacing entries in a csv list

I want to replace entries in a csv list, where the list parser can be arbitrary (eg: ,;:|). An example follows: \def\x{r;s;t;x;y;z} In this list I want to efficiently replace r,t,x by a,b,c via, ...
6
votes
2answers
376 views

xstring functions in section/paragraph headers

In the following example, \documentclass{article} \usepackage{xstring} \newcommand\foo[1]{\StrSubstitute{#1}{love}{hate}} \begin{document} \section*{\foo{I love Mondays}} \end{document} if I ...
8
votes
1answer
296 views

How do I store the upper case counterpart of a string?

I have a string stored in a variable \word, and I want to store its upper case counterpart in another variable \WORD. If I try \def\WORD{\MakeUppercase{\word}} \show\WORD then the message ...
5
votes
1answer
329 views

Performing String Manipulation on result of \cite{}

I would like to perform some string manipulation (using the xstring package) on the result of a \cite{} (the bib package is given to me, and wouldn't allow what I want to do without a major rewrite). ...
12
votes
1answer
4k views

Replacing a substring

I've got a string like this: aXYbXYc, and need to replace the XY substring with a right arrow: a $\to$ b $\to$ c. Is there any function (also provided by external packages) to help me do that?
7
votes
3answers
1k views

Evaluating a string to a command

How do I construct a string in LaTeX (perhaps with variables) that calls the LaTeX macro with the corresponding name? For example, say I have defined a comment as \def\Comment1{Example text.} and ...
0
votes
1answer
217 views

stringstrings replacement for XeTeX?

To construct a lower-case filename out of the mixed-case argument given to a command, I used stringstrings in LaTeX. Now I switched to XeTeX and it seems the fontspec-package has some interference ...