[OS X TeX] Simple(?) MacTeX question

Bruno Voisin bvoisin at mac.com
Mon Sep 11 19:23:08 EDT 2006

Le 11 sept. 06 à 20:58, Rowland McDonnell a écrit :

> None of it goes any way to answering my question: what is ImageMagick
> (etc) included with MacTeX for?
> [...]
> It's the same with all the additions I asked about: yes, I can find  
> out
> what they `do in a general sense' more or less easily in each  
> case.  But
> that is not what I asked about: i want to know what they do in the
> context of MacTeX.
> In short, how is MacTeX set up to use them, in what way are they doing
> to intrude on my working habits, and is there any way in which I, as a
> LaTeX user, can make any use of them at all?
> Why, in short, has all this stuff been installed?
> Now, I gather than ImageMagick is set up to provide on-the-fly
> conversions from tiff to png when pdfLaTeXing.  I'd like to find out
> more about this, mostly to stop it.  Where do I look?

Not really a detailed answer, but a few pointers. In TeXShop's help  
"How do I configure TeXShop?", see the two pages:

	Converting Graphic Formats automatically
	Default Latex template

In particular, the latter contains:

	\DeclareGraphicsRule{.tif}{png}{.png}{`convert #1 `basename  
#1 .tif`.png}

The first line simply calls the graphicx package. The second line  
calls the package epstopdf (actually /usr/local/teTeX/share/ 
texmf.tetex/tex/latex/oberdiek/epstopdf.sty), which performs on-the- 
fly conversion of EPS to PDF; this allows to include EPS graphics  
while running pdfLaTeX, without having to perform a preliminary  
conversion. The third line instructs LaTeX to perform on-the-fly  
conversion of TIFF to PNG, which again is useful when running  
pdfLaTeX and avoids to have to perform a preliminary conversion.

Similar instructions are given in the template LatexTemplate.tex in ~/ 
Library/TeXShop/Templates, with a slight modification on the third line.

How does this work: in the second line, the package epstopdf invokes  
the script /usr/local/teTeX/bin/powerpc-apple-darwin-current/ 
epstopdf, installed with TeX, and the script epstopdf invokes in turn  
the script /usr/local/bin/ps2pdf, installed with GhostScript.  
Similarly, the third line invokes the script /usr/local/bin/convert,  
which is part of ImageMagick.

As to what you have to do to stop this: nothing. For the above to  
work, you would have to allow pdfTeX to perform shell escapes, i.e.  
to execute commands in the shell. By default, for security reasons,  
TeXShop and gwTeX are set up not to allow this:

- For TeXShop, this is defined in Preferences > Engine > pdfTeX:  
shell escape is not possible unless you define yourself the pdfTeX  
command to be "pdftex --shell-escape" and the LaTeX command to be  
"pdflatex --shell-escape". This is not the default.

- For gwTeX, the following line in /usr/local/teTeX/texmf.cnf

	shell_escape = f

prohibits shell escape. For it to be allowed, you would have to  
replace f (= false) by t (= true).

To summarize, MacTeX provides all you would need to perform on-the- 
fly conversion of graphics formats in pdfTeX, should you want to do  
this. But also, for security reasons, it sets this behaviour off by  
default. If you want to set this behaviour on, you just have to edit  
a config file and applications prefs, but no additional installation  
to perform.

That said, I don't use on-the-fly conversion myself: this means the  
conversion of redone for every included graphics each time your TeX  
document is typeset, and IMHO this is just a waste of time and  
computer resources. I prefer to perform the conversions once and for  
good from the command line, operating epstopdf and convert myself,  
before TeXing the file which includes the graphics.

In this situation, it may be helpful to know the OS X command  
"apply" (it was introduced to me on this list). For example, using cd  
to navigate in Terminal to a directory full of EPS files (with  
extension .eps), all you have to do afterwards to convert all these  
files to PDF in one go is type:

	apply epstopdf *.eps

followed by Return.

> btw, there are no man pages for `convert' or `ImageMagick' on my Mac
> with MacTeX installed.

That's because, by default, Terminal, i.e. the command-line interface  
of OS X, does not look where these pages are. Where it looks is  
defined in the file /usr/share/misc/man.conf (as far as I know, the  
only documentation about this lies in the comments of the file).

In one recent message, I spoke about this briefly and asked a few  


In short: for binaries located inside /usr/local/bin, man searches by  
default in /usr/local/share/man only. However, i-Installer adheres to  
the setup defined by the software that it distributes; most of these  
software put their man pages inside /usr/local/man. The man program  
-- as shipped with OS X -- doesn't look there by default.

This can easily be cured, as proposed in


You simply have to add the following line at the end of man.conf:

MANPATH		/usr/local/man

(You have to open a new Terminal window afterwards for the change to  
be effective, I think.) This will only add /usr/local/man to the path  
where man search for man pages, making the search very slightly  
slower (the difference in speed shouldn't be perceptible on your Quad  
G5), but otherwise not modifying the operation of man in any way.

The only difficulty is that the file man.conf cannot be edited by a  
normal user: you have to get administrator privileges in order to  
modify it. This is done by invoking a text editor prefixed by sudo in  
Terminal. A favourite of mine is Pico (the editor module of the  
popular email software Pine), installed with OS X. Thus, you can use  
in Terminal:

	sudo pico /usr/share/misc/man.conf

Believe me, I'm pretty useless at command-line stuff, and moreover  
rather reluctant at everything command-line, and in spite of this  
using pico to edit man.conf is pretty straightforward.

Switching topic: regarding the question about htlatex in your other  
message: I think htlatex is part of TeX4ht, one of the several  
available TeX-to-HTML converters, alongside for example TtH (shipped  
with OzTeX). Some alternatives are listed at:


Hope this helps,

Bruno Voisin

------------------------- Info --------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
          & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/

More information about the MacOSX-TeX mailing list