1

I'm really new to TeX and I'm trying to learn how the different levels of TeX relate to each other. As far as I understand LaTeX is a set of macros for Plain TeX with the purpose of making life easier, in that sense I wonder whether LaTeX will compile Plain Tex, since LaTeX is just a set of macros.

For instance, I've tried the very basic \bye command of Plain TeX with a LaTeX compiler and it didn't work, I would love to learn the logic behind it.

Edit:
I've figured that Plain TeX is also a set of macros, I thought that it was the pure TeX (which turned out to be called "Virgin TeX"), that explains why \bye won't be compiled in LaTeX but when I try this in LaTeX it still won't be compiled.

  • plain tex and latex share no code, although both are written in tex, so you would not expect any plain tex defined commands to work in latex. Some latex commands have the same names as commands defined in plain tex and some of those (not many) have the same definition. – David Carlisle May 04 '21 at 08:20
  • your edited last paragraph is the answer here. \bye is defined in plain tex, not a tex primitive so it is not defined in latex. – David Carlisle May 04 '21 at 08:22
  • 2
    Think to old English (plain TeX) and middle English (LaTeX): the two languages share much of the grammar and part of the lexicon; but a hypothetical OE speaker cannot understand ME, whereas a ME speaker can understand a lot of OE (not everything). – egreg May 04 '21 at 08:23
  • @DavidCarlisle https://tex.stackexchange.com/questions/388352/core-tex-hello-world This doesn't work though, at least for me, I get "\begin{document} missing". Isn't this supposed to be compiled? – Efe Zaladin May 04 '21 at 08:31
  • No why would you expect it to work? latex is set up to require \begin{document} before typesetting any paragraphs, so you get the error that you state. – David Carlisle May 04 '21 at 08:33
  • you could add \everypar{} to get rid of that error then you would get an error from \end as you will be using the latex definition of \end which will be looking for an argument as in \end{table} and not finding one. – David Carlisle May 04 '21 at 08:37
  • @DavidCarlisle I expected it to work thinking that LaTeX isn't capable of inhibiting the usage of primitive TeX commands. I know that LaTeX is a different format and we should be playing by its rules but I'm just trying to understand the reasoning behind why it doesn't work like that. – Efe Zaladin May 04 '21 at 08:38
  • 1
    oh latex inhibits the usage of lots of tex primitives, \end for example. it also doesn't define most of the commands that are in plain tex eg anything to do with page breaking or figure insertion \topinsert and friends is not defined at all, so to get a plain tex document to work with latex you have to first undefine a lot of latex, then essentially input plain.tex before running your document. – David Carlisle May 04 '21 at 08:40
  • @DavidCarlisle Ok thanks, I think I now understand – Efe Zaladin May 04 '21 at 08:42

0 Answers0