Skip to main content

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
1 vote
0 answers
26 views

When a Statement has Two Footnotes---How to Add a Comma? [duplicate]

Consider the code: \documentclass[12pt]{book} \usepackage{lipsum} \begin{document} \thispagestyle{empty} This is a sentence.\footnote{\lipsum[31]} This is a sentence.\footnote{\lipsum[31]}\footnote{\...
DDS's user avatar
  • 10.1k
0 votes
1 answer
37 views

How to return an iterable list from a newcommand for further processing

I have a list defined as, for example: \def\mylist{1,2,3} I need to perform some mathematical operation on every element of the list, and then pass the output to another function that iterates over ...
Uri Barenholz's user avatar
0 votes
0 answers
45 views

How to manipulate lists in LaTeX? I want to get a value from a list based on its numerical index

I want to use the expl3 package to manipulate lists in LaTeX. My goal is to create an empty list called \mylist, fill it with values, and then retrieve a specific value based on a given numerical ...
Cristian Velandia's user avatar
1 vote
1 answer
29 views

Error building a table row from comma separated list when using listofitems package

I am trying to build a table in which a row is built by a function/command call. I can get everything to work if I pass each cell as a separate argument to the command, but that is going to be tedious ...
AeroBuffalo's user avatar
1 vote
1 answer
75 views

Getting the Maximum Width of a List of Items

I'm trying to write a command to get the maximum width of a (comma separated) list of items, for example \myLengthCommand{lorem,ipsum,lorem ipsum} should return the width of the text "lorem ipsum&...
Dave's user avatar
  • 327
2 votes
2 answers
116 views

hyperref warning: Token not allowed in a PDF string - macro Refactoring as a fix

I have a macro that takes a comma-separated list of lists and applies some formatting to it. The list consists of the first and last names of the document's authors. I managed to create a macro - \...
Mycroft_47's user avatar
1 vote
0 answers
44 views

Issues with Misplaced Alignment Tab Character and Table Width in tabularray Environment [duplicate]

I've adapted the code below from this answer to switch from the tabular environment to the tblr environment from the tabularray package. While the original code works perfectly with tabular, I'm ...
Mycroft_47's user avatar
2 votes
3 answers
183 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 } ...
zpding's user avatar
  • 447
2 votes
3 answers
607 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
74 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
  • 543
0 votes
1 answer
73 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,971
0 votes
1 answer
69 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
  • 329
1 vote
1 answer
57 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
  • 329
0 votes
3 answers
56 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
562 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
36 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
198 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,919
0 votes
1 answer
62 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
  • 305
1 vote
1 answer
251 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
  • 3,013
0 votes
0 answers
191 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
870 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
37 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
91 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,652
4 votes
1 answer
354 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
157 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
148 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,699
1 vote
2 answers
257 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
214 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,140
0 votes
1 answer
56 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,301
2 votes
1 answer
295 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
81 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
  • 10.1k
0 votes
1 answer
261 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
152 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
172 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
125 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,160
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
127 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
794 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,573
8 votes
3 answers
282 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
  • 615
4 votes
2 answers
304 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
3 votes
2 answers
211 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,301
3 votes
2 answers
110 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
889 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
  • 984
1 vote
1 answer
118 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
129 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
399 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
  • 26.4k
1 vote
1 answer
245 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