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
0
votes
0answers
24 views

Help With Spacing Correction

In the screenshot below, the spacing after the semi-colons are not identical, and the spacing after some commas are not identical. I have made red circles around the problem i am having. Why is this ...
5
votes
2answers
129 views

Fast membership test for integer lists/sets

Say we have big list of integer numbers, stored as comma-separated values in a macro or token register. Now we want to test in a loop for every integer n = 1, 2, ..., N if n occurs in the list of ...
7
votes
1answer
48 views

Commas in \clist_map_inline:nn split values in undesired places

I am curious about the workings of \clist_map_inline:nn. I have a list of sentences. This list is has no fixed length. Sometimes, the list may contain 2 sentences, or 10 sentences etc. So, I came ...
3
votes
2answers
64 views

Why using a variable as index of a list-item does not retrieve that item with \clist_item:Nn?

For some reason, using a variable as index of a list-item does not work for retrieving that item. But using a number instead of a variable works. Why? \documentclass{standalone} \usepackage{expl3} \...
2
votes
2answers
223 views

How to check if comma list is empty?

How do I check if \myList is empty? Following (is my attempt) prints "NOT empty" when, in fact, the list is empty. \documentclass{standalone} \usepackage{expl3} \begin{document} \ExplSyntaxOn \...
2
votes
1answer
45 views

How to suppress comma list from outputting its values on declaration?

I need to suppress the display of the comma list on its declaration. I just need comma-list variable to store the list, not display it. \documentclass{standalone} \usepackage{expl3} \begin{document} ...
4
votes
2answers
48 views

converting several comma-separated lists into a table, one column per list

I have been searching on here for information about comma separated lists, but the only info I have found is how to sort, or iterate over a single list, which isn't quite what I need. If there is a ...
10
votes
1answer
139 views

Combine `map` and `use` expl3 macros

I'm trying to build a macro that processes a comma-separated-list of elements so that: \MapAndUse{a,b,c} would produce: My first intuition is to use a expl3 combination of \seq_map* to process each ...
6
votes
2answers
59 views

Make a CSV out of a \IfStrEqCase list

I have a macro \DefineStrEqCaseMacro which defines a macro that selects a value based on a parameter. With this, I am trying to replace the manual method: \newcommand*{\SelectBasedOnValue}{beta}% ...
5
votes
4answers
111 views

Command to format any number of equations

I am reading many entries here on comma-separated list of arguments in new commands. I cannot get them to adapt to my needs, so here I come with my question. I'd like a command like so: \eqsRef{equ:...
3
votes
3answers
154 views

Iterate over part of a list

I know that the package etoolbox has a \foreach command. I want to set a list once an use it multiple times. In the example, I would set \mylist equal to the comma separated value list 10,20,30,40,...
2
votes
1answer
99 views

expl3 read a comma list from file

I am using expl3 now, I want to read data from file, and store them in a comma list, then use the comma list one by one. I don't have any code, I just know exp13 have these function, so need someone ...
2
votes
1answer
38 views

No hyperref with a comma separated list and ExplSyntax

I was following the answers to How to iterate over a comma separated list? and especially the way working with ExplSyntax. But the hyperref does not work with the \clist_map_inline:nn however it ...
2
votes
1answer
15 views

Process first or last case differently with clist_map

I wrote this macro to transform a comma-separated list of objects into a custom-separated list of objects: \usepackage{xparse} \ExplSyntaxOn \NewDocumentCommand{\separators}{m}{% \clist_map_inline:...
2
votes
1answer
77 views

How to parse a custom \author format using xparse?

I want to allow using the \author command like this: \author{John Doe <john.doe@example.com>, Someone Else <someone@example.com>} And later parse the value to something like this: \...
0
votes
1answer
71 views

Calling Lua on the output of a \@for loop to add “and” to the end of a comma-separated list

I'm trying to make a package-free command that applies a command across a comma-separated list, and then adds the word ``and'' to the output as is grammatically appropriate. I've already gotten some ...
3
votes
4answers
130 views

Macro to apply a custom command across a comma-separated list

I want to make an apply function that can apply any single-argument command to a comma-separated list of arguments, and print the results separated by commas. (ETA: I want to make the command from ...
1
vote
2answers
119 views

Why is there a conflict between \kern and this Separator & customized-Tooltips command

Because the MWE below uses the line LINE 1: \def\anyX#1{#1} %%% OK it compiles without a hassle. If one replaces LINE 1 with the (also included in the MWE) following line (but uncomment it): LINE ...
2
votes
1answer
92 views

TikZ style with two arguments running through a list

How can I define a style, in which two arguments take pairwise values in a list? In my case, the style is \tikzset{ loop/.style 2 args={decoration={markings, mark=at position {#1} with {\...
0
votes
0answers
30 views

Multiple endnotes at one point [duplicate]

I want to put my footnotes at the end, so I use endnoes (as here: https://tex.stackexchange.com/a/56146/89786). But I would also like to be able to put several endnotes at the same point, just like ...
2
votes
1answer
173 views

Passing comma separated argument from a command to another one

I'm trying to reduce the redundant lines of code of a custom package. I have two commands that do nearly the same thing : one is creating a tabular and fills it with lines, and the other one is just ...
5
votes
2answers
110 views

How can recursive editing of a comma-separated list be handled in expl3?

How can I recursively process a comma-separated list in expl3? How to make a recursive Latex macro with comma separated argument list looks like a (more general) duplicate and offers no fewer than ...
4
votes
1answer
97 views

How to create list and assign it to variable?

I need to create a comma (or any other) separated list of words for further usage and assign it to variable (macro). The words in list should be placed in separate lines. When I use for this purposes \...
2
votes
1answer
200 views

Accessing a list at a certain index

I want to define the following command, which is to render an arbitrary number of subfigures. The argument is a nested list: \multifig{{{fig_1, T0D0, TODO}, {fig_2, T0D0, TODO}}} Is the following ...
4
votes
1answer
72 views

How can I treat items in an expl3 clist as sequences?

According to my lights, the following code should typeset 212. However, my lights are obviously on the dark side as I actually get 111. How can I change the code to work as expected? \documentclass{...
7
votes
2answers
365 views

Handling _ (underscores) in a macro's comma-separated list of arguments

Context: I created a "\citep-like" macro. I use it in the body of my document to refer to some code found in appendix. My macro takes a comma-separated list as input, and prints each element of the ...
1
vote
1answer
94 views

Draw graph using Tikz and forcsvlist from etoolbox

I would like to implement a command \drawColoredGraph which accepts a comma separated list of n colours and draws a graph on the vertices 1,...,n, in which the vertex k is coloured with the colour ...
2
votes
1answer
74 views

Define list for multiple use

I want to repurpose a predefined comma separated list multiple times in the document. As a minimal example, have a look at the following code which does not work as expected: \documentclass{article} ...
1
vote
1answer
212 views

How to fix interference between NewDocumentEnvironment and enumitem package

I'm trying to write a couple of new environments and commands to save short answers from a list with enumerate environment, the idea being to save the first and second level using references to lists ...
1
vote
1answer
113 views

Change the use of label ref by data save in an array (list)

Following the comments of my previous question What is the limit number of \label in a document? After analyzing the comments (@UlrikeFischer, @DavidCarlisle) on memory usage, especially the idea of ...
4
votes
3answers
226 views

How do I extraxt a value from a “key1=value1,key2=value2” list?

I have a comma-separated list of key=value strings. I want to extract the value based on the key. Something a bit like \LookUpValue{c}{a=foo,b=bar,c=baz,d=zyyzx}{error:notfound} The intention is ...
1
vote
3answers
63 views

\@for does not compose with \StrSubstitute

I want to split a space-delimited string into parts and generate code for each part. Apparently TeX works with comma-delimited strings natively so I tried writing an adaptation \usepackage{xstring} ...
3
votes
1answer
69 views

Space added at end of each item parsed from comma-delimited list: how to avoid this?

I am building a package for typesetting Celtic music tunebooks. One feature I make available is the command \altnames, which takes a comma-delimited list of alternate tune names as an argument. ...
1
vote
2answers
59 views

syntax for \in@ and using a macro as an argument

I'm trying to have a command take in a comma separated list early in a document, and then later on test a given comma separated list to see if it contains (exactly) the same elements. Thus; \...
0
votes
1answer
270 views

Beamer boxes with variable sizes and position in frame

I want to to build flexible beamer boxes so that I can change the width and alignment within the frame. Passing the options width= and alignment=, whereas width is a valid value and alignment can be ...
12
votes
4answers
752 views

Sorting a comma-separated list with LaTeX?

Is there a simple way to sort a comma separated list alphabetically in LaTeX? I tried to write a macro (\sortlist{World, Hello} → "Hello, World") using the l3sort documentation example but it ...
4
votes
1answer
191 views

Coding a *short* newcommand with a variable number of arguments for a very specific use-case

Is it possible to create a simple, robust command with a variable number of arguments for the following specific use-case ? Consider \newcommand{\bigmap}[7]{% #1\!\begin{pmatrix}#2\\ #3\\ #4 \end{...
2
votes
2answers
723 views

How define LaTeX command with 2 or 3 arguments in comma-separated list

To avoid typing subscripts and extra parentheses and brackets, I want to define a command, say \disk, that may be used with a comma-separated list of either 2 or 3 arguments, like this: $\disk{r,x}$ $...
5
votes
1answer
62 views

How can I pass a list of values generated in expl3 as a single value for a key to a macro such as \includepdf?

This should probably be obvious but it is not. Or not to me right now, anyway. I want to generate a list of values (e.g. page numbers and empty values) and then pass that list as a value of a key (e....
1
vote
1answer
136 views

Count number of elements in predefined list

Consider the following example: \documentclass{article} \usepackage{xparse} % http://tex.stackexchange.com/a/246924/15874 \ExplSyntaxOn \NewDocumentCommand{\countlist}{m}{\clist_count:n{#1}} \...
7
votes
7answers
2k views

newcommand with comma separated argument, and optional arguments

I want to define a command (not with \def) the simplest possible way that it takes arguments separated by a comma, supports an optional argument (the first one). maybe another solution with extra ...
2
votes
0answers
156 views

How to sort a comma separated list?

Using receipt of How to process a comma separated list?, I elaborated the following code for my needs: \ExplSyntaxOn %\seq_new:N \l_input_seq % declare a list (seq) variable \cs_if_exist:NTF \...
1
vote
2answers
409 views

Membership check on comma separated list [duplicate]

Does anyone know an easy way to check if an item is a member in a comma-separated list? Something like this would be excellent: \ifmember{elem1}{elem1,elem2,elem3}{true}{false} The above would ...
4
votes
1answer
100 views

Why is it impossible to format items of a LaTeX3 comma list?

Trying to adapt the 1st code of this answer in order to format (say in bold) items of a LaTeX3 comma list, I stumbled upon an unexpected error: the following MWE works like a charm: \documentclass{...
2
votes
2answers
237 views

Using comma separated list input to call appropriate command

I imagine this has to be asked somewhere but I've been searching for a while with no luck, so if there is an answer feel free to just direct me there. I have a series of functions that all do ...
4
votes
1answer
290 views

How to iterate over a comma separated list passed through the datatool interface

I'm trying to iterate over a comma separated list that is itself inside a cell in a .csv file, which I'm reading and iterating over with datatool. As per, How do I process a comma separated list ...
1
vote
1answer
88 views

Permuting an index list; and creating an index list of 0's and 1's

I want to run the steps of a loop in random order and also save the order in which the iterations were carried out: \documentclass[english]{article} \usepackage{tikz} \newcommand\...
4
votes
1answer
368 views

ConTeXt xtable split to multiple pages

How to make xtable or TABLE [split=repeat] option to work with comma-separated list? \usemodule[database] \defineseparatedlist [MyTable] [separator=comma, left=\bTD,right=\eTD, first=\bTR,...
1
vote
1answer
66 views

Highlighting items in a list

I'm trying to create a macro where the optional item emboldens an item in the list. I can process the list using the expl3/xparse package and can compare the two strings but I'm having trouble doing ...
2
votes
1answer
117 views

Rearranging \cite arguments

I have the following requirement for my thesis: If I cite multiple citations, I should cite my papers first. The names of all my papers start with “my:”. So I want to define a new command that ...