I am a new MacOS user, and have downloaded and installed MacTex on my machine. How do I use it to convert .tex files to a pdf? I know in Windows I could use pdflatex and MikTex right after installation.

I want to go to my terminal and simply enter: pdflatex file.tex and get the output I expect, like I did in Windows.

When I run pdflatex file.tex when I am in the directory with file.tex in my bash shell, I get -bash: pdflatex: command not found. How do I compile latex documents on the Mac?

Any advice you have would be appreciated.

  • Do you know how to open a command window and navigate to the directory that contains file.tex?
    – Mico
    Commented Sep 2, 2020 at 3:54
  • 1
    yes I can do that @Mico
    – megamence
    Commented Sep 2, 2020 at 4:01

1 Answer 1


Let's assume that you've opened a terminal window and navigated (say, via suitable cd statements) to the directory that contains file.tex. To make pdflatex compile this document, you just need to type

pdflatex file

at the prompt.

In the following screenshot, I first ran cat file.tex to show its contents:

Hello World.

I then ran pdflatex file; happily, no warning or error messages were issued. Finally, I ran ls -l file.* to show that in addition to the .tex file, there are three other files in the directory: file.aux, file.log, and -- probably most importantly to you -- file.pdf.

enter image description here

  • 2
    Incidentally, this answer assumes that you downloaded and installed MacTeX from its main repository at tug.org/mactex. If you used some other installation method -- say, homebrew -- instead, you may have to adjust the PATH and other environment variables by hand.
    – Mico
    Commented Sep 2, 2020 at 5:12

You must log in to answer this question.

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