Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

gravity black

macrumors newbie
Original poster
Oct 18, 2011
20
0
Hi all,

I've been using LaTeX for a while now with the TeXShop program, but lately I've been doing a lot of programming work and have started to really enjoy using the Emacs editor, so I thought I'd try to start writing my LaTeX documents in it. What I want to do is be able to open terminal, write the documents in LaTeX, and then typeset them in pdf format (ideally opening up a preview window with the document at the same time), all from the command line. However, after writing the document, when I try the command:

Code:
latex document.tex

..., I get the error:

Code:
-bash: latex: command not found

I've done some research, and it seems that it's not sourcing my path right or something, because again I think I have all the proper commands in the /usr/texbin directory. However, I'm pretty new to this, and while I've changed some path variables successfully in the past, I'm often unable to replicate that success.

So far, I've added '/usr/texbin' to /etc/paths, and I've added the file 'TeX' with the one line of '/usr/texbin' to /etc/paths.d, but neither of these things did anything.

I would like to get the 'latex' command to work right, but if possible I would like to understand where the commands are coming from, where I should go each time to check the path variables, etc., so that I have some understanding of what's going on. (I'd be happy to problem fixed, but happier if I could learn something in the process.)

Thanks in advance!
 

jiminaus

macrumors 65816
Dec 16, 2010
1,449
1
Sydney
I've not used the /etc/paths file or the /etc/paths.d directory under Mac OS X. I didn't know they existed.

Under Mac OS X I've just created a .bash_profile file under my home directory with something like this.
Code:
export PATH=/usr/texbin:$PATH
 

Sander

macrumors 6502a
Apr 24, 2008
520
67
NB: You may need to set some paths for LaTeX itself as well, so it can find all its .cls files, format files etc.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.