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
375
questions
1
vote
1
answer
59
views
Can I use IfSubStr to search pgf key values that contain footnotes?
I would like to search some pgfkeys values for particular substrings. My attempt to locate such functionality in the manual didn't pan out, so I turned to using "\IfSubStr" from xstring. ...
2
votes
2
answers
86
views
Re-center text after string substitution
What I want to do
I want to display the date (year / month) on the cover of my document in Japanese.
I have used the datetime2 package in other places in my document to print the date in English ...
0
votes
1
answer
115
views
Locally delete ^ and _ in braces
I want to delete ^ and _ in a braces like \left( and \right) so that size change of braces ignores super and subscripts.
I want to define it as a macro, but use of xstring package does not allow me to ...
1
vote
1
answer
65
views
How does one fully expand a macro between \csname and \encsname?
The best way to ask this question is to present two MWEs, one of which works and one of which does not. Naturally, I would like to get this into the second form, but I am at a loss as to what is ...
2
votes
4
answers
166
views
How to modify overlay specifications in a new command in LaTeX Beamer?
I would like to modify the overlay specification that is passed to a custom command, but for some reason, < and > are interpreted as ¡ and ¿ when they are included in a new command.
MWE:
\...
2
votes
2
answers
138
views
Checking if a certain fragment is located earlier in the document
Very often I want to refer to a certain claim I mentioned earlier in the document: "As I said earlier, blah." Since I often rearrange material, I need to ensure that "blah" indeed ...
1
vote
3
answers
160
views
I made a complex number command
So I've written a command as a homework assignment to render complex numbers correctly. Like, when I write \complfull{5}{-2} the output is 5-2i
\documentclass{scrartcl}
\usepackage{amsmath}
\...
2
votes
2
answers
66
views
Evaluation inside StrGobbleRight
I'm running into a problem with a list of IfSubStr that will be separated by commas and spaces. I don't want the final substring to have that comma and space, so I thought StrGobbleRight(2) would be ...
2
votes
3
answers
187
views
Find Text Between tabs [closed]
I copied a sheet from google sheet into a *.txt and want to format it to a pdf.
I could separate it with
\loop\unless\ifeof\mytextfile
\read\mytextfile to\mytextline
So I have in every loop one of ...
2
votes
2
answers
115
views
How to pass an argument to a macro called with \csname
I have a macro that generates lists of random numbers and converts them into letters to print. I'd like to create another macro that prints those lists with intervening text. That is, if
\first ...
1
vote
1
answer
85
views
getting automatically the initials of names
This sounds like some basic stuff, and yet I cannot manage to find a solution, packaged or native.
I have documents with people who have from 2 to 4 names (typical Danish name could be Søren Jens ...
6
votes
1
answer
275
views
How to get the first three letters of today’s day of week?
I tried using the package datetime2 to get the whole name of today’s day of week and then xstring to trim it as desired. But when I run the following code, the result is not trimmed at all:
\...
0
votes
1
answer
63
views
Converting String Coordinates to Number Coordinates (e.g. ab -> 1 and 2)
I'm trying to draw stones on a grid, and my macro API will have two ways of doing it: either you give the X and Y coordinates, or you give it a string of the coordinates. So, for example, ab should be ...
5
votes
4
answers
322
views
An expandable command that adds a string to an argument if the string is missing
I would like to write and expandable command which adds a string S1 at the beginning of another string S2 if S2 does not start with S1 in order to ensure that my string always start by S1.
I currently ...
0
votes
0
answers
22
views
Elsarticle: obtaining appendix section label letter? [duplicate]
When using Elsevier's article template elsarticle, the references to appendix sections return Appendix X instead of X. I personally dislike the double space, so I was trying to create a macro to ...