4

I have question about LaTeX structure and how LaTeX works? Is it just a set of macros for TeX? What happens, when I call latex somefile.tex? Does latex just includes somefile into a file, which contain basic LaTeX macros and calls tex?

I've looked at latex.ltx. There are some commands, which are neither defined nor basic TeX commands. Does LaTeX introduce new fundamental commands, which TeX haven't?

David Carlisle
  • 757,742
  • 5
    Do http://tex.stackexchange.com/questions/49/what-is-the-difference-between-tex-and-latex, http://tex.stackexchange.com/questions/6776/what-are-tex-and-latex and http://tex.stackexchange.com/questions/3274/latex-architecture-how-does-it-all-work answer your questions? – Caramdir Jul 01 '11 at 10:35
  • 3
    After looking at the questions linked by Caramdir, I suggest asking a more specific question. A generic question such as "how das LaTeX work" might require an extensive general introductional text, so expect links to such texts. Specific questions could get concrete answers. – Stefan Kottwitz Jul 01 '11 at 10:50
  • Thanks @Caramdir for the links. Especially LaTeX architecture - how does it all work? seems to be quite similar. I myself would love to get an in-deep technical explanation how exactly [pdf]latex is based on tex. Is it simply a format? Are the LaTeX macros build in an own variant of the TeX compiler? Is latex.ltx really read for every latex run? – Martin Scharrer Jul 01 '11 at 11:27
  • 1
    @Martin -- latex is simply a format. (plain is the original format.) there are others, e.g. context. pdftex is a modification/extension to the tex engine; pdflatex uses the pdftex engine with the latex format preloaded. – barbara beeton Jul 01 '11 at 12:24

1 Answers1

2

latex is (in essence) a collection of macros.

a file containing these macros is read by tex (in initialisation mode -- flag "--ini" on tex-live versions of tex).

at the end of reading the file, tex encounters a \dump command, and writes a "format" file latex.fmt

the latex command is defined to "run tex and load latex.fmt". simple...

latex's collection of macros covers most of what plain tex (knuth's format) does, but adds a bunch of extensions that allow the user to impose some regular structure on a document.

wasteofspace
  • 5,352