I'm new to LaTeX and I guess I'm still a little confused about the difference between TeX and LaTeX. Under what circumstances would you actually need to define new TeX macros within a LaTeX document? What's the difference between \def and \newcommand (other than the fact that one is TeX and the other is LaTeX)? Can someone give me an example?
|
|
|||||
|
|
LaTeX is based on TeX, see: You can use TeX within LaTeX documents, however it's recommended to use LaTeX if possible because
Here's a helpful list regarding LaTeX commands vs. TeX commands: LaTeX's There's a lot of LaTeX documentation explaining |
||||
|
|
|
The difference between TeX is not analogous to the difference between, say, C and C++, where it is actually an issue to directly include C code in a C++ program. It's more like the difference between a simple HTML text box like the one I'm using and a fancy text editor like Emacs. (I admit that the analogy between a typesetting engine and a text editor is not that inspired.) Sure, you can use an Emacs window as a text box, but it has a ton of features that make entering and editing text faster and easier, and an infinite capacity to extend them. Of course, in the middle of your hyper-adept Meta-Super-whatever editing session you choose just to type a few lines, it will not break the program. It may even be faster or easier. Thus it is with TeX and LaTeX. Unlike C++, LaTeX does not replace TeX, but rather, it replaces TeX idioms. The language would still work the same way if you tried to use it, but you have the option (strongly encouraged) to use it differently. In particular, Like with Emacs versus text boxes, most of the time you are doing things that don't depend on TeX vs LaTeX at all: entering plain text is the same in both. Also, I have lied in that it is possible for some TeX commands (even primitive commands like I should say that I have never used Emacs. |
|||
|
|