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
0 answers
13 views

I need just the number of chapters to appear in the header, and not the chapter word and the number

I enclosed three pictures of the notes of my work. I numbered the notes inside red squares. 1- The first note, in page one, I need the title of each chapter to be higher than it should be in this ...
user avatar
  • 1
3 votes
1 answer
73 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 ...
user avatar
  • 35
11 votes
5 answers
890 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 ...
user avatar
0 votes
1 answer
98 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. (...
user avatar
  • 8,759
1 vote
2 answers
112 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} \...
user avatar
  • 113
4 votes
2 answers
71 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....
user avatar
  • 1,868
0 votes
1 answer
46 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 ...
user avatar
  • 1,944
2 votes
1 answer
72 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 ... ...
user avatar
1 vote
1 answer
44 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]{% ...
user avatar
  • 4,841
0 votes
1 answer
27 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. ...
user avatar
0 votes
1 answer
51 views

Splitting comma separed by comma

I'm using two indexes to build a bilingual glossary. Some words have two or more equivalent in the target language, so I should separate those equivalent in the target index. For example: the word -...
user avatar
2 votes
2 answers
80 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. ...
user avatar
1 vote
1 answer
41 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} \...
user avatar
  • 157
2 votes
3 answers
73 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 %\...
user avatar
  • 830
2 votes
1 answer
33 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 ...
user avatar
4 votes
2 answers
83 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 ...
user avatar
1 vote
1 answer
240 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{...
user avatar
  • 1,473
8 votes
3 answers
206 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,...
user avatar
  • 585
4 votes
2 answers
116 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 ...
user avatar
2 votes
2 answers
79 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 ...
user avatar
  • 1,944
3 votes
2 answers
76 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 ...
user avatar
11 votes
6 answers
435 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 ...
user avatar
  • 747
1 vote
1 answer
65 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{\...
user avatar
1 vote
1 answer
80 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 ...
user avatar
2 votes
1 answer
209 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 ...
user avatar
  • 57
2 votes
1 answer
35 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 ...
user avatar
  • 23.6k
1 vote
1 answer
133 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 ...
user avatar
2 votes
2 answers
95 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, ...
user avatar
5 votes
5 answers
105 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 ...
user avatar
0 votes
1 answer
36 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{?...
user avatar
  • 245
0 votes
1 answer
67 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 ...
user avatar
2 votes
1 answer
79 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 ...
user avatar
0 votes
0 answers
46 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, ...
user avatar
  • 488
0 votes
0 answers
179 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 ...
user avatar
  • 33
2 votes
1 answer
216 views

How to create comma separated list as the argument of a macro or command?

In the following MWE, I tried to create a command (but I also tried with a macro) that receives #1 argument. In this case, I am trying to create a comma separated list. However, as shown in the figure ...
user avatar
  • 1,174
4 votes
1 answer
420 views

How to get the index variable in the foreach loop

I have the following MWE: \documentclass{article} \usepackage{pgf, tikz} \setlength{\parskip}{0.5cm} \begin{document} \textbf{Comprehensive knowledge storage follows the evolutionary sequence given ...
user avatar
  • 1,174
2 votes
1 answer
66 views

Macro to apply a custom command to a conditional datatool definition

This is somewhat of an expansion of the previous question:Macro to apply a custom command across a comma-separated list I'm working on creating a garden journal in LaTex. I have a .csv database file ...
user avatar
  • 77
1 vote
2 answers
77 views

datatool DTLgetvalue using foreachitem

The following code is supposed to get values from the first row of mydata.csv and then copy values to a new empty row. I am using foreachitem to pass the key to the DTLgetvalue function. It compiles, ...
user avatar
  • 21
4 votes
4 answers
555 views

Building and using a list

I made a macro for subtracting two lists which does what was intended. Then, I found a set-up, here on TeX.SE, with the macro \g@addto@macro and \@gobble which is much simpler and gives, in principle, ...
user avatar
2 votes
3 answers
558 views

Read csv values as key-value pairs [duplicate]

I have a csv file that contains the following: "N","n","M" 200,100,50 How can I read it with LaTeX such that \N, \n_trees and \M then returns respectively 200, 100 and 50 ? Or some other internal ...
user avatar
  • 123
3 votes
2 answers
192 views

Automatically use \cr or & (for matrices) in macro?

I'm trying to write a macro to abstract different possible representations of matrices. In particular, we're changing whether we want to represent a particular matrix as a column or row vector. My ...
user avatar
  • 83
1 vote
1 answer
252 views

Providing command key-value arguments with commas in value

When using commands that allow using key-value pairs, how can one provide an argument value that has commas in it? As an example, say I'm using the \newacronym command from the glossaries package as ...
user avatar
  • 473
0 votes
0 answers
43 views

How to use macro as a `foreach` range? [duplicate]

These two loops do not produce the same result: \documentclass{article} \usepackage{tikz} \begin{document} \foreach \i in {a,b,c} {% \i+ } \def\Index{a,b,c} \foreach \i in {\Index} {% \i+ ...
user avatar
  • 1,423
5 votes
2 answers
223 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 ...
user avatar
  • 12.8k
7 votes
1 answer
185 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 ...
user avatar
  • 173
3 votes
2 answers
98 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} \...
user avatar
  • 3,616
2 votes
2 answers
297 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 \...
user avatar
  • 3,616
2 votes
1 answer
55 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} ...
user avatar
  • 3,616
4 votes
2 answers
159 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 ...
user avatar
  • 929
12 votes
1 answer
257 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 ...
user avatar
  • 1,423