{loops} is about looping constructs which allow a programmer to apply the same operation multiple times, each time with possibly different parameters.

learn more… | top users | synonyms (1)

2
votes
3answers
203 views

Process Last Item in \ForEach (forarray package)

The following command of the forarray package \ForEach{,}{\thislevelitem(\the\thislevelcount) : }}{x,y,z} produces the output x(1) : y(2) : z(3) : I want to have the same output without the last ...
2
votes
0answers
55 views

Passing an array type argument for new command

I've looked around and can't seem to find anywhere, but I was wondering if there is somewhere you can do something like the following: \newcommand{\loopy}[1]{ \begin{tikzpicture} \foreach ...
2
votes
0answers
52 views

Using a for loop to loop through sequentially named tex files [closed]

I'd like to loop through all .tex files in a directory using code that looks like the following: \documentclass{article} \usepackage[hmargin=1cm,vmargin=1cm]{geometry} \usepackage{pdflscape} ...
1
vote
1answer
45 views

Centering a table of images

I'm trying to center a table of images; 2 images per table row. Right now the code I have is ugly, and doesn't center on the document. I've tried using \begin{center} and \centering without any luck. ...
1
vote
1answer
200 views

Looping and linking with TikZ

How would you build a grid using a nested foreach, defining one node for each iteration? If I were coding in Python, I would write: nodes = {} for i in range(10): for j in range(5): ...
1
vote
1answer
1k views

How do I add parfor in algorithmic environment?

I want to have a parfor loop in my algorithm listing (it should work exactly as standard for loop works). How to either change the displayed name of for loop or add my own loop which will keep the ...
1
vote
1answer
50 views

\pgfdeclareshape: how to define anchors in a loop?

I think my question is quite similar to this and this, however I didn't manage to modify the provided solutions to fit my problem. In the following MWE I am trying to define 8 pin anchors in a ...
1
vote
1answer
44 views

Loop through table for boxplot prepared

I am trying to produce figure with 2 boxplot prepared plots from an inline data file. I grabbed this code from here to use as a starting point. Given that the wrapper code allows the boxplot data to ...
1
vote
0answers
74 views

array and loop to set frametitle, subsection, and text

In the example below, I store text into three variables (\subTa, \subTb, \subTc), and then use these variables to set the subsection, set the frametitle, and display text on each slide, all using ...
1
vote
0answers
30 views

Label of figure in a for loop

I am adding figures to my TeX file using the following code: \foreach \paramA in {a,b,c} { \foreach \paramB in {1,2,3} { \begin{figure} \addOneImage{pathToImage/imageName_\paramA_batch\paramB.png} ...
1
vote
0answers
46 views

Loop to include multiple files [duplicate]

Possible Duplicate: How to iterate through the name of files in a folder I would like to include all the *.tex files from a directory in a document. To avoid me having to add manually the ...
1
vote
0answers
442 views

Generate trees based on number of nodes and children allowed [closed]

I am doing an experiment, and would like to generate images of Binary Trees and Exponential Trees using LaTeX. The difference between these two structures is the number of children allowed per node ...
0
votes
1answer
31 views

Forloop macro does not work with other macro in condtion

This is my primative code: \documentclass{article} \usepackage{xstring} \usepackage{ifthen} \usepackage{pgfkeys} \newcommand{\setvalue}[1]{\pgfkeys{/variables, #1}} ...
0
votes
1answer
51 views

exsheet print several exams same document

How to print several exams in the same document using exsheets? I need to print several exams using \includequestions[random=1]{easy} \includequestions[random=1]{medium} ...
0
votes
2answers
308 views

Environment with customizable number of table columns

I want to make macros for drawing group of questions with same answers with customizable text, number of answers and design (column widths, alignment, etc.), like this: ...
0
votes
0answers
17 views

Figures in latex using loop [duplicate]

To put maximum of 6 figures in 3 rows & 2 columns in a A4 page using loop, I tried like: \foreach \x in {1,2,3,4,5,6,7,8,9,10,11,12} { \begin{figure}[h] \caption{This is the caption.} ...