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

learn more… | top users | synonyms (1)

12
votes
7answers
967 views

How to get the string with \

Apologized for my unclear description. I wish I could explain my problem more clearly. In document, I wish I can just write something as "how to use \cmd \mbox in xxx" or "what is \cmd minipage ...
6
votes
2answers
337 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 ...
9
votes
1answer
2k 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
813 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 ...
5
votes
1answer
320 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). ...
0
votes
1answer
188 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 ...
26
votes
2answers
1k views

Introspection and reflection with LaTeX/TeX macros

Below is a short program that can use \meaning and \string to let a combination of LaTeX and TeX commands to print out the listing of macros. Unsurprisingly (nothing can surprise me with TeX any ...
11
votes
3answers
1k views

String replacement in LaTeX

I'd like to know how to replace parts of a string in LaTeX. Specifically I'm given a measurement (like 3pt, 10mm, etc) and I'd like to remove the units of that measurement (so 3pt-->3, 10mm-->10, ...
12
votes
2answers
816 views

LaTeX: collecting “values” and spitting them out several times?

I'm cleaning up some old LaTeX documents describing an API. In the process I'm creating my own little style for describing the API, but I've bumped up against a bit that seems to force me into a ...