Being aware of the fact that this post is quite old, I would like to add two further resources which might be interesting when it comes to programming.
I think there are three categories that need to be mastered (perhaps not all to the same degree) in order to become comfortable around TeX programming:
TeX programming. That's very basic, it deals with expansion control, counters, scopes, basic looping constructs and so on.
TeX typesetting. That's on a higher level, it includes control over boxes, lines, glues, modes, and perhaps about 1000 parameters.
Macro packages like LaTeX.
First, when I started programming in TeX, I found it difficult to get even one of them straight. I read the TeX Book, which is very strong when it comes to (2) and which is the best reference for (1) I am aware of. However, it does not introduce (1) very well, because its aim is to teach typesetting, not programming.
Since then, I have learned a lot - and I wrote an article about (1) which might be of interest to you. Furthermore, I stumbled on an online textbook about TeX, which covers (1) and (2) pretty well - although it is only available in german.
Here are the resources:
TeX programming notes (written by me). It is shipped with pgfplots
or can be found here.
A free online book about TeX (in German!) Einführung in TEX.
As soon as you start programming packages, you will certainly want a user interface, i.e. key-value. Joseph Wright wrote an introductory article about it and I contributed a section about the relatively new pgfkeys
. I would recommend using it, it is quite simple (provided one uses the mentioned article as an introduction instead of the the complicated reference manual which is part of pgfmanual.pdf). The article can be found at TUGboat here.
I must honestly admit that I have longed for a good introduction about how to program in LaTeX - but I never found one. Finally, I got stuck with pgf
which implements a lot of the utility functions, but I found it easier to understand.
Besides pgf
, the best documentation for LaTeX that I found (besides the clsguide
mentioned by Stefan) are the the LaTeX kernel sources (which he mentioned as well). But they are cryptic and require a very deep understanding of (1) and (2) before you can even read them.
A personal list of list for heavy LaTeX users:
- More Math into LaTeX, 4ed. (easier)
- A Guide To LaTeX, 4ed.
- Digital Typography Using LaTeX. Springer.
More advanced:
- The LaTeX Companion, 2ed.
- The LaTeX Graphics Companion, 2ed.
And more: Many documents of LaTeX packages (user-level).
A personal useful book list for macro writers:
A personal useful (package) documentation list for package and class writers, general purpose:
- clsguide: LaTeX2e for class and package writers.
- source2e: Documented source code of LaTeX kernel.
- classes: Documented source code of LaTeX standard classes.
- macros2e: Martin's useful manual for LaTeX internal macros. (c.f. source2e)
- eTeX's manual.
- etoolbox: a useful toolbox of eTeX. For modern packages it is really useful.
- keyval: Support for key-value interface.
- pgfkey or xkeyval or l3keys2e: More advanced key-value interface.
- Some packages of Oberdiek bundle: ifpdf, ifxetex, ifluatex, atbegshi, kvoptions, zref, ...
- Some packages of tools bundle: array, calc (c.f. eTeX's primitives), fontsmpl (c.f. fonttable), layout (c.f. layouts), showkeys, trace, xspace, ...
- expl3, interface3 and source3 (i.e. l3kernel bundle): Introduction of LaTeX3 syntax and documented (developing) LaTeX3 kernel.
- Some packages of l3packages bundle, especially xparse.
- Documents of pdfTeX, and maybe XeTeX and LuaTeX.
To be continued... I'll add links for the documents.
Best Answer
I've used LaTeX wikibook mostly. It's a really good resource when writing mark-up which is the easiest and fastest way to learn.
Unfortunately, proper maintenance of the LaTeX Wikibook has gone astray. Quite a lot of the provided information is a bit outdated. Since it is very hard for a beginner to judge the quality of advice, maybe it's better to choose another document for now.
When the information is once again up to date, this little note will disappear again.