0

As written in the page below, lualatex seems to be a symbolic link or an lias to luatex. Difference between luatex and lualatex binaries

However, they don't work the same way. lualatex compiles latex format documents while luatex compiles plain tex documents.

This means they are not the same 'UNIX executable' or lualatex isn't just an alias of luatex. Why do they work differently?

Thank you in advance.

ynn
  • 243
  • 1
    Welcome to the site, but what about Joseph's comment to your prior similar question (http://tex.stackexchange.com/questions/318267/i-cannot-execute-lualatex-command-at-all)? I think it answers the current question, too. luatex and lualatex are two different programs, using different input formats, that should not be aliased to each other. – Steven B. Segletes Jul 06 '16 at 14:57
  • @StevenB.Segletes Thank you. Thanks to the page, I understand well that luatex compiles plain tex format documents and lualatex compiles latex format documents. However, it is the fact that luatex is a Unix executable the size of 17.1MB and lualatex is "apparently" just an alias of luatex and the size of only 6B. – ynn Jul 06 '16 at 15:07
  • 4
    Related/duplicate: http://tex.stackexchange.com/questions/124421/ and http://tex.stackexchange.com/questions/64000/ – egreg Jul 06 '16 at 15:43
  • 1
    Analogy: let's presume your Japanese name is Yuki and your English name is ynn. When I call you ynn, you reply in English, but when someone calls you Yuki, you reply in Japanese. Your are the same piece of software (and hardware) but you are programmed to reply differently, depending how you were called (this is more common in Taiwan for example). – alwaysask Jul 06 '16 at 15:56
  • @egreg Thank you for your comment. I'll read them for further understanding. – ynn Jul 06 '16 at 17:04
  • @alwaysask How understandable your analogy is! Though I don't understand the exact structure, I understand very well why the two commands work differently. Thank you. – ynn Jul 06 '16 at 17:05

1 Answers1

3

In many programming languages, it is possible to detect the name by which an executable is invoked. In C this is by examining the field args[0], in Bash this is given by $0, and in TeX a similar thing is \jobname (see, e.g. this answer).

The program can thus be designed to behave differently depending on how it is called.

An extreme example of this is the busybox suite of programs. With one executable and many different aliases you can recreate most of the tools one needs to operate in a *nix commandline environment.

Willie Wong
  • 24,733
  • 8
  • 74
  • 106
  • Thank you for your answer. So the command detects whether it has been called luatex or lualatex and works differently. Now I understand well. – ynn Jul 06 '16 at 17:08