Help to understand a simple example of clist in expl3PDF keywords from Expl3 clistUse expl3 variable decimal...

Would "lab meat" be able to feed a much larger global population

Why is C# in the D Major Scale?

A non-technological, repeating, phenomenon in the sky, holding its position in the sky for hours

How to improve/restore vintage Peugeot bike, or is it even worth it?

How to 'Let Go' in Meditation?

Why is B♯ higher than C♭ in 31-ET?

60s (or earlier) SF short story with FTL Travel using electron psychology aka addiclenendar technology

Which industry am I working in? Software development or financial services?

Has any spacecraft ever had the ability to directly communicate with civilian air traffic control?

Accidentally deleted the "/usr/share" folder

Why is Arya visibly scared in the library in S8E3?

Selecting a secure PIN for building access

Casual versus formal jacket

How could a planet have most of its water in the atmosphere?

What is the most remote airport from the center of the city it supposedly serves?

Why was the battle set up *outside* Winterfell?

Would glacier 'trees' be plausible?

Do I have to make someone coauthor if he/she solves a problem in StackExchange, asked by myself, which is later used in my paper?

How do I tell my manager that his code review comment is wrong?

Why wasn't the Night King naked in S08E03?

Returning the outputs of a nested structure

Is induction neccessary for proving that every injective mapping of a finite set into itself is a mapping onto itself?

What are the differences between credential stuffing and password spraying?

Would a 1/1 token with persist dying trigger on death effects a second time?



Help to understand a simple example of clist in expl3


PDF keywords from Expl3 clistUse expl3 variable decimal representation outside of expl3 blockHow is expl3 typed?expl3: How to remove the final comma in a clist mappingexpl3: Expand every item once when adding to a clistexpl3 variables and functionsexpl3 empty token listclist and hyperrefExample packages using expl3expl3 property list values as `clist` vs token lists













1















Sorry if my question is elemental. I have start learning LaTeX a month ago. I'm learning at the same time as have new ideas. That being said, someone could help me to understand a simple example of clist in expl3? What's wrong with this code?



documentclass{article}
usepackage{xparse}

ExplSyntaxOn

NewDocumentCommand{DeclareListOfValues}{ m m }
{
clist_new:N g_list_of_values_#1
clist_set:Nn g_list_of_values_#1 {#2}
}

NewDocumentCommand{GetValueFromList}{ m m }
{
clist_item:Nn g_list_of_values_#1 {#2}
}

ExplSyntaxOff

DeclareListOfValues{FirstList}{1.11, 1.22}

begin{document}
GetValueFromList{FirstList}{2} % -> 1.22
end{document}


I would appreciate any help.










share|improve this question


















  • 1





    Use the c variants instead of N, i.e. clist_new:c {g_list_of_values_#1} etc.

    – Henri Menke
    4 hours ago


















1















Sorry if my question is elemental. I have start learning LaTeX a month ago. I'm learning at the same time as have new ideas. That being said, someone could help me to understand a simple example of clist in expl3? What's wrong with this code?



documentclass{article}
usepackage{xparse}

ExplSyntaxOn

NewDocumentCommand{DeclareListOfValues}{ m m }
{
clist_new:N g_list_of_values_#1
clist_set:Nn g_list_of_values_#1 {#2}
}

NewDocumentCommand{GetValueFromList}{ m m }
{
clist_item:Nn g_list_of_values_#1 {#2}
}

ExplSyntaxOff

DeclareListOfValues{FirstList}{1.11, 1.22}

begin{document}
GetValueFromList{FirstList}{2} % -> 1.22
end{document}


I would appreciate any help.










share|improve this question


















  • 1





    Use the c variants instead of N, i.e. clist_new:c {g_list_of_values_#1} etc.

    – Henri Menke
    4 hours ago
















1












1








1








Sorry if my question is elemental. I have start learning LaTeX a month ago. I'm learning at the same time as have new ideas. That being said, someone could help me to understand a simple example of clist in expl3? What's wrong with this code?



documentclass{article}
usepackage{xparse}

ExplSyntaxOn

NewDocumentCommand{DeclareListOfValues}{ m m }
{
clist_new:N g_list_of_values_#1
clist_set:Nn g_list_of_values_#1 {#2}
}

NewDocumentCommand{GetValueFromList}{ m m }
{
clist_item:Nn g_list_of_values_#1 {#2}
}

ExplSyntaxOff

DeclareListOfValues{FirstList}{1.11, 1.22}

begin{document}
GetValueFromList{FirstList}{2} % -> 1.22
end{document}


I would appreciate any help.










share|improve this question














Sorry if my question is elemental. I have start learning LaTeX a month ago. I'm learning at the same time as have new ideas. That being said, someone could help me to understand a simple example of clist in expl3? What's wrong with this code?



documentclass{article}
usepackage{xparse}

ExplSyntaxOn

NewDocumentCommand{DeclareListOfValues}{ m m }
{
clist_new:N g_list_of_values_#1
clist_set:Nn g_list_of_values_#1 {#2}
}

NewDocumentCommand{GetValueFromList}{ m m }
{
clist_item:Nn g_list_of_values_#1 {#2}
}

ExplSyntaxOff

DeclareListOfValues{FirstList}{1.11, 1.22}

begin{document}
GetValueFromList{FirstList}{2} % -> 1.22
end{document}


I would appreciate any help.







expl3






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 4 hours ago









GRSousaJrGRSousaJr

3427




3427








  • 1





    Use the c variants instead of N, i.e. clist_new:c {g_list_of_values_#1} etc.

    – Henri Menke
    4 hours ago
















  • 1





    Use the c variants instead of N, i.e. clist_new:c {g_list_of_values_#1} etc.

    – Henri Menke
    4 hours ago










1




1





Use the c variants instead of N, i.e. clist_new:c {g_list_of_values_#1} etc.

– Henri Menke
4 hours ago







Use the c variants instead of N, i.e. clist_new:c {g_list_of_values_#1} etc.

– Henri Menke
4 hours ago












1 Answer
1






active

oldest

votes


















3














You can't just tack #1 on to the end of a variable name. Instead you should use clist_new:c, which takes a "command name". Although not mandatory, the recommended style is to end your clist varaible names with clist.



Here is a corrected version of your code.



documentclass{article}
usepackage{xparse}

ExplSyntaxOn

NewDocumentCommand{DeclareListOfValues}{ m m }
{
clist_new:c {g_list_of_values_#1_clist}
clist_set:cn {g_list_of_values_#1_clist} {#2}
}

NewDocumentCommand{GetValueFromList}{ m m }
{
clist_item:cn {g_list_of_values_#1_clist} {#2}
}

ExplSyntaxOff

DeclareListOfValues{FirstList}{1.11, 1.22}

begin{document}
GetValueFromList{FirstList}{2} % -> 1.22
end{document}





share|improve this answer
























  • Works perfectly!

    – GRSousaJr
    3 hours ago












Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f488512%2fhelp-to-understand-a-simple-example-of-clist-in-expl3%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









3














You can't just tack #1 on to the end of a variable name. Instead you should use clist_new:c, which takes a "command name". Although not mandatory, the recommended style is to end your clist varaible names with clist.



Here is a corrected version of your code.



documentclass{article}
usepackage{xparse}

ExplSyntaxOn

NewDocumentCommand{DeclareListOfValues}{ m m }
{
clist_new:c {g_list_of_values_#1_clist}
clist_set:cn {g_list_of_values_#1_clist} {#2}
}

NewDocumentCommand{GetValueFromList}{ m m }
{
clist_item:cn {g_list_of_values_#1_clist} {#2}
}

ExplSyntaxOff

DeclareListOfValues{FirstList}{1.11, 1.22}

begin{document}
GetValueFromList{FirstList}{2} % -> 1.22
end{document}





share|improve this answer
























  • Works perfectly!

    – GRSousaJr
    3 hours ago
















3














You can't just tack #1 on to the end of a variable name. Instead you should use clist_new:c, which takes a "command name". Although not mandatory, the recommended style is to end your clist varaible names with clist.



Here is a corrected version of your code.



documentclass{article}
usepackage{xparse}

ExplSyntaxOn

NewDocumentCommand{DeclareListOfValues}{ m m }
{
clist_new:c {g_list_of_values_#1_clist}
clist_set:cn {g_list_of_values_#1_clist} {#2}
}

NewDocumentCommand{GetValueFromList}{ m m }
{
clist_item:cn {g_list_of_values_#1_clist} {#2}
}

ExplSyntaxOff

DeclareListOfValues{FirstList}{1.11, 1.22}

begin{document}
GetValueFromList{FirstList}{2} % -> 1.22
end{document}





share|improve this answer
























  • Works perfectly!

    – GRSousaJr
    3 hours ago














3












3








3







You can't just tack #1 on to the end of a variable name. Instead you should use clist_new:c, which takes a "command name". Although not mandatory, the recommended style is to end your clist varaible names with clist.



Here is a corrected version of your code.



documentclass{article}
usepackage{xparse}

ExplSyntaxOn

NewDocumentCommand{DeclareListOfValues}{ m m }
{
clist_new:c {g_list_of_values_#1_clist}
clist_set:cn {g_list_of_values_#1_clist} {#2}
}

NewDocumentCommand{GetValueFromList}{ m m }
{
clist_item:cn {g_list_of_values_#1_clist} {#2}
}

ExplSyntaxOff

DeclareListOfValues{FirstList}{1.11, 1.22}

begin{document}
GetValueFromList{FirstList}{2} % -> 1.22
end{document}





share|improve this answer













You can't just tack #1 on to the end of a variable name. Instead you should use clist_new:c, which takes a "command name". Although not mandatory, the recommended style is to end your clist varaible names with clist.



Here is a corrected version of your code.



documentclass{article}
usepackage{xparse}

ExplSyntaxOn

NewDocumentCommand{DeclareListOfValues}{ m m }
{
clist_new:c {g_list_of_values_#1_clist}
clist_set:cn {g_list_of_values_#1_clist} {#2}
}

NewDocumentCommand{GetValueFromList}{ m m }
{
clist_item:cn {g_list_of_values_#1_clist} {#2}
}

ExplSyntaxOff

DeclareListOfValues{FirstList}{1.11, 1.22}

begin{document}
GetValueFromList{FirstList}{2} % -> 1.22
end{document}






share|improve this answer












share|improve this answer



share|improve this answer










answered 4 hours ago









AndrewAndrew

31.8k34583




31.8k34583













  • Works perfectly!

    – GRSousaJr
    3 hours ago



















  • Works perfectly!

    – GRSousaJr
    3 hours ago

















Works perfectly!

– GRSousaJr
3 hours ago





Works perfectly!

– GRSousaJr
3 hours ago


















draft saved

draft discarded




















































Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f488512%2fhelp-to-understand-a-simple-example-of-clist-in-expl3%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

Nicolae Petrescu-Găină Cuprins Biografie | Opera | In memoriam | Varia | Controverse, incertitudini...