2

I have installed mactex because I need pdflatex:

MyName-MacBook-Pro:~ namesurname$ brew install --cask mactex
Warning: Cask 'mactex' is already installed.

To re-install mactex, run:
  brew reinstall --cask mactex
MyName-MacBook-Pro:~ namesurname$ 

but once I type mactex or which pdflatex on my terminal it says "command not found" for the first and nothing for the second, respectively:

MyName-MacBook-Pro:~ namesurname$ mactex
-bash: mactex: command not found
MyName-MacBook-Pro:~ namesurname$ which pdflatex
MyName-MacBook-Pro:~ namesurname$ 

How can I use/open mactex and/or pdflatex ??

3
  • 1
    Mactex is only the installer. It set up two things : the texlive tex distribution, including the pdflatex executable and the texshop editor. You should run the latter to edit your code, and it will invoke the former when pressing on "compile" or "compose" or "typeset".
    – Jhor
    Apr 27, 2022 at 17:26
  • 3
    There's no real need to install MacTeX via homebrew; it's simpler to install it using the MacTeX installer package. This may or may not be the source of your problem, because as I understand it the homebrew cask just runs the regular MacTeX install package. But if you've installed it correctly which pdflatex should return /Library/TeX/texbin/pdflatex. I would uninstall the homebrew version and use the package installer in the link I suggested.
    – Alan Munn
    Apr 27, 2022 at 17:46
  • 1
    Thanks a lot to everyone! Thanks @AlanMunn, I followed your instructions in this order, (1) brew uninstall mactex, (2) download MacTeX.pkg from MacTex website and it works! If I type which pdflatex from my Terminal, I get the following: /Library/TeX/texbin/pdflatex
    – Ommo
    Apr 28, 2022 at 13:08

2 Answers 2

3

Solution provided by @AlanMunn in the comments:

  1. brew uninstall mactex,
  2. download MacTeX.pkg from MacTex website

Now, if I type which pdflatex from my Terminal, I get the following: /Library/TeX/texbin/pdflatex

Thanks a lot Alan Munn!!!

1

I was using beamer on mac. I find a similar solution provided by @Ommo above, but:

  • MacTex is huge (5.2G now)
  • BasicTex is a more popular alternative for pdflatex
  • Use brew install basictex to install BasicTex with HomeBrew
  • Make sure /Library/TeX/texbin is in your $PATH

What I missing was the last step, but this solution still worth mentioning.

2
  • My understanding is that BasicTeX includes pdflatex. BasicTeX is a small subset of MacTeX, which is a version of the full installation. BasicTeX is much smaller because it only includes the common executables, packages, and classes.
    – Teepeemm
    Nov 27, 2023 at 15:29
  • Again, it's better to install MacTeX or BasicTeX directly rather than with Homebrew. The BasicTeX installer can be found here. I wouldn't call it a "more popular alternative"; it's simply a very trimmed down version of MacTeX which excludes all the documentation, and lots of packages, and doesn't install Ghostscript or any of the GUI programs that MacTeX installs. So it's a good choice if you know what you're doing, but for beginners, the full MacTeX install is a better choice.
    – Alan Munn
    Nov 27, 2023 at 16:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .