Questions tagged [for-loop]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
2answers
37 views

How to include many images with a for-loop?

I would like to add many images to my document. The images are located in a folder named ./assets/images/ and are numbered as follows 0.png, 1.png, ..., 100.png. How can I include them using a for-...
3
votes
2answers
75 views

Scan characters in Xe(La)TeX

What I want to do is take a string, slice it up into characters, scan them individually, and produce output. Something like this: \for\char\in#1 \ifx\char\textbackslash ... \fi ... \fi
0
votes
1answer
41 views

How to set a counter like last page, so I can call its LAST value?

I read here on how to extract the value of a counter. So for my generic sols_preamble.tex I want to for example, to be able to do something like printing \foreach \n in {1,...,\theqnumber}{ \n, } ...
4
votes
3answers
204 views

parallel iteration over elements of separate lists

I guess this is a simple problem, but I don't know how to do it in TeX/LaTeX/tikz. What I'd like to do is to iterate over several lists in parallel, and do something with the respective values. One of ...
4
votes
3answers
391 views

Read file contents to variable and iterate over each character in file (hexdump)

I need to read file content as string (binary file) to variable, then iterate over each character in that string, convert each character to its hexadecimal representation, use comma (or any other ...
1
vote
1answer
101 views

algorithm Logic: Make Loop for each 3 rows in datatools

i want to make loop with process: Current: (with below code) each row create one page Box A, B, C: Same data from one row of datatool Need update: Create one page only \Break=break or each 3 ...
6
votes
1answer
131 views

How to write a loop to reflect a path (Asymptote)?

I am trying to shorten a code that contains a lot of reflections by writing a loop: [asy] unitsize(1.5 cm); pair A,B,C; real alpha=(20); real beta=(10); real gamma=(180-alpha-beta); real rad=(pi/180)...
2
votes
1answer
83 views

How to put texts on a newline in an algorithm (in a nested for-loop)?

I am making an algorithm with a nested for loop, and there are multiple in the loop. They are presented on the same line, but I want them to start on a newline. Any ideas how I can do this? This is ...
1
vote
1answer
115 views

Adding additional text to some elements of a loop?

The following question stinks a bit of crazed micro-optimization. But I had written it, and I was a bit curious, so I thought I might as well post it. The following loop iterates over inserting some ...
0
votes
1answer
50 views

Looping for Two-column Signature Blocks

I'm trying to create a two-column area for signatures, so folks signing the document are listed in the left column or right column, and there are enough rows to accommodate everyone's signature. Under ...
1
vote
1answer
165 views

The construction of Rooty helix, code explanation

Could someone please explain some parts of this code? I'm newbie on LaTeX and could not understand some parts. What does this \foreach \y in {86,38,15} means? Could you explain with details what is ...
2
votes
2answers
87 views

Why does this document add empty pages?

I have this document and it adds ONE empty page at the beginning and TWO empty pages at the end - why is that and how can I get rid of those? So, instead of only 2 pages, I end up with 5! \...
2
votes
1answer
162 views

\ForEach fails with underscores

For the automatic generation of reports I'm using the \ForEach loop of the forarray package. This is just great as it saves me lots of time. However, there is one issue: When the items I iterate ...
0
votes
1answer
50 views

\DTLfetch not working with Variable

I have csv database loaded in data variable. I am trying to fetch value from particular column given an another column name and its value. I am using following code \forloop{i}{1}{\value{i} < 30} {...
1
vote
1answer
320 views

\forloop problem(undefined control sequence)

(/usr/local/texlive/2018/texmf-dist/tex/latex/fontspec/fontspec.sty (/usr/local/texlive/2018/texmf-dist/tex/latex/l3packages/xparse/xparse.sty (/usr/local/texlive/2018/texmf-dist/tex/latex/l3kernel/...
1
vote
1answer
290 views

How to put bengali serial no on making empty table using for loop?

\documentclass{article} \usepackage{forloop} \usepackage{polyglossia} \setmainlanguage[numerals=Devanagari]{bengali} \setmainlanguage{bengali} \setotherlanguage{english} \newfontfamily\bengalifont[...
1
vote
1answer
35 views

Repetition inside tabular

Are there any simple way to perform repetition inside a tabular environment? This is what I intended to do: \documentclass[a4paper,10pt]{scrartcl} \usepackage[utf8]{inputenc} \usepackage{tikz} \...
5
votes
3answers
440 views

etoolbox for loop over range

Is there a way to run a command on a range of consecutive integers (say, 11, 12, 13, 14, 15), specifying only the first and last numbers (11 and 15)? Basically I'm looking for the general LaTeX ...
3
votes
2answers
75 views

Narrowing a minus sign in math mode (allowable in for loop)

I want to fit the "N-1" into the box below if possible; if I use the solution \text{-}, namely 3/{N\text{-}1}, it gives me an error: Undefined control sequence: } (followed by: ) Is there a way to ...