[XeTeX] [OS X TeX] Re: texdoc, was: Microtypography?
Peter Dyballa
Peter_Dyballa at Web.DE
Tue May 9 11:36:48 CEST 2006
Am 09.05.2006 um 10:47 schrieb Bruno Voisin:
> However, trying texdoc right now I'm realizing it opens PDF files
> in Preview and DVI files in TeXShop. That is, this is how things
> work on my setup: the man page for texdoc mentions environment
> variables $TEXDOCVIEW_dvi, $TEXDOCVIEW_pdf, $TEXDOCVIEW_ps,
> $TEXDOCVIEW_html and $TEXDOCVIEW_txt, but I can't find them in the
> various texmf.cnf on my setup. Maybe these variables are overriden
> by the Mac OS X association of file extensions (.dvi, .pdf and so
> forth) and applications (TeXShop, TeXniscope, Preview and so forth)?
These variables are not for or from a shell's environment and they do
not mean anything to TeX, so they are not in any texmf.cnf file. And
since texdoc is a general script it has no special connection to Mac
OS X or MS Windows specific mechanisms. The variables are internal
symbols texdoc uses. This block around line no. 85:
case `(uname -s) 2>/dev/null` in
Darwin)
: ${TEXDOCVIEW_dvi='open -a TeXniscope %s'} # TeXShop 2, too?
: ${TEXDOCVIEW_pdf='open -a TeXShop\ 2.app %s'}
: ${TEXDOCVIEW_ps='open -a TeXShop\ 2.app %s'}
: ${TEXDOCVIEW_html='open -a OmniWeb.app %s'}
: ${TEXDOCVIEW_txt="open -a Emacs %s"}
: ${TEXDOCVIEW_="open -a Aquamacs\ Emacs.app %s"} # no
extension, default to pager
: ${TEXDOCVIEW_txt="emacsclient %s"}
: ${TEXDOCVIEW_="emacsclient %s"} # no extension, default to
pager
extlist='.pdf .ps .txt .dvi .html'
;;
checks the case in which operating system the script was invoked and
then in the case of "Darwin" (which includes Mac OS X) assigns
application names to the internal variables which are used later.
Then the script has found with kpsewhich from the "hash" files the
location of possible doc files for the argument you gave and now
decides on the file's extension which viewer is appropriate (line no.
175++). Texdoc uses the sequence of extensions as in the extlist
variable to determine the doc file, so it's useful to adapt this
sequence to one's preferences. (The lines start with ``:´´ to make
the shell "expand" variables, like $PAGER for example.)
The code block above is from my personal copy of texdoc which I saved
in ~/bin. This way my personal version is found first -- I only have
to check from time to time (after installing/updating the tex i-
Package) whether the system's and my version are still in sync.
Texdoc does not check for environment variables except PAGER to
display text files page-wise with, or the name of a directory for
temporary files. And texdoc does not understand that some authors
call the documentation for their package xyz "manual" ...
--
Greetings
Pete
Without vi there is only GNU Emacs
More information about the XeTeX
mailing list