[OS X TeX] Simple(?) MacTeX question

Rowland McDonnell rjmm-lists1 at fireflyuk.net
Tue Sep 12 04:45:24 CEST 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. 

You've managed to supply quite a lot of information that's filled in
various gaps in my knowledge - thanks!  I don't need fully intensive
detail, just enough to be getting along with (does that make any sense
at all?  Probably not - I've been working on understanding MacTeX for 10
hours on the trot today, and I think I'm getting the signs that I now
need to stop and do something else).

>In TeXShop's help  
> "How do I configure TeXShop?", see the two pages:
> 
>   Converting Graphic Formats automatically
>   Default Latex template

I can't really understand them.

> In particular, the latter contains:
> 
>   \usepackage{graphicx}
>   \usepackage{epstopdf}
>   \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.

Righto - thanks.

> 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:

Actually, TeXShop installed with MacTeX is set up to allow running of
other programs - is that what you mean when you use the jargon term
`shell escapes'? - or so the documentation explains.

[snip]

> 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.

No, it provides you with tools to perform some such conversions.  It's
not `all one would need' by any means.  I expect that there are file
formats that it can't handle.

> But also, for security reasons, it sets this behaviour off by  
> default. 

It's on by default with TeXShop.

>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.

Fair enough.  I'll probably use something GUI for most of that.

> 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.

Mmm!  Interesting.  I expect I shall forget it, but thanks!

> > 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).

Surely then, the MacTeX installer should have taken care of this?

I spy that file, and right at the end, it says:

## TeX modifications start at Fri Sep  1 16:41:49 BST 2006
## Do not remove previous line
MANPATH_MAP     /usr/local/teTeX/bin/powerpc-apple-darwin-current
/usr/local/teTeX/man
## Do not remove next line
## teTeX modifications end at Fri Sep  1 16:41:49 BST 2006

> In one recent message, I spoke about this briefly and asked a few  
> questions:
[snip]

> You simply have to add the following line at the end of man.conf:
> 
> MANPATH       /usr/local/man

Well, that works - but I can't help feeling that the MacTeX installer
should have set this up.

> (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), 

(I wouldn't be surprised if the speed change turned out to be
unmeasurable, given the complexity of the systems concerned and the
amount of buffering and caching that goes on these days, and never mind
the processors.)

>but otherwise not modifying the operation of man in any way.

Righto - ta.  Seems obvious from context, but thank you for making it
explicit (you weren't to know it looked obvious to me, and things that
look obvious to me often turn out to be other than the way I'd thought).

> 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.

I'll use a GUI text editor, not a CLI one.  The only CLI text editor I
ever learnt to use properly was Emacs, and I've forgotten almost all I'd
ever learnt about it by now.  I've got too much stuff to learn to want
to add learning about a new CLI editor, haven't I?

The other ways of approaching this job are: working on a copy of the
file concerned, with the file attributes set appropriately; or working
on it using a GUI text editor launched via Pseudo.

<http://www.versiontracker.com/dyn/moreinfo/macosx/9608>

I used TextEdit for the job of editing man.conf in situ - it worked
without a hitch, although two keyboards on the one desk is getting
confusing.

> 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:
> 
> <http://www.tug.org/interest.html#web>
> 
> Hope this helps,

It certainly does - thank you very much,
Rowland.
------------------------- 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 macostex-archives mailing list