Skip to main content

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

6 votes
2 answers
55 views

I'm trying to write a custom command to automatically adapt the shape of intervals in Tikz. I'm currently trying to pass an orientation argument to the command \intervalle to parse it via another ...
UnderscorePoY's user avatar
2 votes
1 answer
59 views

I'm using a LaTeX macro to sanitize math expressions for label generation. The macro applies \detokenize to the input and then runs a series of \StrSubstitute commands to remove or replace certain ...
Martin Kunze's user avatar
6 votes
3 answers
424 views

I want to automatically "sanitize" arbitrary LaTeX math formulas (such as \mathcal{P}(A)) into a string that can be used as a label, by replacing all curly braces { with e.g. Lp and } with ...
Martin Kunze's user avatar
1 vote
0 answers
67 views

I want to determine whether a general expression starts with a dash using xstring package. In some cases it fails, an other generates a wrong answer. The below comparisons all should return true, ...
Ibrahim Onaran's user avatar
3 votes
3 answers
211 views

I want to extract and format time from a given link. The formatting should be HH:MM:SS. For example from https://youtube.com/watch?v=dQw4w9WgXcQ&t=123s I should get 02:03. I only consider 2 ...
Daniel Neskorodov's user avatar
4 votes
2 answers
157 views

The issue appears to be with xstring macros. I am well aware that they are not expandable, so that they cannot be nested. I have a lot of custom code that uses xstring without problem, by storing the ...
rallg's user avatar
  • 1,495
0 votes
1 answer
49 views

I have an auto-generated grammar definition. I want each non-terminal definition to be aligned on the "::=" and wrap the productions automatically. To do this, I use a minipage split across ...
Dhruv Makwana's user avatar
2 votes
1 answer
94 views

I am trying to code a macro that defines a \newcommand, based on a partial string which I input. \documentclass{article} \usepackage{xstring} \newcommand\cmdfullstr[2]{% \expandafter\newcommand\...
D.Roepo's user avatar
  • 3,479
5 votes
2 answers
173 views

Goal I am attempting to redefine an existing command (\mintedinline) which takes a verbatim argument. I need to format this argument such that it can be passed to an outside program for processing; ...
David Friant's user avatar
5 votes
4 answers
503 views

I would like to remove all citations from a given string. I thought of doing something like the MWE below but it doesn't work. \documentclass[% oneside, % Print one sided ...
tim.bsm's user avatar
  • 137
1 vote
0 answers
86 views

I have a problem with providing conditional PDF metadata to different LaTeX documents. I'm using the xelatex compiler and thought I could conditionally set PDF metadata based on the jobname (via ...
serval's user avatar
  • 127
3 votes
2 answers
168 views

I'd like to get characters at specific indices from my argument. I'm trying to use \StrChar, but it seems that it collapses consecutive spaces: \documentclass{paper} \usepackage{xstring} \begin{...
Cactus's user avatar
  • 1,387
4 votes
2 answers
193 views

I ran into the following issue. My goal is to read a table from a csv file, format some numbers nicely, and print some data depending on other fields. The following minimal example captures the logic ...
Bubaya's user avatar
  • 3,055
5 votes
4 answers
658 views

I want to replace all characters in a string by a different character, for example an asterisk. This is my code: \documentclass{minimal} \usepackage{multido} \usepackage{xstring} \def\mystring{...
Tonechas's user avatar
  • 1,068
2 votes
1 answer
94 views

I don't know whether what I'm trying to do is possible at all, but I really want to make a tikz path style that behaves differently depending on the names of the coordinates it's given. Here's a ...
N. Virgo's user avatar
  • 4,497

15 30 50 per page
1
2 3 4 5
27