# Tagged Questions

{recursion} is the self-referral operation such that particular steps in a program depend on solutions to instances of the same program (as opposed to iteration).

47 views

### Compilation of several projects at once

I search a way to (re)compile several different projects at once (all assumed to be compile individually without error). Here, I present the context and the problem. The context: I have a topic, e....
137 views

### Nested Logic Gates

I am trying to get a nand gate to work like the one mentioned in this article, and it takes issue with the ifnum being fed a single integer rather than a pair of integers with an equals. When I fix ...
2k views

### Amusing exercise - ouroboros file - Output of TeX includes itself recursively ad infinitum

Clarification: The question may be related to the the quine fun question, but IMHO it is quite distinct. The question here to write an "ouroboros" in TeX, i.e., a file that includes itself as a ...
69 views

### Plotting a recursive defined set of functions with conditional base function

I'm trying to visualize the construction of B-Spline functions by showing step by step how the curve is created. This involves painting curves similar to these: The function that creates the curve, ...
654 views

### Recursive Stern-Brocot tree definition

I am trying to build a Stern-Brocot tree (enumeration of rationals). The result is nearly acceptable, but I am still dissatisfied with the following points. The edge from the parents goes to the ...
432 views

### High-order recursive macro to define several similar macro at once does infinite loop

I’m a fan of factorization and hate code repetition. So I was trying to define a macro which defines for me all the common mathematical sets commands (\C, \N, etc.) and made a recursive function ...
292 views

### Recursive use of \renewcommand: How to make it work?

I am trying to define a command that is able to store the content of a section and accumulate it as new sections are created. My current attempt is the following: \documentclass{article} \newcommand{...
137 views

### Building table dynamically with \edef, \noexpand or whatever

Consider the following table: \begin{tabular}{ll} a & A\\ b & B\\ c & C\\ \end{tabular} I would like to define commands \addtableline{...}{...} and \printtable in order to build this ...
78 views

### Passing arguments to latex file

I have a pgfplots main.tex file which plots a graph from an input file. I would like to run it on 100 input files and automate creating 100 PDF pictures. How can I do that? The files are named as ...
42 views

### Recursive Itemization Macro Output & \@ifnextchar Weirdness

I'm encountering some rather unusual behavior from a macro I've defined. The specific goal of this macro, ultimately, is to set up something easy to call that produces itemized lists to my liking ...
76 views

### Creating a Droste Effect

Is there any way to achieve a Droste effect in LaTeX? For instance, I'd like to generate a floating figure that contains a rendering of the page it is included in.
275 views

### How do I make a list of items in Latex using recursion

I was trying to use recursion in LaTeX to create a list of items. I don't have much experience with LaTeX so kindly explain any uncommon commands used. Here's my code for the same. \makeatletter \...
80 views

### How to determine if a macro argument contains the macro itself?

I would like to have a way to detect if a particular macro's argument contains that particular macro itself. Consider the following MNWE: \documentclass{article} \usepackage{etoolbox} \newcommand*{\...
132 views

### Recursive String Parsing

I have been working on writing a recursive stream processor in latex that converts a shorthand version of a set of highly used commands into a much longer form. The code below represents what I had ...
124 views

### cryptic plain TeX: Twelve days of Christmas

Many years ago, probably in TUGboat, I saw a shortish piece of \TeX\ that immediately deploys catcodes and very quickly becomes completely unreadable, but when typeset produces the old "twelve days ...
161 views

### using a macro to define the body of a tabular / & separator problem

I'd like to create a macro that can create and fill a multiline tabular with 4 entries per line from something like \bidding{3H,4S,5C,X,XX,-} where the number of entries is of course dynamic. I have ...
118 views

### How to use sed to comment some lines in tex files (has “%” a particular meaning for sed ?)

I've been reading something in Most useful sed one-liners for TeX users which is related to my problem, but albeit interesting, it is not what I need. I have many tex (beamer class) files in ...
2k views

### TikZ - Recursive Arc Drawing

I'm trying to make Farey diagrams similar to those seen here (click) or the screenshot as follows, Namely, I'd like an example of the one seen on the top of page 6. From there I hope I can figure ...