Questions tagged [xstring]
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
19
questions with no upvoted or accepted answers
2
votes
0
answers
36
views
xstring testing: help needed for testing chords typeset with leadsheets package
For a personal songbook project I use the leadsheets package. Later on, I want to automatically typeset guitar chord diagrams based on the chords of a song, even if the song is transposed via the ...
2
votes
0
answers
86
views
Interpretation of Devanagari characters in XeTeX
\documentclass{standalone}
\usepackage{fontspec,xstring}
\setmainfont[Script=Devanagari]{Shobhika}
\begin{document}
\StrChar{abcd}{1} % Returns a
\StrChar{क्ष}{1} % Returns क, but should ...
2
votes
0
answers
100
views
Check if a datatool DB has an existing member
Using the code from How to check if a datatool db has an existing member with the same problem (build a datatool DB with unique strings) it works well as long if there is not an additional level (here ...
1
vote
0
answers
66
views
using xstring to obtain lead author's last name from authblk in a class file
I would like to query the last name of the first author of an article and then put it into the header. I use \StrBetween on the \AB@authlist macro to get the part of the string between the first space ...
1
vote
0
answers
68
views
Output plain ascii text to output file (expandable \IfStrEqCase with multiple matches)
This question is specfically about an expandable version of \IfStrEqCase (with multiple matches) as per Modified \IfStrEqCase with multiple matches per case.
However, in case this is an x-y problem, ...
0
votes
0
answers
14
views
Use Acronym result in /IfStrEq
I try to track changes in a LaTex document and implemented something like the \change.
It works by using strike-through and colors. My problem is that I now use the
acronym package and want to track ...
0
votes
0
answers
39
views
How do I search for a substring and highlight the occurrences?
How do I create a command which, given a string (let's assume just a single word) and a substring (let's assume just a single letter of the alphabet), outputs the given string with all the occurrences ...
0
votes
0
answers
53
views
Why does using IfEndWith inside DeclareNameWrapperFormat throw an error?
I wanted to use this solution for having possessive citations in BibLaTeX, but extend it to account correctly for names ending in 's' (at least in english). The solution posted in that question does ...
0
votes
0
answers
65
views
Test within new command - xstring package
I am trying to create a new command, to test wether another command ends with the string "...s\xspace" or "...\xspace", where the dots are other characters than s.
I've found that ...
0
votes
0
answers
127
views
How to conditionally define a new style in tcolorbox
I define a new tcolorbox option(key) named background color. If the valve given to it is a decimal, the backgound of the tcolorbox will have an effect of transparent -- eg. background color=0, else ...
0
votes
0
answers
53
views
Using \vec inside \StrSubstitute to simplify math notation
I'm using several different calculi (programming languages) in a work, and I'm trying to define a tool to simplify my notation for them by replacing text with the proper notation; as of now, I've been ...
0
votes
0
answers
147
views
How get the result of a macro that uses xstring functions before writing to a file
I encountered the need to write last name with initials (extracted from the full author's string based on first chars of first and middle name) into an external file. I use the xstring package to ...
0
votes
0
answers
98
views
Detokenize input to \newcommand
I would like to define a command that removes .m when referencing to the caption generate_simdata.m (i have a lot of such matlab function files, and would like to reference them normally with \nameref ...
0
votes
0
answers
41
views
Creating Modifiable Text
I was wondering if there was a way to create a string variable?
I need to use a WHILE loop where I remove the first char of a string, and I need to have that saved.
I tried other ways:
to put the ...
0
votes
0
answers
80
views
Why does this \gappto cause "Missing \endcsname inserted"?
I have a macro recoding the language:
\def\mylang{English}
and a command to convert the language name into its abbreviation:
\NewDocumentCommand{\StrToABBR}{m}{%
\expandafter\lowercase{\...
0
votes
0
answers
224
views
Multiple cases for xstring package
Regarding the statement (\IfEqCase), how can I set it to test multiple cases for same command at the same time without being nested, for example, I am trying to define a new command which takes 3 ...
0
votes
0
answers
65
views
What is * doing for these commands and how to replicate?
I'm trying to get a project's root folder path for usage later on in the preamble. My latex knowledge is... limited... but I've gotten a solution working using a combination of the currfile, and ...
0
votes
0
answers
129
views
StrSubstitute can not replace characters
I would like to dynamically display different content according to the macro name, I can not achieve this through the following way:
\begin{filecontents*}{\jobname.csv}
x`list
A`Macroone,Macrotwo
\...
0
votes
0
answers
66
views
xstring and on-the-fly creation of command
I am using bidishadowtext in a class file I am using. This package doesn't allow any line breaking characters in its text, so I was trying to get smart, and defining a command that, given a title with ...