Is there a LaTeX distribution for the Mac which has or comes close to MiKTeX's ability to download missing packages automatically?


MikTeX can download packages on-the-fly due to custom additions to the source code used to build compilers such as pdftex. The downside to this approach is that new compilers, a recent example is luatex, experience a delayed release until the work has been done to integrate the MikTeX additions that enable on-the-fly downloads.

Outside of the MikTeX distribution, I am aware of no set of TeX compilers that includes the ability to automatically download missing packages. You could try compiling and installing the MikTeX Tools which is an attempt to port the MikTeX package manager, and versions of the TeX compilers that are integrated with it, to UNIX and Linux.

Sticking with MacTeX is probably still the best way to go for a complete, stable TeX distribution on OS X. Since MacTeX is based on TeX live and not MikTeX, you won't have on-the-fly installation; but you will have the excellent tlmgr package manager domwass described in his answer.


In MacTeX, TeX live is included which has tlmgr (the TeX live manager) to update and install packages (see the overview of what is included in MacTeX). There is also the TeX Live Utility, a Mac OS X graphical interface for tlmgr.

Regards, Dominik.-

  • 4
    That's not quite the same as MiKTeX, though. – Joseph Wright Oct 11 '10 at 15:05

I was having the same problem today so I wrote this bash function.

    installOnFly () {
    pdflatex $fn | tee /tmp/tmp.log
    while [[ $ret != 0 ]] ; do
        mspkg=$(grep "LaTeX Error: File \`.*' not found." /tmp/tmp.log | sed -e 's#! LaTeX Error: File `##g' -e "s#.sty' not found.##g")
        echo "********* Installing $mspkg  *******"
        sudo tlmgr install $mspkg
        echo "******* Recompile $fn *******"
        pdflatex $fn | tee /tmp/tmp.log

Benefit: significantly speeded up my workflow.

Limitation: This does not work when the style file and package name are not the same, or if there is a missing font, instead of a style file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.