{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
1answer
220 views

Compare two comma separated lists

Hi I would like to compare two comma separated lists. \documentclass[a4paper]{article} \usepackage{comment} \usepackage{ifthen} \usepackage{xargs} \usepackage{xkeyval} \usepackage{xfor} ...
2
votes
1answer
512 views

Place symbols/nodes at intersection between an arc and some horizontal lines with \foreach in TikZ

I'd like to place an symbol I've defined at all the intersection point between an arc and some horizontal lines: I know how to use \foreach for other cases, but I'm really not sure how to setup the ...
2
votes
1answer
41 views

Tabbing environment with automatic tab stops

I'm attempting to define a custom tabbing environment which allows me to align subsequent lines of text with elements in a previously generated block which cannot be inside the tabbing environment. ...
2
votes
3answers
318 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
63 views

\foreach in pgfplots [duplicate]

My final goal is to create a groupplot with 10*10 figures. I here have reduced the problem so that it will be easier to explain. First, I have created some dummy data which I store in test.txt and it ...
2
votes
0answers
173 views

Iterating through a character/string array in LaTeX

I have an array of strings, and am trying to output each element into LaTeX. I am able to achieve that using the following code: \documentclass[12pt,english,nohyper]{tufte-handout} ...
2
votes
0answers
128 views

dynamically generating tabular columns

Consider a table (regular tabular environment) with a fixed number of columns. I want to create a command that accepts a comma-separated list of strings, where the number of strings may differ between ...
2
votes
0answers
64 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
2answers
64 views

Loop over a list with delimiter different from comma

I am trying to iterate over a list, the delimiter of which is not a comma. The reason for not using commas as delimiters is that they are part of the payload. Is there a way to iterate over a list in ...
1
vote
1answer
78 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
2answers
58 views

Converting a number into a character and then using it in a filename

I am trying to create a loop that will print out a list of image files. All of these image files have a filename like this: fa-x.jpg (where x is a character from a - h). I've made a loop, but the ...
1
vote
1answer
69 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} ...
1
vote
1answer
32 views

Defining newtheorems using loops

I would like to define Theorem x.y say x,y are integers between 1 and 20. Then, I need to write 400 sentences like \newtheorem*{theorem1.1}{Theorem 1.1}. EDIT: I'm typping some old book in a ...
1
vote
2answers
47 views

Tables and equations in a 2 column paper

I am trying to write a paper with 2 columns and I need to insert tables and formulas in it, however, they are not fitting. Is there a way how to make these shrink to fit the page size? MWE: WIC is ...
1
vote
1answer
330 views

In-line graphics in text to represent a loading bar for language skills in a CV

I would like to add my language skills to my CV in the following manner: I could of course create an image in Inkscape for every language, and put it in in a most straightforward way, maybe as ...
1
vote
1answer
158 views

Text on rectangular spiral with automatic sizing to fill page

I'm wondering how this could be done in TeX: This is along the lines of Text spirals with TikZ but in a rectangle, with all text the same size, and all text should be at right angles (unlike the ...
1
vote
1answer
56 views

How to building on pstricks the flowchart shape?

I need to building several flowcharts with pstricks and I have problems to get the symbol as the below. Can somebody help me? \newcommand\psBucler[3]{% \pspolygon(-1,0.1)(1.2,0.1)(1.2,1)(-1,1) % ...
1
vote
1answer
186 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
293 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
17 views

How to create looped output with knitr?

In my thesis, I have found 79 different concepts I need to describe in detail in the appendix. I used R for the analysis, and I want to use knitr for creating that appendix. Each description follows ...
1
vote
0answers
25 views

Produce multiple documents using a loop in LaTex

I want to produce multiple documents in LaTeX. There is a list of values for every document that should be created, in the example it´s \mylist. My first approach was to use the \foreach function to ...
1
vote
0answers
33 views

How we use while loop in latex to input multiple files in main document

I am trying to input multiple files from different directories in my main LaTeX document and I want to use while loop to do that so that all .tex files can be read from a directory. Please give your ...
1
vote
0answers
22 views

Loops within tikz calendar library

(this post is related to this one) Consider the following MWE: \documentclass{report} \usepackage{tikz} \usetikzlibrary{calendar} \newcommand*{\holidays}[1]{% \def\@holidays{#1}% } \holidays{} ...
1
vote
0answers
46 views

Count lines of multiple files (Using minted for formatting.)

I am using minted to show source code in my document like this: \section{Image functions} \inputminted{python}{src/imagefuncs.py} \section{Matrix operations} \inputminted{python}{src/matrices.py} ...
1
vote
0answers
20 views

Looping through elements in a sequence [duplicate]

In a follow up of Highlighting words only the first time they appear it was suggested to use \seq_use:Nn to display the content of a sequence. It works really nice but it concatenates the items with a ...
1
vote
1answer
40 views

\ForEachX and string concatenation

I'm writing a class where I have an arbitrary number of strings that I'd like to concatenate, then loop over and typeset using \ForEachX from the forarray package. If I define a command to add to a ...
1
vote
0answers
129 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
50 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
471 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
2answers
27 views

If condition controlled with a loop variable

I want to print some images according to a variable being changed in a loop: if variable group is 1, then the image should not be printed. But if the value of group is 2, then the image should be ...
0
votes
1answer
29 views

Automatically rotate through image files?

Note: this is NOT about rotating the image itself. In my book I have a bunch of decorative vignettes like this: , , and so on.... And I created a command for it: ...
0
votes
1answer
52 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
146 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
380 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
44 views

Variable font size of a text string

I was wondering if it is possible to use \fontsize{<size>}{<line space>} in a loop in order to create a text string of strictly decreasing/increasing font size from, say, 30 to 2. Surely ...
0
votes
0answers
88 views

Take input from csv file and use it to create a custom-made table in tikz

I have a csv file that looks like this: Scott, William, Todd,Esben, Martin, Jesper, Alexander W.L Right now, the names are written this line \aebuildtable{20}{Scott,William,Todd,Esben, Martin, ...
0
votes
0answers
34 views

How to cite this in revtex4-1?

I have trouble to achieve the following citation style: Tam, K. C. , M. L. Farmer , R. D. Jenkins , and D. R. Bassett It's not standard APA or MLA styles.
0
votes
0answers
46 views

How to load input file with given starting string but unknown end?

In the directory of my latex source there are input files: input_01.tex, input_02.tex, etc. It is very easy to load them with a for cycle. But how to load them if their names are: ...
0
votes
0answers
145 views

`pdfpages` `\includepdf`'s page list input options

I'd like to use pdfpages to make a print layout of my documents, in order to print them in A4 paper, but with 2 pages per page. The problem is setting the page order in a way I can cut the printed A4 ...