Use array/list/sequence for repetitive code?Refactoring TeX/LaTeX codeUse a loop to generate a list for...

What is a good reason for every spaceship to carry a weapon on board?

Move fast ...... Or you will lose

What is the most fuel efficient way out of the Solar System?

Odd 74HCT1G125 behaviour

Why avoid shared user accounts?

Do authors have to be politically correct in article-writing?

How can I play a serial killer in a party of good PCs?

Can you tell from a blurry photo if focus was too close or too far?

What are "industrial chops"?

Difference between i++ and (i)++ in C

Why are the books in the Game of Thrones citadel library shelved spine inwards?

If I delete my router's history can my ISP still provide it to my parents?

It took me a lot of time to make this, pls like. (YouTube Comments #1)

Has any human ever had the choice to leave Earth permanently?

What are the exceptions to Natural Selection?

Graph with overlapping labels

A Missing Symbol for This Logo

Why publish a research paper when a blog post or a lecture slide can have more citation count than a journal paper?

A starship is travelling at 0.9c and collides with a small rock. Will it leave a clean hole through, or will more happen?

Eww, those bytes are gross

Quickly creating a sparse array

Why did Luke use his left hand to shoot?

How to play electric guitar and bass as a duet

How old is the day of 24 equal hours?



Use array/list/sequence for repetitive code?


Refactoring TeX/LaTeX codeUse a loop to generate a list for another (foreach) loopCode for reading Metafont definitionsOptimizing tikz code for less redundanciesHow to code an auto-increment counter in LaTeXcreate list of thumbnails for each sectionHow does one create a counted command (e.g. TODO) for use in a list?Generating array with arrayjob and store values for further analysisHow to iterate a list and do something for each element?Use N type for own macros













0















For a PhD thesis cover template in our university, there is some code as follow:



%%% Jury member n1 (Président) %%%
newcommand{jurynameA}{M. Cabot}
newcommand{juryadressA}{Someplace}
newcommand{jurygradeA}{Somerank}
newcommand{juryroleA}{Président du jury}
%%% Jury member n2 (Rapporteur) %%%
newcommand{jurynameB}{M. Blonde}
newcommand{juryadressB}{Anotherplace}
newcommand{jurygradeB}{Anotherrank}
newcommand{juryroleB}{Rapporteur} %
%%% Jury member n3 (Rapporteur) %%%
newcommand{jurynameC}{M. Blue}
newcommand{juryadressC}{Someotherplace}
newcommand{jurygradeC}{Someotherrank}
newcommand{juryroleC}{Rapporteur}
%%% Jury member n4 (Examinateur) %%%
newcommand{jurynameD}{M. Brown}
newcommand{juryadressD}{Yetanotherplace}
newcommand{jurygradeD}{Yetanotherrank}
newcommand{juryroleD}{Examinateur}
%%% Jury member n5 (Examinateur) %%%
newcommand{jurynameE}{M. Orange}
newcommand{juryadressE}{Onemoreplace}
newcommand{jurygradeE}{One more rank}
newcommand{juryroleE}{Examinateur}
%%% Jury member n6 (Directeur) %%%
newcommand{jurynameF}{M. Pink}
newcommand{juryadressF}{Yourplace}
newcommand{jurygradeF}{HDR}
newcommand{juryroleF}{Directeur de thèse}
%%% Jury member n7 (Co-Directeur) %%%
newcommand{jurynameG}{M. White}
newcommand{juryadressG}{Yourotherplace}
newcommand{jurygradeG}{HDR?}
newcommand{juryroleG}{Co-Directeur de thèse}
begin{tabular}{lll}

textsc{jurynameA} & jurygradeA & (juryroleA) \
null & textit{juryadressA} & \

textsc{jurynameB} & jurygradeB & (juryroleB) \
null & textit{juryadressB} & \

textsc{jurynameC} & jurygradeC & (juryroleC) \
null & textit{juryadressC} & \

textsc{jurynameD} & jurygradeD & (juryroleD) \
null & textit{juryadressD} & \

textsc{jurynameE} & jurygradeE & (juryroleE) \
null & textit{juryadressE} & \

textsc{jurynameF} & jurygradeF & (juryroleF) \
null & textit{juryadressF} & \

textsc{jurynameG} & jurygradeG & (juryroleG) \
null & textit{juryadressG} & \

end{tabular}


I was wondering if it would be possible to input data more easily (something like addmember{M. Pink}{Yourplace}{HDR}{Directeur de thèse}), and then have the table generated automatically without worrying about the number of jury members (some people may have 4 members, some up to 8).



In Python for instance, I would have used a list of dict (or just of lists if I did not care about semantics), each dict describing a jury member, and would have iterated over that list to write the table. Is it possible to do something like that with LaTeX?









share























  • pgfplotstable allows you to typeset a table from a dataset you load.

    – marmot
    2 mins ago
















0















For a PhD thesis cover template in our university, there is some code as follow:



%%% Jury member n1 (Président) %%%
newcommand{jurynameA}{M. Cabot}
newcommand{juryadressA}{Someplace}
newcommand{jurygradeA}{Somerank}
newcommand{juryroleA}{Président du jury}
%%% Jury member n2 (Rapporteur) %%%
newcommand{jurynameB}{M. Blonde}
newcommand{juryadressB}{Anotherplace}
newcommand{jurygradeB}{Anotherrank}
newcommand{juryroleB}{Rapporteur} %
%%% Jury member n3 (Rapporteur) %%%
newcommand{jurynameC}{M. Blue}
newcommand{juryadressC}{Someotherplace}
newcommand{jurygradeC}{Someotherrank}
newcommand{juryroleC}{Rapporteur}
%%% Jury member n4 (Examinateur) %%%
newcommand{jurynameD}{M. Brown}
newcommand{juryadressD}{Yetanotherplace}
newcommand{jurygradeD}{Yetanotherrank}
newcommand{juryroleD}{Examinateur}
%%% Jury member n5 (Examinateur) %%%
newcommand{jurynameE}{M. Orange}
newcommand{juryadressE}{Onemoreplace}
newcommand{jurygradeE}{One more rank}
newcommand{juryroleE}{Examinateur}
%%% Jury member n6 (Directeur) %%%
newcommand{jurynameF}{M. Pink}
newcommand{juryadressF}{Yourplace}
newcommand{jurygradeF}{HDR}
newcommand{juryroleF}{Directeur de thèse}
%%% Jury member n7 (Co-Directeur) %%%
newcommand{jurynameG}{M. White}
newcommand{juryadressG}{Yourotherplace}
newcommand{jurygradeG}{HDR?}
newcommand{juryroleG}{Co-Directeur de thèse}
begin{tabular}{lll}

textsc{jurynameA} & jurygradeA & (juryroleA) \
null & textit{juryadressA} & \

textsc{jurynameB} & jurygradeB & (juryroleB) \
null & textit{juryadressB} & \

textsc{jurynameC} & jurygradeC & (juryroleC) \
null & textit{juryadressC} & \

textsc{jurynameD} & jurygradeD & (juryroleD) \
null & textit{juryadressD} & \

textsc{jurynameE} & jurygradeE & (juryroleE) \
null & textit{juryadressE} & \

textsc{jurynameF} & jurygradeF & (juryroleF) \
null & textit{juryadressF} & \

textsc{jurynameG} & jurygradeG & (juryroleG) \
null & textit{juryadressG} & \

end{tabular}


I was wondering if it would be possible to input data more easily (something like addmember{M. Pink}{Yourplace}{HDR}{Directeur de thèse}), and then have the table generated automatically without worrying about the number of jury members (some people may have 4 members, some up to 8).



In Python for instance, I would have used a list of dict (or just of lists if I did not care about semantics), each dict describing a jury member, and would have iterated over that list to write the table. Is it possible to do something like that with LaTeX?









share























  • pgfplotstable allows you to typeset a table from a dataset you load.

    – marmot
    2 mins ago














0












0








0








For a PhD thesis cover template in our university, there is some code as follow:



%%% Jury member n1 (Président) %%%
newcommand{jurynameA}{M. Cabot}
newcommand{juryadressA}{Someplace}
newcommand{jurygradeA}{Somerank}
newcommand{juryroleA}{Président du jury}
%%% Jury member n2 (Rapporteur) %%%
newcommand{jurynameB}{M. Blonde}
newcommand{juryadressB}{Anotherplace}
newcommand{jurygradeB}{Anotherrank}
newcommand{juryroleB}{Rapporteur} %
%%% Jury member n3 (Rapporteur) %%%
newcommand{jurynameC}{M. Blue}
newcommand{juryadressC}{Someotherplace}
newcommand{jurygradeC}{Someotherrank}
newcommand{juryroleC}{Rapporteur}
%%% Jury member n4 (Examinateur) %%%
newcommand{jurynameD}{M. Brown}
newcommand{juryadressD}{Yetanotherplace}
newcommand{jurygradeD}{Yetanotherrank}
newcommand{juryroleD}{Examinateur}
%%% Jury member n5 (Examinateur) %%%
newcommand{jurynameE}{M. Orange}
newcommand{juryadressE}{Onemoreplace}
newcommand{jurygradeE}{One more rank}
newcommand{juryroleE}{Examinateur}
%%% Jury member n6 (Directeur) %%%
newcommand{jurynameF}{M. Pink}
newcommand{juryadressF}{Yourplace}
newcommand{jurygradeF}{HDR}
newcommand{juryroleF}{Directeur de thèse}
%%% Jury member n7 (Co-Directeur) %%%
newcommand{jurynameG}{M. White}
newcommand{juryadressG}{Yourotherplace}
newcommand{jurygradeG}{HDR?}
newcommand{juryroleG}{Co-Directeur de thèse}
begin{tabular}{lll}

textsc{jurynameA} & jurygradeA & (juryroleA) \
null & textit{juryadressA} & \

textsc{jurynameB} & jurygradeB & (juryroleB) \
null & textit{juryadressB} & \

textsc{jurynameC} & jurygradeC & (juryroleC) \
null & textit{juryadressC} & \

textsc{jurynameD} & jurygradeD & (juryroleD) \
null & textit{juryadressD} & \

textsc{jurynameE} & jurygradeE & (juryroleE) \
null & textit{juryadressE} & \

textsc{jurynameF} & jurygradeF & (juryroleF) \
null & textit{juryadressF} & \

textsc{jurynameG} & jurygradeG & (juryroleG) \
null & textit{juryadressG} & \

end{tabular}


I was wondering if it would be possible to input data more easily (something like addmember{M. Pink}{Yourplace}{HDR}{Directeur de thèse}), and then have the table generated automatically without worrying about the number of jury members (some people may have 4 members, some up to 8).



In Python for instance, I would have used a list of dict (or just of lists if I did not care about semantics), each dict describing a jury member, and would have iterated over that list to write the table. Is it possible to do something like that with LaTeX?









share














For a PhD thesis cover template in our university, there is some code as follow:



%%% Jury member n1 (Président) %%%
newcommand{jurynameA}{M. Cabot}
newcommand{juryadressA}{Someplace}
newcommand{jurygradeA}{Somerank}
newcommand{juryroleA}{Président du jury}
%%% Jury member n2 (Rapporteur) %%%
newcommand{jurynameB}{M. Blonde}
newcommand{juryadressB}{Anotherplace}
newcommand{jurygradeB}{Anotherrank}
newcommand{juryroleB}{Rapporteur} %
%%% Jury member n3 (Rapporteur) %%%
newcommand{jurynameC}{M. Blue}
newcommand{juryadressC}{Someotherplace}
newcommand{jurygradeC}{Someotherrank}
newcommand{juryroleC}{Rapporteur}
%%% Jury member n4 (Examinateur) %%%
newcommand{jurynameD}{M. Brown}
newcommand{juryadressD}{Yetanotherplace}
newcommand{jurygradeD}{Yetanotherrank}
newcommand{juryroleD}{Examinateur}
%%% Jury member n5 (Examinateur) %%%
newcommand{jurynameE}{M. Orange}
newcommand{juryadressE}{Onemoreplace}
newcommand{jurygradeE}{One more rank}
newcommand{juryroleE}{Examinateur}
%%% Jury member n6 (Directeur) %%%
newcommand{jurynameF}{M. Pink}
newcommand{juryadressF}{Yourplace}
newcommand{jurygradeF}{HDR}
newcommand{juryroleF}{Directeur de thèse}
%%% Jury member n7 (Co-Directeur) %%%
newcommand{jurynameG}{M. White}
newcommand{juryadressG}{Yourotherplace}
newcommand{jurygradeG}{HDR?}
newcommand{juryroleG}{Co-Directeur de thèse}
begin{tabular}{lll}

textsc{jurynameA} & jurygradeA & (juryroleA) \
null & textit{juryadressA} & \

textsc{jurynameB} & jurygradeB & (juryroleB) \
null & textit{juryadressB} & \

textsc{jurynameC} & jurygradeC & (juryroleC) \
null & textit{juryadressC} & \

textsc{jurynameD} & jurygradeD & (juryroleD) \
null & textit{juryadressD} & \

textsc{jurynameE} & jurygradeE & (juryroleE) \
null & textit{juryadressE} & \

textsc{jurynameF} & jurygradeF & (juryroleF) \
null & textit{juryadressF} & \

textsc{jurynameG} & jurygradeG & (juryroleG) \
null & textit{juryadressG} & \

end{tabular}


I was wondering if it would be possible to input data more easily (something like addmember{M. Pink}{Yourplace}{HDR}{Directeur de thèse}), and then have the table generated automatically without worrying about the number of jury members (some people may have 4 members, some up to 8).



In Python for instance, I would have used a list of dict (or just of lists if I did not care about semantics), each dict describing a jury member, and would have iterated over that list to write the table. Is it possible to do something like that with LaTeX?







programming





share












share










share



share










asked 7 mins ago









ArchangeArchange

164




164













  • pgfplotstable allows you to typeset a table from a dataset you load.

    – marmot
    2 mins ago



















  • pgfplotstable allows you to typeset a table from a dataset you load.

    – marmot
    2 mins ago

















pgfplotstable allows you to typeset a table from a dataset you load.

– marmot
2 mins ago





pgfplotstable allows you to typeset a table from a dataset you load.

– marmot
2 mins ago










0






active

oldest

votes











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%2f477055%2fuse-array-list-sequence-for-repetitive-code%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















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%2f477055%2fuse-array-list-sequence-for-repetitive-code%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

IEEEtran - How to include ORCID in TeX/PDF with PdfLatexIs there a standard way to include ORCID in TeX /...

Cicindela nigrior Przypisy | Menu nawigacyjneCicindela varians unicolorManual for the Identification of the...

Glossaries-extra: Adding glossaries package to “Clas­sicTh­e­sis” template by Dr. André Miede v. 4.6 ...