[XeTeX] Re: [MacTeX] XeTeX

Ross Moore ross at ics.mq.edu.au
Mon Apr 12 03:08:40 CEST 2004


Hi Bruno,

On 12/04/2004, at 1:40 AM, Bruno Voisin wrote:

> Hi Ross,
>
>>>> mv /tmp/xetex-install/bin/*   ${bindir}
>>>> mv /tmp/xetex-install/web2c/* ${web2cdir}
>>>> mv /tmp/xetex-install/otf/*   ${otfdir}
>>
>> The values ${bindir}, ${web2cdir}, ${otfdir}  are (supposed to be) set
>> within the preflight script, to be within the  texmf.local  tree. Thus
>> they should survive updates.
> I think the first value is rather set to
> /usr/local/teTeX/bin/powerpc-apple-darwin6.8:

Yes, you are right; this one isn't in the local texmf/ tree.
However,
   1.  this directory should be in your $PATH variable,
       so the programs in there can be found using  which .

   2.  when installing a new version using  tar  then existing
       directories are not rewritten --- rather, new files
       are added and old ones updated. So local additions should
       survive an update...

    ... unless the update strategy is to create a completely
       new directory and remove the old one entirely.

>
>>> - binaries are installed inside
>>> /usr/local/teTeX/bin/powerpc-apple-darwin6.8:
>>>
>>> -rwxr-xr-x  1 brunovoi  staff   515460  7 Apr 16:51 xdv2pdf
>>> lrwxr-xr-x  1 brunovoi  staff        5  9 Apr 23:13 xeinitex -> xetex
>>> -rwxr-xr-x  1 brunovoi  staff  1060392  7 Apr 16:51 xetex
>>> lrwxr-xr-x  1 brunovoi  staff        5  9 Apr 23:13 xevirtex -> xetex
>
>  Isn't this directory affected by updates?

     see above.  Does Gerben replace whole directories ?
     Certainly the TeXLive installer does not (at least in
     the pre-gwTeX days).

>
>> Compiling a LaTeX format is easy enough:
>>  [...]
>> Next, create a command  xelatex  similar to  pdflatex ;
>> viz.
>>
>> [glenlivet:] rossmoor% more `which pdflatex`
>> #!/bin/sh
>> test -f "`kpsewhich pdflatex.fmt`" || fmtutil --byfmt pdflatex
>> exec pdftex -fmt=pdflatex -progname=pdflatex "$@"

This says...

1st line:
  test to see whether  pdflatex.fmt  exists within
  a valid  texmf/ tree.  If not, then create it.

2nd line:
  run pdftex with pdflatex.fmt preloaded, and use the name
   'pdflatex' to identify this kind of action.
  Also, make sure to use all the command-line arguments $@
  that the user provided.

>>
>> [glenlivet:~/Sources/XeTeX/XeTeX samples] rossmoor% more `which
>> xelatex` #!/bin/sh
>> test -f "`kpsewhich -format=fmt -progname=xetex xelatex.xfmt`" ||
>> fmtutil --byfmt xelatex exec xetex -xfmt=xelatex -progname=xelatex 
>> "$@"


> That's where I get completely lost! I remember maybe two years ago
> somebody posting on the OS X TeX list similar instructions, sent to the
> poster by Gerben, for compiling custom formats. I gave up then, as I
> couldn't understand the instructions, and I must admit I'm none the 
> wiser
> now. Being able to compile custom formats and have them used by 
> TeXShop is
> something I miss from Textures.

You can do all that with teTeX.
Here are the steps; hopefully this will make some sense to you:

   1.  use  pdfinitex   instead of  pdftex
       or   pdfinilatex  instead of  pdflatex

      Later versions of teTeX allow options instead:
         pdftex -ini
         pdflatex -ini
      Similarly use  initex   or   tex -ini
        or  inilatex  or   latex -ini
      for non-PDF formats.

    (Textures allows you to bypass this "safety" step,
     by allowing the standard formats to recognise \dump ;
     but it does provide a VirTeX format with fewer definitions
     preloaded.)


   2.  place  \dump  at the place in your code where you want
       the format to be dump'd from --- same with Textures.


Upon running the command on your modified source a .fmt
  file will be produced, having name
          \jobname.fmt
  ... where \jobname  is either the prefix part of the name
  of the main file that was \input ,
  or is a name specified explicitly using  -jobname
   e.g.  -jobname=myformat .


   3.  rename the .fmt (if you want --- no spaces allowed!!)
       move the .fmt  into a place where TeX expects to look
       for such format files; e.g.
              ...../texmf.local/web2c/


   4.  add a line into   texmf.cnf  that will help TeX find
       any support files that your new format needs;
       e.g.
         (for  myformat.fmt  being customised from LaTeX)

         TEXINPUTS.myformat  =  .;$TEXMF/tex/{generic,latex}//


   5.  make sure to run:  sudo texhash


Now you should be able to use commands such as:

      pdftex &myformat  <document-name>

or, if 1st-line parsing is on, then you can start documents with:
     % &myformat
then just use   pdftex <document-name>  .

But if you want to use a command like:
      pdfmytex  <document-name>
then you need to write a short executable script command,
similar to those shown above.


> How to create this command, and where? I have never used "which", or 
> known
> about it. Using man, I have the impression "which" uses information on 
> the
> user's path to find out what would be executed had (in your example)
> "pdflatex" been given as a command.

Yes;  'which'  uses exactly the same paths as the command-line shell
does when you specify a command to run.
It tells you "which" command will run, if you try to execute from
a directory.  This is especially important when you may have several
different versions of a command installed in different places on
your Unix system.

Mac OS 'Classic' is deficient in not allowing applications with the
same name.  For novice users, this is a useful simplification;
but for experts this was viewed as a terrible deficiency in the OS.


> But:
>
> - In my case pdflatex is simply an alias to pdfetex, not a shell 
> script as
> it seems to be in your example:

OK; my setup is based on an earlier version of teTeX .

Nowadays, the command name can be parsed to help decide
which format file to preload.
e.g. with the symbolic link   pdflatex -> pdfetex
the commandline is parsed to detect the  'latex' .
THe result should be the same as:
       pdfetex &latex  <document>
or    pdfetex -fmt=pdfelatex  <document>

The (older) script method should still work.
Indeed, this may be the only way that does work with your
own \dump'd formats, since the command-parsing may not be
able to determine which .fmt to preload.
Try it and see.


> Portable-de-Bruno:/usr/local/teTeX/bin/powerpc-apple-darwin6.8
> brunovoisin$ ls -ltotal 100504 [...]
> -rwxr-xr-x  1 root      admin  3599440  7 Feb 11:26 pdfetex
> lrwxr-xr-x  1 root      admin        7 28 Mar 17:03 pdfjadetex -> 
> pdfetex
> lrwxr-xr-x  1 root      admin        7 28 Mar 17:03 pdflatex -> pdfetex
> lrwxrwxrwx  1 root      admin        6 28 Mar 17:00 pdfmex -> pdftex
> lrwxrwxrwx  1 root      admin        6 28 Mar 17:00 pdfplatex -> pdftex
> -rwxr-xr-x  1 root      admin  3497540  7 Feb 11:25 pdftex
> lrwxrwxrwx  1 root      admin        6 28 Mar 17:00 pdftexinfo -> 
> pdftex
> -rwxr-xr-x  1 root      admin     1014 18 Feb  2003 pdfthumb
> lrwxrwxrwx  1 root      admin        7 28 Mar 17:00 pdfxmltex -> 
> pdfetex
>
> - Trying "more `which pdflatex`" as in your example just returns
> incomprehensible gibberish in Terminal, and sets the window to reverse

OK; that's because you are looking at a binary file, not a script.
That's the "new" teTeX way. I still use the older way.

> video. It launches some process that isn't closed, every time I press a
> key more gibberish is added, and I have to Ctrl-C to terminate.

Just typing 'q' (for 'quit') or 'x' (for 'exit') should get you out.


> - According to the man page, "which" takes its info from .cshrc. But I
> don't have any such file, possibly because I use bash not csh. I have a
> ..login and a .profile, is this equivalent for bash? My .profile reads:
> Portable-de-Bruno:~ brunovoisin$ more .profile
>

I use  bash .
It's the $PATH variable that matters.


Cheers

	Ross


>
> _______________________________________________
> MacTeX mailing list
> http://tug.org/mailman/listinfo/mactex
>
------------------------------------------------------------------------
Ross Moore                                         ross at maths.mq.edu.au
Mathematics Department                             office: E7A-419
Macquarie University                               tel: +61 +2 9850 8955
Sydney, Australia                                  fax: +61 +2 9850 8114
------------------------------------------------------------------------

_______________________________________________
MacTeX mailing list
http://tug.org/mailman/listinfo/mactex



More information about the XeTeX mailing list