On my Mac I wanted to create the PDF via terminal, and I found I cannot use xetex filename.tex, but xelatex filename.tex works just fine. I checked the file, xelatex is actually an alias pointed to xetex. But why they behave so different? I may need to use the original executable rather than alias to avoid exceptions.
Here's some output:
$ xetex Assignment\ 4.tex
This is XeTeX, Version 3.14159265-2.6-0.99992 (TeX Live 2015) (preloaded format=xetex)
restricted \write18 enabled.
entering extended mode
(./Assignment 4.tex
! Undefined control sequence.
l.4 \documentclass
[a4paper, 11pt]{article} % Font size (can be 10pt, 11pt or...
? ^Z
[3] + 44568 suspended xetex Assignment\ 4.tex
$ xelatex Assignment\ 4.tex
This is XeTeX, Version 3.14159265-2.6-0.99992 (TeX Live 2015) (preloaded format=xelatex)
restricted \write18 enabled.
entering extended mode
(./Assignment 4.tex
LaTeX2e <2015/10/01> patch level 2
Babel <3.9m> and hyphenation patterns for 79 languages loaded.
(/usr/local/texlive/2015/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
...
which xetexandwhich xelatex? This indicates which program is actually executed. – Arun Debray Nov 17 '15 at 23:15whichdoes not tell you which programme is executed if the result is an alias. – cfr Nov 17 '15 at 23:17ls -l $(which -p xelatex)you'll see something like/usr/texbin/xelatex@ -> xetexin the output. – egreg Nov 17 '15 at 23:20which -a xelatex? I tried with-pand it saidIllegal option -p. (I'm using TeXLive on Ubuntu, so perhaps things are different here.) I triedwhich -a, and for me,xetexandxelatexare different files. – Arun Debray Nov 17 '15 at 23:26ls -l $(which -p xelatex)works perfect for me on OS X. However, I didn't find anything about-ponman which. Hope this helps. :) – Stark Shaw Nov 17 '15 at 23:37xelatexin some form (alias or otherwise - not sure what Windows does) then you have more to worry about than needing to specify the format explicitly. Of course, it is possible. But it is also possible the machine won't have the LaTeX format or thexetexbinary. If the machine has anything like a working installation of TeX which is not truly ancient, it will havexelatex. – cfr Nov 17 '15 at 23:38ls -l $(which xelatex). – cfr Nov 17 '15 at 23:40whichis not shell-dependent. It is provided by a package calledwhichand the manual includes stuff about both sh and csh style shells. No-p. – cfr Nov 17 '15 at 23:48whichas an alias. (Which is also probably Apple doctoring the command.) I don't necessarily mean this is bad. All systems do it to some extent or other. But-pdoes not seem to be standard. Unless it is a BSD extension, which is also possible but then I'd expect a suitable man page. – cfr Nov 17 '15 at 23:51.bashrc(I don't remember from when). – egreg Nov 17 '15 at 23:53