6

i want to learn to do some basic style programming with latex, I'm searching a bit but i can't find a clear source of information. I'm searching things like

   Conditionals
   Loops
   Comparison Operators
   Automatic Variables
   Arguments Uses

For example when i search information about conditionals i only found some sites that provide one miraculous command that do some specific comparison, is like that there is always \ifSomething=OtherThing command and not only one IF like i'm accustomed to use in any other language where the Comparison operator take the responsability to adapt what we want to compare. Same for the other topics.

mjsr
  • 3,425

2 Answers2

2

etoolbox (also see this post) is a big one for comparisons and conditionals, and it does loops, too. Rather than providing one miraculous command that does a specific comparison, it provides a ton of those commands, one for each comparison type.

It handles a lot of other useful things, too, including patching existing commands, adding things at the beginning or end of environments, documents, preambles, etc.

The included documentation may be a bit short on detailed examples, but for many audiences, it's fine.

Mike Renfro
  • 20,550
2

For ConTeXt, the ConTeXt wiki has a nice page explaining different programming extensions available in ConTeXt. In particular, see the page on System macros, which is based on an old MAPS article by Taco Hoekwater.

Aditya
  • 62,301