By inspecting the output of
which pdflatex, it seems you are using a TeX distribution provided by MacPorts. Personally, I think the use of a TeX distro via MacPorts should be discouraged; MacTeX is IMHO the best way of getting an updated and stable TeX distro on a Mac, and not to mention the handy TeX manager in the System Settings.
If you remove the TeX distro from MacPorts, the path inspection will return only one ocurrence of the TeX tools you need, i.e, the one living inside
/usr/texbin, which is the one TeXShop is using. In any case, if you want to stick with those two distros, let's see how to handle them.
Setting MacPorts TeX distro in TeXShop
TeX tools from MacPorts live inside
/opt/local/bin. If we want to use them in TeXShop, we need to add the full path. In TeXShop, from the menu, go to
Preferences. Select the
Engine tab. The following screen will pop up:
Setting the TeX tools via command line
If you want to set up your terminal to use a certain TeX distro, we need to inspect the path first. Issue
and see the output. If, say,
/usr/texbin comes first than
/opt/local/bin, because of path search priority, the TeX tools will be from MacTeX instead of MacPorts. If by any chance you want to reverse the order, we need to edit the path. I'd recommend setting either
.bash_profile. I usually prefer the latter.
Go to the terminal and type:
The first command will create the
.bash_profile if it doesn't exist, while the second will open it in your default editor. Now, add the following line to your file
if you want the TeX distro from MacPorts to appear first, or
to have MacTeX inspected first. Then save the file. You can apply modifications to your current session by issuing
As egreg and Alan mentioned in the commands, it's way better to rely on the official MacTeX distribution instead of relying on the MacPorts one. Besides, relying on
/opt/local/bin as the first search path might interfere with other system tools because of path priority. MacTeX is always the best solution.
Hope it helps.