Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more

Questions tagged [comma-separated-list]

{comma-separated-list} is a data format consisting of fields, most commonly separated by commas

Filter by
Sorted by
Tagged with
2 votes
3 answers
170 views

Can't compare clist item with string

I can't compare comma list item with string. \clist_a is a temp var. \documentclass[12pt]{article} \usepackage{expl3} \begin{document} \ExplSyntaxOn \clist_new:N \clist_a \keys_define:nn { mymodule } ...
zongpingding's user avatar
2 votes
3 answers
599 views

How to create an environment that allows you to bold words before a " : "

(This is my first question, I hope I'm not breaking any rules in how I'm asking it) I would need an environment that basically takes as input a list of words separated by the ":" symbol and ...
Math Attack's user avatar
1 vote
0 answers
70 views

Iterate comma separated argument for \author

How to define a macro that accepts comma separated arguments, iterates over the arguments and inserts some command or text between the arguments? E.g. by checking if the current argument is not the ...
wolfrevo's user avatar
  • 523
0 votes
1 answer
70 views

Expand a clist from l3prop keys

I have a key that takes a comma-separated list as its value, with entries coming from the keys of a property list. I would like the "default" (no-value-given) to apply the key to every key ...
mbert's user avatar
  • 4,216
0 votes
1 answer
66 views

Is it possible to define commands that accept different argument types?

This is actually a more general question, but since a MWE is almost universally called for, consider David Carlisle's code \documentclass{article} \usepackage{fontspec} \usepackage{nopageno} \...
Mike Pugh's user avatar
  • 127
1 vote
1 answer
55 views

Execute list of commands generated by pairing elements from two \clist s or \seq s

I have hundreds of lines of code of the form \Umathcode`a = 0 \symwmb "1D4B6 and \Umathcode"03B1 = 0 \symrmtl "0000B where, in the latter case, there is a counterpart \def\...
Mike Pugh's user avatar
  • 127
0 votes
3 answers
55 views

handling a variable number of pagerefs

I'm writing a discussion document where contributors get their own pages and I want to mention these pages in the general text So I have this which seems to do the trick % usage: create printed page ...
aldobranti's user avatar
4 votes
5 answers
521 views

Comma separated list replacement

I have a comma-separated list of information provided by the author as a preamble to my document. I then want to use this list and I'd like to put one item from my list per line. My idea was simply to ...
Clem's user avatar
  • 45
0 votes
0 answers
33 views

Error combining separators using || in listofitems

I have noticed that .- may cause trouble if chosen as a separator with two or more other separators. Below minimal example compiles, but the line \bar{(w1) .- (w2)} that is commented out will throw ...
S. Olafsson's user avatar
3 votes
1 answer
180 views

Automatic listing of authors in a document

I have a command \by{ } that lets me list authors of an article like this: \by{ {author 1}{tagline} \\ {author 2}{tagline} \\ {author 3}{tagline} \\ <etc.> } I would like to store author 1, ...
Vebjorn's user avatar
  • 1,798
0 votes
1 answer
56 views

How to append the graphics path in a for-loop?

Objective I wanted to create a command that enables me to add a collection of paths in a comma-separated list to my graphics path, next to a bunch of other instructions for each path that I will not ...
Steven's user avatar
  • 153
1 vote
1 answer
224 views

Parsing of comma-separated list for \foreach

I am using PGF's \foreach on comma-separated list where the items may contain spaces; each item can be enclosed in {...} if it contains space, that works fine. Now, what happens when there is only a ...
eudoxos's user avatar
  • 2,993
0 votes
0 answers
154 views

How do I check if a list item is blank when it is passed as a parameter in LaTex?

I'm trying to create a command that accepts two lists using the \listofitems package where the first list is optional. In the command I want to check if the first entry in the optional list is "...
Rhys's user avatar
  • 1
2 votes
1 answer
673 views

Command for comma in math or text mode

I have the following csv file (myCSVfile.csv) which contains header with LaTeX code: $T_{1,2}$, $T_{3}$ 100, 300 200, 500 In my LaTeX document, I import this table with \pgfplotstabletypeset[col ...
zetyty's user avatar
  • 777
0 votes
0 answers
35 views

How to choose separating symbol in citations?

Currently my citations are like: "blah blah (1) blah blah blah (2-6) blah blah blah blah (7,8)" But I need that "(7,8)" to be "(7-8)". I'm using abntex2cite package, ...
Flávio Oliveira's user avatar
3 votes
1 answer
84 views

Comma separated values list in pgfkey is not a list

The question might be dumb but I can't find an adequate solution. If I put a comma separated value list as parameter using pgfkeys, then the result of pgfkeysvalueof is an atomic value and not a list. ...
Fernando Carpani's user avatar
0 votes
1 answer
42 views

Grab variable number of tokens – xparse macro

I'm trying to create the following macro: \adddescr{<comma separated list>}{<description 1>}...{<description n>} this macro should print element -- description \par accordingly, so ...
antshar's user avatar
  • 4,248
4 votes
1 answer
332 views

Create macro with variable number of comma separated arguments in plain TeX?

I wish to create two macros: one that takes a known number, and another that takes an unknown number of arguments that are comma-separated and does something with them. There have been a few answers ...
btshepard's user avatar
  • 680
3 votes
1 answer
146 views

How can I parse a clist into a keyval prop?

I'm trying to store a comma-separated list into a key-value property to use it later, but I can't get it to work properly. I don't really understand how latex parses a keyval parameter but my guess is ...
Roäc's user avatar
  • 35
12 votes
6 answers
2k views

How can I create a comma-separated list of characters from a text string?

How can I split the string Hello World! - stored into a macro \def\mystring{Hello Word!} - into a comma-separated list of characters (including spaces) which can be used as argument of a \foreach loop ...
zetyty's user avatar
  • 777
1 vote
1 answer
146 views

expl3: Print a polynomial out of coefficients stored in a row of CSV file

Following up this answer, how to robustly use the values stored in \getRow as coefficients of a polynomial to be printed? Also, I need to have an argument of the symbol to be used in the polynomial. (...
Diaa's user avatar
  • 9,649
1 vote
2 answers
234 views

Creating a table from a comma separated list in LaTeX3

I have a comma separated list and want to create a table from it, like so: \documentclass[margin=0.1cm]{standalone} \usepackage{expl3} \begin{document} \begin{tabular}{c | c} \...
palkonimo's user avatar
  • 113
4 votes
2 answers
195 views

How to use \clist_map_tokens:Nn?

p. 175: \clist_map_tokens:Nn⟨clist var⟩{⟨code⟩} calls ⟨code⟩{⟨item⟩} for every ⟨item⟩stored in the ⟨comma list⟩. If the ⟨code⟩consists of a single function this is equivalent to \clist_map_function:nN....
Erwann's user avatar
  • 2,120
0 votes
1 answer
55 views

Expansion while processing math in lists with xparse

I'm trying to "print" a comma-separated list of strings. The actual use case is more complex, the list being stored as a key-value, but the MWE below shows the problem: when I add math to ...
steve's user avatar
  • 2,164
2 votes
1 answer
265 views

Latex3 and \foreach: Do common operation over list of clist variables

I am trying to learn LaTeX3. In writing one of my projects I faced a situation in which is usefull working with short comma-separated lists, testing whether they are empty, have only one item, etc ... ...
Tomáš Kruliš's user avatar
1 vote
1 answer
80 views

How to Shift Comma Inside Closing Quotes in Index

Consider the MWE \documentclass{book} \usepackage{imakeidx} \makeindex \usepackage{idxlayout} \usepackage{xcolor} % Make all page numbers in index bold \let\oldindex\index \renewcommand{\index}[1]{% ...
DDS's user avatar
  • 8,986
0 votes
1 answer
232 views

Adding comma if exactly two authors from *.bst file (bibtex)

I'm using bibtex with a custom .bst file for the thesis. Unfortunately, the .bst file doesn’t produce a comma separating the author names when there are only two authors, and I need to add this comma. ...
michael samwel's user avatar
2 votes
2 answers
146 views

LaTeX3: Parse CSV list stored in macro

This question is kind-of follow-up to answer given to this question: How to iterate over a comma separated list? The difference is, that I want to iterate over a csv list stored in a macro \myTerms. ...
Tomáš Kruliš's user avatar
2 votes
1 answer
161 views

Mapping a expl3 clist to a list of command sequences

I am trying to map a clist to a clist of command sequences using \csname \endcsname and then using clist_use to print the list: Here is the MWE: \documentclass{article} \usepackage{xparse} \...
user39714's user avatar
  • 167
2 votes
3 answers
121 views

How to get the first length in a list

I need to get the first length in a list of lengths and store it in a variable. This is what I got so far: \documentclass[12pt,a4paper]{article} \newlength{\mylength} %% does not work at all %\...
Jander's user avatar
  • 1,138
2 votes
1 answer
43 views

Modifying a list and passing it to another command

I am trying to write some macros to easy my life while writing mathematics in LaTeX. For this, I would like to have some macros to write wedge products in a more concise manner. I have a command which ...
D Hoekstra's user avatar
4 votes
2 answers
126 views

Define macros from a list processed by the listofitems package

I wanted to distinguish the control variables of different agents in a separate color so that my students can read examples more easily. To do so, I wanted to write a macro \definevar{x,y;z} that I ...
S. Olafsson's user avatar
1 vote
1 answer
737 views

A problem with the listofitems package

Using MiKTeX 2.9 on Windows 10 I've run into a problem with listofitmes. In the code shown: % arara: xelatex: { shell: true } \documentclass{article} \usepackage{fontspec} \usepackage{...
hsmyers's user avatar
  • 1,531
8 votes
3 answers
270 views

User friendly array definition macro

I am working on a custom documentclass where there may be one or multiple authors in a document. Normally, one would simply specify \author{} and call some additional macros to set some special values,...
bp99's user avatar
  • 605
4 votes
2 answers
279 views

Feeding a list into a tabular with listofitems

I am using listofitems package to parse a list. Then I want to feed the result into a table (with particular details depending on the items indices). As the first step, I tried to just iterate over ...
Andrei Smolensky's user avatar
2 votes
2 answers
194 views

Process Comma Separated List from Key Value (expl3)

I'm trying to \SplitList / \ProcessList a clist set in a wrapper command's argument as the value of a key. Unfortunately, it seems that the original command (\mycmd below) doesn't recognize the input ...
steve's user avatar
  • 2,164
3 votes
2 answers
108 views

Parsing non-comma-separated lists in TikZ environment

In this answer I saw that we can use [<new pgf key>/.code={...}, <new pgf key>] to smuggle in some code into the construction of a TikZ path. This approach works if all coordinates have a ...
S. Olafsson's user avatar
11 votes
6 answers
842 views

Command with arguments separated by comma II (typically an easy way to write matrices)

Since I am using 2 x 2 matrices very frequently, I would like to define a command which would work like this: \matr{a, b, c, d} would produce $\begin{pmatrix} a & b \\ c & d \end{pmatrix}$. Of ...
Watson's user avatar
  • 932
1 vote
1 answer
112 views

Evaluate each element in a computed comma separated list

I have a permutated list which I sort, which I then use as shades for some TikZ figures. \documentclass{article} \usepackage{expl3, tikz} \ExplSyntaxOn \clist_new:N \l_my_clist \NewDocumentCommand{\...
Luc Pellissier's user avatar
1 vote
1 answer
127 views

Iterating over two lists of text elements (or a list of pairs)

Let's assume I have two lists of text elements - L1,L2,L3,...,Ln and R1,R2,R3,...Rn - or a list of pairs - (L1,R1),(L2,R2),(L3,R3),...,(Ln,Rn). I want to iterate over them in order to produce an ...
Laércio de Sousa's user avatar
2 votes
1 answer
381 views

Create a nested comma-separated-list from a CSV file

In my Latex document I define a nested list that looks like this: \def\recipes{ { test1@ test2@ test3@ test4@ test5a*test5b@ test6a*test6b }, { test1@ test2@ test3@ test4@ test5a*test5b@ test6a*test6b ...
SCM's user avatar
  • 57
2 votes
1 answer
52 views

Manually add an entry to the list of tracked entries

I feel like I'm missing something simple, but I can't manage to write a macro to manually add an entrykey to the list of tracked entries in biblatex such that \ifciteseen will be true. What am I doing ...
David Purton's user avatar
1 vote
1 answer
236 views

How to auto-complete with comma-separated citations?

I am using TexMaker and I want my editor to auto-complete the \parencite{} command for biblatex for any number of arguments. I already added \parencite{#bib#} in User > customize Completion, but I ...
Olivier Melançon's user avatar
2 votes
2 answers
214 views

Get results for multiple audiences at once

I had previously used the multiaudience package without any problem. But now I have a document with multiple audiences and I need to get the result for two audiences at once. I have 5 audiences, ...
Roberto Delgado's user avatar
5 votes
5 answers
209 views

Pairing items from two comma-separated lists into a single list

How to pair items from two comma-separated lists (assuming they have the same length) in another list? I did my best looking for the answer before asking… so I do hope this is not a duplicate! For ...
João Lourenço's user avatar
0 votes
1 answer
95 views

How to get rid of last comma

I am using the following code to print a list of all characters that say something in a given scene of a play-script. \newcommand\sceneroles[2][Roles]{% \def\scenename{#2}% \textbf{#1}:% \Bind{?...
Tobi's user avatar
  • 255
0 votes
1 answer
138 views

Remove last comma in list of birthdays in each day of calendar (tikz)

I am adopting this calendar (https://texample.net/tikz/examples/birthday-calendar/) to my needs, but I have a problem I cannot solve on my own. In each single day grid, how can I get rid of the last ...
Stefan Drückler's user avatar
2 votes
1 answer
126 views

Creating dynamic list variable with repeat command

I need to create a list in LaTeX with n people and their respective sex: \adduser[M]{Pedro Jose} \adduser[M]{John Scar} \adduser[F]{Leila Brew} ... \adduser[F]{Larissa Yik} When I compile it using ...
EVANDSON DANTAS's user avatar
0 votes
0 answers
90 views

Define a new command to wrap \cref

I am typesetting an MCQ exam paper. There are a few questions where there exists a block of information, and the student is prompted to use that information to answer several questions that follow, ...
SRSR333's user avatar
  • 568
0 votes
0 answers
310 views

Are there 'general' journal abbreviation files/packages for BibTeX/LaTeX? or: Can BibTeX/LaTeX use lists from Endnote (Mendeley, JabRef)?

Many publishers ask for abbreviations for journal names in the bibliography. I have checked the links which either need to build the list from the start: is there a tool , or is there a transparent ...
miya's user avatar
  • 43