[Mac OS X TeX] TeXShop and tex/gs (again)

Gerben Wierda sherlock at rna.nl
Sun Sep 30 12:42:15 CEST 2001



<x-flowed>On Saturday, September 29, 2001, at 06:56  PM, Arun Mangalam wrote:

> The problem is exhibited whether you use Fink or the TeXInstaller with 
> TeXShop [or any MacOSX application that uses shell scripts]. What 
> happens is that variables are not expanded or mangled up when scripts 
> try to run. There are two solutions to this:

I think I misunderstood the issue here. Let's explain it fully:

There are two 'path'-like issues with TeX/gs.
1. Finding the right binaries when running scripts from shell or TeXShop
2. TeX itself finding files to read

1. Finding the right binaries when running scripts from shell or TeXShop

Most people who run TeXShop and my TeXGSInstaller for teTeX do not 
encounter any problem.

The TeXGSInstaller and TeXShop operate in a manner that a user does not 
have to mess around with paths.

The *current* TeXGSInstaller (mid-august) as far as I know fixes all 
executable path problems by incorporating a workaround for other 
influences (like fink) on the path business.

Of course it is possible that my fixes are not good enough, but a 
workaround editing files in .OpenStep should be avoided, you are 
creating a mess that will become less and less maintainable and 
understandable. We should have a real solution and not one where people 
have to mess around with shells and path settings.

2. TeX itself finding files to read

There is a small issue with my installer here.
A. My setup includes ~/Library/texmf as a user texmf tree and does not 
create the subdirectory structure.
B. Furthermore, that tree uses a hash when available.

Here is the solution to get it to work:

A. TeX does not search an entire texmf tree for all purposes. This is a 
speed concern. For fonts it will search a font subdirectory, for .sty or 
.tex files it will search the tex subdirectory, etc.

In other words:
	~/Library/texmf/foo.sty
will not be found by TeX, while
	~/Library/texmf/tex/foo.sty
*will* be found.

There is a whole complex setting in teTeX for this (see below) that 
people are generally not aware of. Overriding stuff like TEXINPUTS is 
generally not a good idea as it defeats the whole purpose of the 
complex, but good setup teTeX uses and it will produce possible problems 
later when people wonder why stuff does not work and they are running a 
non-standard setup. Note: the standard setup works.

The most important thing to know is this: if you want to get stuff like 
.sty and .tex files to be found by TeX, put your stuff not in the 
~/Library/texmf/ directory directly but in a *subdirectory* 
~/Library/texmf/tex/.

B. My installer includes your home texmf directory in the hash process. 
And TeX uses the hash exclusively when it is available. This will change 
in a new version of the installer. The best thing and easiest thing is 
to remove the file ~/Library/texmf/ls-lR when you are experiencing 
problems with TeX finding files to open.

Gerben





For the people interested, here is a part of the TeX settings for 
TEXINPUTS with comment to show the richness/complexity of it all:

> % Which file formats use which paths for searches is described in the
> % various programs' and the kpathsea documentation.
> %
> % // means to search subdirectories (recursively).
> % A leading !! means to look only in the ls-R db, never on the disk.

Without the leading !! the disk is only searched if the ls-lR is *not* 
available.

This was my error, I thought it was safe to have a out-of-date ls-lR and 
that the disk would be searched if the hash lookup would fail.

> % A leading/trailing/doubled ; in the paths will be expanded into the
> %   compile-time default. Probably not what you want.
> %
> % You can use brace notation, for example: /usr/local/{mytex:othertex}
> % expands to /usr/local/mytex:/usr/local/othertex.  Instead of the path
> % separator you can use a comma: /usr/local/{mytex,othertex} also 
> expands
> % to /usr/local/mytex:/usr/local/othertex.  However, the use of the 
> comma
> % instead of the path separator is deprecated.
> %
> % The text above assumes thet path separator is a colon (:).  Non-UNIX
> % systems use different path separators, like the semicolon (;).

[snip]

> % TEXINPUTS is for TeX input files -- i.e., anything to be found by 
> \input
> % or \openin, including .sty, .eps, etc.
>
> % Plain TeX.  Have the command tex check all directories as a last
> % resort, we may have plain-compatible stuff anywhere.
> TEXINPUTS.tex = .;$TEXMF/tex/{plain,generic,}//

So, the tex program (and thus altpdftex) by default looks in
	texmf/tex/plain/
	texmf/tex/generic/
	texmf/tex/

> % Other plain-based formats.
> TEXINPUTS.amstex = .;$TEXMF/tex/{amstex,plain,generic,}//
> TEXINPUTS.csplain = .;$TEXMF/tex/{csplain,plain,generic,}//
> TEXINPUTS.eplain  = .;$TEXMF/tex/{eplain,plain,generic,}//
> TEXINPUTS.ftex = .;$TEXMF/tex/{formate,plain,generic,}//
> TEXINPUTS.jadetex = .;$TEXMF/tex/{jadetex,plain,generic,}//
> TEXINPUTS.mex = .;$TEXMF/tex/{mex,plain,generic,}//
> TEXINPUTS.mex-pl = .;$TEXMF/tex/{mex,plain,generic,}//
> TEXINPUTS.texinfo = .;$TEXMF/tex/{texinfo,plain,generic,}//
>
> % LaTeX 2e specific macros are stored in latex/, macros that can only be
> % used with 2.09 in latex209/.  In addition, we look in the directory
> % latex209, useful for macros that were written for 2.09 and do not
> % mention 2e at all, but can be used with 2e.
> TEXINPUTS.cslatex = .;$TEXMF/tex/{cslatex,csplain,latex,generic,}//
> TEXINPUTS.platex  = .;$TEXMF/tex/{platex,latex,generic,}//
> TEXINPUTS.platex-pl  = .;$TEXMF/tex/{platex,latex,generic,}//
> TEXINPUTS.latex = .;$TEXMF/tex/{latex,generic,}//

And here is the latex input path:
	texmf/tex/latex/
	texmf/tex/generic/
	texmf/tex/

altpdflatex calls latex so this path is in use.

> TEXINPUTS.latex209 = .;$TEXMF/tex/{latex209,generic,latex,}//
>
> % Fontinst needs to read afm files.
> TEXINPUTS.fontinst = .;$TEXMF/tex//;$TEXMF/fonts/afm//
>
> % MLTeX.
> TEXINPUTS.frlatex = .;$TEXMF/{mltex,tex}/{french,latex,generic,}//
> TEXINPUTS.frtex   = .;$TEXMF/{mltex,tex}/{french,plain,generic,}//
> TEXINPUTS.mllatex = .;$TEXMF/{mltex,tex}/{latex,generic,}//
> TEXINPUTS.mltex = .;$TEXMF/{mltex,tex}/{plain,generic,}//
>
> % e-TeX.  This form of the input paths is borrowed from teTeX.  A 
> certain
> % variant of TDS is assumed here, unaffected by the build variables.
> TEXINPUTS.elatex   = .;$TEXMF/{etex,tex}/{latex,generic,}//
> TEXINPUTS.etex     = .;$TEXMF/{etex,tex}/{plain,generic,}//
>
> % pdfTeX.  This form of the input paths is borrowed from teTeX.  A 
> certain
> % variant of TDS is assumed here, unaffected by the build variables.
> TEXINPUTS.pdfcslatex = 
> .;$TEXMF/{pdftex,tex}/{cslatex,csplain,latex,generic,}//
> TEXINPUTS.pdfcsplain = .;$TEXMF/{pdftex,tex}/{csplain,plain,generic,}//
> TEXINPUTS.pdfjadetex = .;$TEXMF/{pdftex,tex}/{jadetex,plain,generic,}//
> TEXINPUTS.pdflatex = .;$TEXMF/{pdftex,tex}/{latex,generic,}//

And here is the stuff for pdflatex, it should be clear now how this 
works. pdftex looks in

	texmf/pdftex/latex/
	texmf/pdftex/generic/
	texmf/pdftex/
	texmf/tex/latex/
	texmf/tex/generic/
	texmf/tex/

So, if you want your source to include different versions of sty files 
for pdflatex and pdftex, you can put one in the pdftex subdirectory 
(where it will be found first by pdftex and where ordinary tex does not 
look at all) and you can put one in the tex subdirectory where pdftex 
looks only second and where it is found by tex.

> TEXINPUTS.pdfmex   = .;$TEXMF/{pdftex,tex}/{mex,plain,generic,}//
> TEXINPUTS.pdfmex-pl = .;$TEXMF/{pdftex,tex}/{mex,plain,generic,}//
> TEXINPUTS.pdftex   = .;$TEXMF/{pdftex,tex}/{plain,generic,}//
> TEXINPUTS.pdftexinfo = .;$TEXMF/{pdftex,tex}/{texinfo,plain,generic,}//
>
> % pdfeTeX.
> TEXINPUTS.pdfelatex = 
> .;$TEXMF/{pdfetex,pdftex,etex,tex}/{latex,generic,}//
> TEXINPUTS.pdfetex   = 
> .;$TEXMF/{pdfetex,pdftex,etex,tex}/{plain,generic,}//
> TEXINPUTS.pdfemex   = 
> .;$TEXMF/{pdfetex,pdftex,etex,tex}/{mex,plain,generic,}//
> TEXINPUTS.pdfemex-pl = 
> .;$TEXMF/{pdfetex,pdftex,etex,tex}/{mex,plain,generic,}//
>
> % Omega.
> TEXINPUTS.lambda = .;$TEXMF/{omega,tex}/{lambda,latex,generic,}//
> TEXINPUTS.omega = .;$TEXMF/{omega,tex}/{plain,generic,}//
>
> % Context macros by Hans Hagen:
> TEXINPUTS.context = 
> .;$TEXMF/{pdftex,etex,tex}/{context,plain,generic,}//
>
> % odd formats  needing their own paths
> TEXINPUTS.lamstex  = .;$TEXMF/tex/{lamstex,plain,generic,}//
> TEXINPUTS.lollipop = .;$TEXMF/tex/{lollipop,plain,generic,}//
>
> % Earlier entries override later ones, so put this last.
> TEXINPUTS = .;$TEXMF/tex/{generic,}//
>
> % Metafont, MetaPost inputs.
> MFINPUTS = .;$TEXMF/metafont//;{$TEXMF/fonts,$VARTEXFONTS}/source//
> MPINPUTS = .;$TEXMF/metapost//

etc.

-----------------------------------------------------------------
To UNSUBSCRIBE, send email to <info at email.esm.psu.edu> with
"unsubscribe macosx-tex" (no quotes) in the body.
For additional HELP, send email to <info at email.esm.psu.edu> with
"help" (no quotes) in the body.
This list is not moderated, and I am not responsible for
messages posted by third parties.
-----------------------------------------------------------------
</x-flowed>




More information about the macostex-archives mailing list