I am trying to write my 'Matura work' for school in LaTeX. Therefore I am using MacTeX and TeXShop and normally it works fine.

But I am really annoyed with running all these different engines like LaTeX, BibTeX, makeindex, pdftex by hand. I don't really understand this stuff and at the moment I don't have enough time to learn.

Is it possible to do all this stuff with just one click?

How can I do this?

ps. for my glossaries I use this:


bfname=$(dirname "$1")/"`basename "$1" .tex`"

makeindex -s "$bfname".ist -t "$bfname".alg -o "$bfname".acr "$bfname".acn
makeindex -s "$bfname".ist -o "$bfname".gls -t "$bfname".glg "$bfname".glo
  • 5
    Yes it is possible! TeXShop should come with that Perl latexmk script. You can alway write your own Makefile but realistically speaking you have to know something about TeX work flow to use TeX. Jan 16, 2012 at 15:56
  • 2
    Possible duplicate: Tools for automating document compilation.
    – qubyte
    Jan 16, 2012 at 15:58
  • 3
    latexmk is what I'd go with -- it's in TeXShop's disabled engines folder by default, but easily enabled. Some more information here, you should be able to check TeXShop's documentation on how to enable other engines (no immediate access to MacTeX for me right now). Jan 16, 2012 at 17:34
  • 9
    @RobinVa Answering your own question is fine (and indeed encouraged). So that other people find the site easy to navigate, and so good answers can be voted for, waiting a little while then posting an answer is better than editing questions to include the answer. It would be really good if you come back after a few hours and post an answer.
    – Joseph Wright
    Jan 16, 2012 at 18:00
  • 5
    You can be really annoyed that you have to run all these different engines but it's not going to help you. Learning how to use some software usually takes time and it usually doesn't always work the way you want it, unless you can afford paying somebody to implement the software for you. As suggested by Mike Renfro, you may want to try latexmk. It's the second next thing to LaTeX by autopilot.
    – user10274
    Jan 16, 2012 at 18:59

2 Answers 2


(Robin's answer moved from the question area)

Here a short abstract of "Latexmk For TeXShop.pdf" by Herbert Schulz ([email protected]). Reading this and following the explained steps solved my problem. I don't own the right of this text! If you own the rights of this text and aren't ok with the citation contact me, so i can delete it. thx.

1 What is latexmk?

Compiling a tex file containing cross-references, bibliographic references and/or indexes is a multi-pass process; i.e., you’ve got to run (pdf/xe)latex multiple times with possible inter- mediate runs of bibtex and/or makeindex until all references are resolved. The latexmk perl program, rewritten and presently maintained by John Collins1, automates this multi-pass process. By default it first runs (pdf/xe)latex on a source file, determines file dependencies by exam- ining the log and aux files produced by the run and then automatically runs bibtex2 and/or makeindex, if needed, and the correct number of additional runs of (pdf/xe)latex to generate the bibliography, index and cross-references. Recent versions of latexmk also work correctly with the nomencl package as well as the glossary and glossaries packages and other packages that produce multiple bibliographies or indexes.

2 Quick Start!

This section will get you started quickly. Unless you are trying to customize the behavior of the supplied engines or want to use the more esoteric engines this really is all you need!

2.1 Quick Install.

To activate the latexmk engine files simply move all the files with extension .engine from ~/ Library/TeXShop/Engines/Inactive/Latexmk/ two folder levels up, to ~/Library/TeXShop/ Engines/, and (re-)start TEXShop. (Note: ~/Library/ is the Library folder in your HOME folder.) When you click on the popup engine menu on the Source toolbar the newly enables engines names should appear; see Figure (1) to see how that menu changes. Note: the engine names will not appear in the Typeset Menu.

2.2 Quick Use.

At the top of your Source file place the line

% !TEX TS-program = pdflatexmk

to use the pdflatexmk engine which will use pdflatex to typeset your document. Substitute latexmk or xelatexmk for pdflatexmk to use latex or xelatex to typeset your Source. From then simply using Typeset→Typeset (Cmd-T) will run through the complete process of fully typesetting your document.

  • I forgot to do it by myself. Thy a lot. Jan 24, 2012 at 9:34
  • 4
    Just to let everyone know, I have no problem with the quote from my documentation given above. Good Luck, Herb Schulz May 13, 2013 at 11:52

The answer given here didn't work for me. I don't have any ~/Library folder and it seems like my TeXShop was installed in a different way (I don't remember how I originally installed it). Adding the !TEX directive at the top of my source file didn't work, either. However, I was able to switch to pdflatexmk by selecting it in the drop-down at the top of the editor.

Screenshot of editor with pdflatexmk selected in drop-down.

  • 1
    Im am very sure that you have a ~/Library folder on your Mac. It is hidden by default, but you will be able to "Go to" it using this command in the Finder. Nov 17, 2022 at 19:53

You must log in to answer this question.

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