3

A question of no practical importance, just curious:

One reads that Latex is just a collection of Tex macros. Is this literally true?

A more precisely specified version of the same question: Does there theoretically exist a Tex file latex.tex such that if file1.tex is a valid Latex file and file2.tex is the same as file1.tex except that it starts with the line "\input latex" then passing file2.tex to tex.exe produces the same output, eventually, as passing file1.tex to latex.exe?

  • 1
    Building the LaTeX format does more-or-less exactly that (the file is called latex.ltx) ... – Joseph Wright Mar 26 '18 at 14:30
  • Yep, literally true. But I don't get what you mean in the "specified version". – Skillmon Mar 26 '18 at 14:32
  • Technically, TeX is mostly just a bunch of TeX macros. – John Kormylo Mar 26 '18 at 14:34
  • @skillmon : Means: OP turned into a real-world example, such as \input latex.ltx \documentclass{article}\begin{document}Hello World!\end{document}, processed with etex.exe. – AlexG Mar 26 '18 at 14:37
  • Leslie Lamport (the author of LaTeX) writes in the manual for LaTeX2e: "LaTeX is your typographic designer, and TeX is its typesetter. The LaTeX commands that you type are translated into lower-level TeX typesetting commands." – Marijn Mar 26 '18 at 14:42
  • I think that David Carlisle already answered this somwhere here in the site. – touhami Mar 26 '18 at 14:43
  • @JohnKormylo Don't you mean "Plain TeX is mostly just a bunch of TeX macros"? – Phelype Oleinik Mar 26 '18 at 14:44
  • @Marijn : OP is interested in the file containing all those definitions. – AlexG Mar 26 '18 at 14:45
  • 2
    related https://tex.stackexchange.com/questions/91042/is-there-any-software-that-converts-latex-file-to-tex-file – touhami Mar 26 '18 at 14:50
  • @AlexG the OP states that the question is 'of no practical importance', therefore he is possibly more interested in the answer to the general question ('is LaTeX a collection of TeX macros?'), which is (to some extent) answered by Leslie Lamport in the quote, being an authoritative source and all. – Marijn Mar 26 '18 at 14:55
  • @Marijn Maybe. The topic linked in touhami 's comment seems to answer everything. – AlexG Mar 26 '18 at 15:02
  • To save time, the program was stopped after init.tex and/or latex.ltx were processed and the RAM image was saved as an executable. – John Kormylo Mar 26 '18 at 16:22
  • It does have practical implications. For instance, based on the premise that the answer is "yes", effects that cannot be possibly achieved by TeX alone cannot be achieved by LaTeX alone either. – Long Horn Jul 10 '23 at 22:33
  • @JohnKormylo Can you kindly provide a source detailing how this is achieved? – Long Horn Jul 10 '23 at 22:34
  • @LongHorn - It has to do with UNIX debugging; you can create a binary image of an executing program and examine memory contents at that point. – John Kormylo Jul 10 '23 at 23:05

0 Answers0