Skip to main content

Questions tagged [strings]

{strings} are sequences of characters (most commonly literal constants). However TeX doesn't have the same concept of strings as other languages, so for questions regarding text in general this tag does not apply. Usually when dealing with {strings} one also uses the primitive {pdfstrcmp} or dedicated packages, such as {xstring} or {expl3}'s string module (l3str).

4 votes
2 answers
145 views

Context (not to be confused with ConTeXt) \documentclass{article} \begin{document} \ExplSyntaxOn \sys_shell_now:n {C:\cygwin64\bin\mintty.exe} \ExplSyntaxOff \end{document} returns 'C:\cygwin' is ...
Grass's user avatar
  • 1,038
6 votes
3 answers
303 views

I am uncertain of what terms to search for to ask this question, but my goal is something along these lines: \documentclass{article} [\mycommand definition] \begin{document} 1: \mycommand{a,b} ...
Æzor Æhai -him-'s user avatar
3 votes
2 answers
185 views

I want to split the general math interval expression into four tokens(?) so I can then handle different cases. In other words, I need a command that receives (a,b) as an argument and define four ...
e_moro's user avatar
  • 990
2 votes
1 answer
57 views

I have an \outercmd, which uses an \innercmd multiple times with various macros calls e.g. \newcommand{\outercmd}{ \innercmd{\fooOne{}} \innercmd{\fooTwo{}} \innercmd{\fooThree{}} } I'd like to be ...
Dhruv Makwana's user avatar
4 votes
2 answers
115 views

I'm writing a package that provides an environment, say DoSomethingIfChanged. The environment writes it's content to file and then does [something] with it (run LaTeX on it, but I think this does not ...
Wamseln's user avatar
  • 1,471
0 votes
0 answers
24 views

I am trying to implement an rstrip-like functionality that removes a specified trailing character (once is enough), I found this answer https://tex.stackexchange.com/a/315805, however their expl3 ...
Hyperplane's user avatar
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
5 votes
1 answer
168 views

In LaTeX3, the command \tl_trim_spaces:n allow to trim spaces at both ends of an input. How to do exactly the same, but: Only the spaces that are prefixing the input (left) Only the spaces that are ...
Vincent's user avatar
  • 6,225
0 votes
5 answers
162 views

I'm trying to write a latex command that will allow me to concatenate k times a certain string. Both k and the string will be provided as input. However, I'm having trouble starting. I want to make ...
Eric_'s user avatar
  • 103
4 votes
1 answer
122 views

The following code could recognize a single number. but how to revise it such that it can split abc23.46de789f into {23.46 789} and {abc de f} ? \documentclass{article} \begin{document} \def\xloop#...
xcn's user avatar
  • 1,183
6 votes
1 answer
174 views

With the following MCE, we see that filenames can be defined through either (expl3) token lists (..._tl) or strings (..._str) for \input: both work. By contrast, for \fontspec's \setmainfont, only ...
Denis Bitouzé's user avatar
2 votes
1 answer
133 views

Let's say I am creating an expl3 macro: \cs_new:Nn \my_function:n{ % Something } I have hard time understanding the exact role of \tl_to_str when processing the argument compared to "just&...
Vincent's user avatar
  • 6,225
9 votes
5 answers
1k views

This is some code. \documentclass{article} \usepackage{xstring} \begin{document} \def\xloop#1{% \ifx\relax#1 \else **\IFInteger{#1}{first integer is here.}** % need to be modified ...
xcn's user avatar
  • 1,183
7 votes
1 answer
337 views

I found some code on from this link How to split text into characters But \IfInteger function not work \documentclass{article} \usepackage{coolstr} \usepackage{xstring} \begin{document} \...
xcn's user avatar
  • 1,183
1 vote
1 answer
64 views

I meet a problem when use \isnumeric function in coolstring package. After compilation with pdflatex engine, nothing is output in pdf file. Below is the code. \documentclass{article} \usepackage{...
xcn's user avatar
  • 1,183

15 30 50 per page
1
2 3 4 5
36