9

I would like to know if there is some manual from which I can learn the bases of LaTeX programming language. I need something universal, not related to some specific package or class, that at the end allow me to have a look at various source files, to understand the code in them and even to modified some file or to create my own source files of packages or classes.

I am not a beginner user of LaTeX. I have written a lot of documents using LaTeX with some standard classes and packages and with more exotic ones. What I want is not a manual that tells me how to write a document with LaTeX but how LaTeX works at its bases.

For example what are macros and how to use them, how to use command like \def, \if, \ifx, \fi, \global, \let, \relax, the key @, \DeclareOption, \begingroup, etc... (I have only open the file article.cls and check for command that I don't know..)

Joseph Wright
  • 259,911
  • 34
  • 706
  • 1,036
Red
  • 10,181

2 Answers2

9

The LaTeX2e kernel and LaTeX2e packages are written in a mixture of TeX primitives and some plain TeX macros, LaTeX2e document-level commands, LaTeX2e package/class commands and 'internal' code. Documentation is therefore split up:

  • The TeXbook for TeX primitives and 'utility' plain TeX macros (TeX by Topic also highly recommended)
  • LaTeX: A Document Preparation System for document level commands
  • Class guide for package/class commands
  • Individual .dtx files for 'internal' commands (may have documentation, may just have code)

As such, there is no one document to read to understand programming LaTeX2e. One of the aims of the LaTeX3 Project is to provide a single programming layer for the future: expl3.

Joseph Wright
  • 259,911
  • 34
  • 706
  • 1,036
0

The LaTeX Wikibook has information about macros and plain TeX, although I don't know if they'll be detailed enough for your needs. But it might be worth a look, and you can always add something if necessary!

Gaurav
  • 101