4

I'm new to LaTeX/TeX and recently installed MacTeX on my MacBook. Everything seems to work fine (I'm able to create and typeset files with TeXShop).

Now I want to compile some files via command line and read that I need to change into the projects directory and execute pdflatex my_file.tex. Sadly MacTeX doesn't seem to ship pdflatex. which pdflatex returns nothing.

Should pdflatex be included in MacTeX and my installation is broken? I already reinstalled MacTeX and checked the MD5 hash to verify that I have the right MacTeX installer...

What can I do to compile my .tex-files?

  • 2
    If MacTeX is installed correctly it does add all of the stuff to the path. Exactly which version did you install, which MacOS version do you have and have you updated it after installing MacTeX? – Joseph Wright Sep 11 '16 at 15:58
  • Under MacTeX2016, pdflatex is not a full-fledged file in the normal sense of the word "file", but "merely" a so-called symbolic link to the file pdftex, which is located in /usr/local/texlive/2016/bin/x86_64-darwin. You should get a help menu type-out if you type pdflatex --help at a command prompt. – Mico Sep 11 '16 at 15:59
  • @JosephWright I have MacOS Sierra installed. I installed new latest version of MacTeX (04 June 2016) and haven't updated MacOS/MacTeX since. –  Sep 11 '16 at 16:04
  • @Herickson Sierra is pre-release: I suspect 'all bets are off'! – Joseph Wright Sep 11 '16 at 16:05
  • @Mico /usr/local/texlive/2016/bin/x86_64-darwin exists, but pdflatex --help isn't a command. Seems like the symbolic link is missing. –  Sep 11 '16 at 16:06
  • @JosephWright So nothing I can do at the moment? –  Sep 11 '16 at 16:06
  • @Herickson For pre-release we normally say it's off-topic here but to ask the appropriate devs: in this case the MacTeX mailing list seems most reasonable. – Joseph Wright Sep 11 '16 at 16:06
  • What does echo $PATH return (from the command line)? And what about ls /etc/paths.d? – egreg Sep 11 '16 at 16:07
  • @JosephWright Alright thank you really much. I'll delete this question then. –  Sep 11 '16 at 16:08
  • @egreg /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin –  Sep 11 '16 at 16:08
  • @Herickson What does ls /etc/paths.d return? – egreg Sep 11 '16 at 16:09
  • What do you mean, "pdflatex --help isn't a command"? – Mico Sep 11 '16 at 16:10
  • @egreg /etc/paths.d doesn't exist. –  Sep 11 '16 at 16:11
  • @Mico The terminal doesn't recognise pdflatex as a command. –  Sep 11 '16 at 16:11
  • You can always use /usr/local/texlive/2016/bin/x86_64-darwin/pdflatex --help. Not a solution, but possibly useful for now. – cfr Sep 11 '16 at 16:16
  • @Herickson Then this question should go to the mailing list – egreg Sep 11 '16 at 16:16
  • @Mico But which pdflatex should still return a result if pdflatex is in PATH. Even if it is a symbolic link. (Indeed, even if it is a broken link.) – cfr Sep 11 '16 at 16:17
  • @egreg I'm not in the mailing list and don't really know how to report this, but I'm willing to give detailed information if necessary. –  Sep 11 '16 at 16:17
  • @cfr Yeah, that'll work for now I guess. Hoping to get an answer from a dev. –  Sep 11 '16 at 16:18
  • Since I don't have Sierra installed I can't comment on any changes, but perhaps my answer to this question After migration to MacOSX 10.11 “El Capitan”, how to run simple utilities such as “texdoc” and “kpsewhich”? might be of help. – Alan Munn Sep 11 '16 at 16:32
  • I am running MacOS Sierra successfully with LaTeX on one of my computers, and cannot recall having any issues with it, but that could possibly be because I already had it installed prior to upgrading to beta-OS. Anyway, i think this could be of help: http://tex.stackexchange.com/questions/249966/install-latex-on-mac-os-x-el-capitan-10-11 – Runar Sep 11 '16 at 16:45
  • @RunarTrollet The question you link to deals with pre-release El Capitan. But the OP has installed TL 2016 which works without any trouble on that OS (and knowing a bit about the build process for MacTeX probably works with Sierra too.) So I don't think that's the solution to the problem. – Alan Munn Sep 11 '16 at 16:58
  • What do which pdflatex and echo $PATH return? Do you set a PATH in your ~/.profile (or ~/.bash_profile)? – Herb Schulz Sep 11 '16 at 17:51
  • Comments are not for extended discussion; this conversation has been moved to chat. – Joseph Wright Sep 14 '16 at 06:04
  • Have you opened a new terminal window since you installed MacTex? Stupid, but for me that was the issue. MacTex sets its paths in /etc/paths.d, so if you don't want to close your terminal window you can also run eval $(/usr/libexec/path_helper) – Samuel Peter Feb 19 '18 at 18:15
  • 4
    I'm voting to close this question because it concerns a beta version of an OS which was fully released more than a year ago. – Ian Thompson Jun 28 '18 at 18:56

1 Answers1

2

I use

xelatex

and it works perfectly fine for me.

For instance, use the below command to compile your tex file and generate the pdf:

xelatex --interaction=batchmode file_name.tex 2>&1 > /dev/null;open file_name.pdf

Remove the

2>&1 > /dev/null

part if you want to see the error messages.I am okay with them not being there.