[OS X TeX] Building new formats (MacTeX)

Rowland McDonnell rjmm-lists1 at fireflyuk.net
Mon Sep 18 17:28:41 EDT 2006


> On 17-sep-2006, at 22:23, Rowland McDonnell wrote:
> 
> >> Hi Rowland,
> >>
> >> Instead of trying to answer your mail in between, I'm going to top-
> >> post (boo!), and answer what I think is your question.
> >
> > Fine by me - if it results in a nice clear explanation of something  
> > that
> > helps me understand something, I'll lap it up.
> >
> > Thank you for putting the time in to try to help clear things up.
> >
> >> If I answer the wrong question, please be as exact as you possibly
> >> can in asking a follow on question.
> >
> > I've tried to do that.
> >
> >> So what do I think your question is? How do I customise my TeX
> >> install to include the UK hyphenation patterns?
> >
> > Not quite: what I'm trying to do is customize my TeX installation
> > so that I get UK hyphenation /by default/ in all documents, while
> > deviating from standard practice as little as possible.
> >
> > I suspect the sensible way to do this is build my new formats
> > without Babel being involved at all, and use my existing hyphen.cfg
> > file. \language=0 US English, \language=1 UK English, \language=1
> > is what you get for typesetting by default.
> 
> *Warning* there is a way of getting UK English to be the default, and  
> it is hinted at below: make sure that language 0 _is_ UK Enlish. The  
> fixed names will not change (if there is infact a difference for  
> certain sections (table of contents, etc). Oh, here is the warning  
> bit: this breaks with the configuration everyone else uses.

Yes, which is as I say, why I want to set the default to \language=1.
As I show below, this is easy to arrange with the standard LaTeX
hyphenation configuration mechanism.  I've failed to find out enough
about how Babel works, so I can't see how to do it with Babel.

Having given up on doing things the sensible way, I dived into the
source code a bit and came up with Babel's hyphen.cfg file.  I suspect
if I want to subvert the usual Babel way of doing things, I'd have to
modify the Babel hyphen.cfg file, and the code it contains is far too
involved for me to understand.

I think I'm best just unplugged Babel and using my old hyphen.cfg file.
For which I'll have to get to grips with the TDS and kpsewhich.  Nothing
is easy...

> >> Since I normally use i-Installer to install and customise my tex,
> >> I had to do quite a bit of digging to answer this without the
> >> short but for some reason unacceptable (to you anyway) "Just run
> >> the i-Installer configure stage".
> >
> > <puzzled>  `For some reason'?  If you've got as far as understanding
> > that I don't want to use i-installer, surely you've got as far as
> > understanding the reasons?
> 
> I don't thnk it is a valid reason, with the caveat inserted below.

So you think that I *should* use an installer that I can't use to do
what I want?  What on Earth is the point in that?  I did use it.  I
ended up with data on my hard disc and no working software.  I cannot
figure out anything about how to use i-installer to give me what I want,
or indeed anything remotely useful.  I asked the author for assistance.
I got none.  I tried to get help via this mailing list.  A complete
washout.  i-installer is a disaster.

And you think that my reasons are *invalid*?  Personal experience which
shows that I cannot work out what the controls do?  Personal experience
which shows that there is no useful documentation, and the author will
not provide help to a confused user?  Pfft.  You're insane if you don't
think they're valid reasons.

Why oh why is everyone on this mailing list so addicted to i-installer?
I just don't get it.  Why not accept that *one size does not fit all*
and that some people would rather do things their way?  Can you accept
that other people have different experiences from you?  I dunno, I
really don't.  People are different.  So you understand i-installer -
fine.  I don't get it at all.  Can't you just accept that?  And why will
you not accept that it's perfectly valid to not use software that you
cannot control?

> > The short reason is:
> >
> > I cannot control i-installer.  Specifically, I do not have the
> > ability to use i-installer to configure TeX to do what I want.
> 
> After thinking a bit longer: you're right in that respect as far as  
> plain TeX is concerned.

I'm right in that respect as far as *EVERYTHING* is concerned.  What
makes you think you're in a position to have an opinion independent of
mine on this?  I tell you that I cannot control i-installer to configure
TeX (or anything else) the way I want.  You are not in a position to
have an opinion on this: only I can know, and I'm telling you what the
facts of the matter are.  You can think that I'm lying to you and wrong
on those grounds, but you can't `think about it' and conclude something
different.

> > I do not have the ability to learn what I need to learn about how
> > i-installer works, so I have to find out how to do the job some
> > other way.
> >
> > [I'm not going to use some software that does what i-installer
> > does: make large changes to the data on my computer without me
> > having the faintest idea what it's doing.
> >
> > Isn't that normal prudent computer management?]
> 
> <<puzzled: and you use the MacTeX installer?>>

Certainly.  I'd rather not use anything like it, but if I want a modern
TeX on my Mac, I have no choice but i-installer or MacTeX.

Now, I've tried i-installer and just ended up with junk on my hard disc
that I'm going to have to re-format to remove.  The documentation is
useless, and so's the author if you ask him for help.  i-installer has a
lot of complex controls and whatnot that are not adequately explained:
it's not possible for me to learn to use it in an intelligent fashion,
so i-installer's out of the question.

Which leads me on to MacTeX. It's a monolithic installer with very
little configurability.  That means it's likely to `do just the one job
it was designed to do, without causing trouble because that's been
tested to do that job because it's possible to so test it'.  i-installer
is clearly designed to be able to do `everything', has extensive
abilities to mess about with your computer (under `user control', no
less), but doesn't come with proper instructions and can't have been
adequately tested.  So MacTeX it is, by a process of elimination rather
than attraction.

I didn't dare use even MacTeX until I had a second Mac to try it on -
but I've got one now, and I'm trying to set up MacTeX on it, while using
my old G4 for `anything I need to do'.  It turns out that the MacTeX
installer doesn't work properly, but while i-installer's author wouldn't
help me sort out i-installer, he did help me sort out the problems I had
with MacTeX.

I'm still up against the problem of missing documentation, but there you
go.

> >> The answer it seems comes in two stages: fmtutil and its
> >> configuration, and the language configuration files for the
> >> various formats. Yes, careful digging reveals that there is more
> >> than one, and they are not all called "language.dat"
> >>
> >> So, one step at a time: fmtutil will take the appropriate actions
> >> for you to build a format.
> >
> > Do you know how I can find out what it does?  I'm a Mac user, not a
> > Unix expert of any sort.  I need to know what steps are followed so
> > that I understand what's going on.  I might not be a Unix expert,
> > but I *am* a bit of a TeXnician.
> 
> try running the fmtutil command on a single format:
> sudo -H -u root fmtutil --byfmt pdflatex

NO!  Absolutely no way am I going to do anything like that!  I'm not
going to prod the `rebuild formats' button unless I know what's going to
happen.  Don't be daft!  So I get some rebuilt formats, configured along
who knows what lines, so my next step?  I won't know what's happened or
why, so now I've got to re-install MacTeX, and re-do all my
re-configuration steps.  Absolutely no way am I doing all that, just to
try out a single script invocation which won't teach me a bloody thing.

> The first line of output lists the command used to create the format:
> pdfetex -ini   -jobname=pdflatex -progname=pdflatex -translate- 
> file=cp227.tcx *pdflatex.ini

Er, yes, but so what?  I want to find out what fmtutil does, step by
step.  You're just telling me about one piece of output that it gives.

That's *incredibly* irritating of you, as far as I'm concerned.  I'm
trying to find something out, and this really isn't the slightest use to
me.

> >> I would advise against doing it manually, even
> >> though pdfetex -ini and some other parameter calls is certainly
> >> possible.
> >
> > I read the documentation, which does talk about using iniTeX and
> > doesn't mention fmtutil in any obvious places, so I decided to take
> > the route that the documentation suggested.
> 
> initex is pretty much the old name (it used to be a different  
> program, back when computers suffered from a shortage of memory.  
> These days tex as D.E. Knuth wrote it is only used for (plain) tex.  
> All others use pdfetex as the engine. This is true on all platforms.  
> The calling sequence on web2c is moving slowly towards std unix, with  
> many more argument than tex ever had.

Er?  Sorry, I don't understand.  iniTeX is tex - i, right?  So I assume
that inieTeX is etex -i.

But aside from that, you've lost me completely.  I really can't figure
out any point or sense in the above paragraph.

I do know that not all TeX distributions use eTeX exclusively for all
LaTeXing.

> > fmtutil does look like a better idea - but how can I learn about it?
> 
> fmtutil is part of tetex and texlive. 

Yeesss...

>It is also the tool that is  
> used when installing tex on your machine (both MacTeX and i- 
> Installer).

Really?  What and when?

> However, I don't know of documentation. 

Argh.  Okay.

>As I wrote above,  
> the command it executes is listed above (at least for pdflatex).  
> Perhaps this is enough to get Google going?

If you can find anything useful about any of this via Google, you're
cleverer than I am.  I've often tried (and tried again just now), but
I've never been able to find anything using a Web search engine to tell
me about the guts of TeX.

> >> TeTeX however includes some management utilities to make
> >> life easier, just use them.
> >
> > This is very easy to say, but it's very hard to do in practice -
> > what `management tools' does teTeX come with?  How does one use
> > them? There is no documentation to explain that I can find, so I
> > must say that these tools are certainly not included with teTeX for
> > the convenience of the ordinary Mac user who wishes to look after a
> > MacTeX installation - perhaps they are there for the convenience of
> > established expert Unix sysadmins?
> 
> The latter, mostly. But there are three tools worth knowing about:  
> updmap, fmtutil, and texconfig.

Okay.

> Documentation: if you screw up, you  
> can always reinstall MacTeX and start over.

Yes, can't I just.  Except that I'd rather not.  Dear god, that's a
dreadful way to run things.  I certainly wouldn't have bothered with TeX
on my Macs in the first place if it had been this shoddily organized.

> Make sure you keep  
> detailed notes.

Oh good.  The whole point of the way I want to arrange things is so that
I might avoid the need to do so.  Backups, yes - but I do *NOT* want to
have to keep detailed notes: I want to be able to hold the entire
`custom' part of the organization in my head, as I've managed with OzTeX
and CMacTeX.

> > These `management tools' (I've come across things like updmap,
> > fmtutil, and a couple of others) are barely mentioned in any
> > documentation, let alone adequately documented
> 
> I agree that some documentation seems to be missing in action, OTOH,  
> I think that you either are too afraid to try,

<puzzled>  Do you not understand the problem: I have *experience* which
teaches me that `just trying' this sort of thing produces *NO LEARNING*
and *NO BENEFITS*.  I am unable to sort anything out that way at all.
It just plain doesn't work.  Do you understand yet?

I have experience which teaches me that `prodding the buttons to find
out what happens' generally leads me to learn nothing at all, and
sometimes leads to problems.  So I don't do it any more - it's
pointless, and sometimes harmful.  Isn't that called `rational human
development'?

> or need documentation  
> that is beyond the level required by people who tinker with this kind  
> of stuff.

You're very, very wrong.  I /am/ `people who tinker with this kind of
stuff'.  The documentation is not there for me any more, although it
used to be.

I just need ordinary minimally adequate documentation with proper
explanations coupled with examples.  Admittedly, that's well beyond that
which is used by the selected band of people who are Unix hackers, but
while they're trying to limit `the people who tinker with this kind of
stuff' to themselves by keeping the information away from other `types',
they've not quite succeeded

> > - but since they're more widely used than i-installer, I'm taking
> > the line that I might be able to find out how to use some of them
> > (if only because <news://comp.text.tex> is less hostile than this
> > mailing list).
> 
> _Less_ hostile? It depends on the initial tone I guess.

My tone is fairly invariant.  I find it depends on the people and
established environment in the forum more than anything else.

I've found all bar one technical mailing list or newsgroup I've been
involved in much more pleasant and less hostile than this one, and I've
been involved in more than one or two.  (The exception was the Alpha
devlopers' mailing list - as with this mailing list, there were certain
sacred cows which could not be criticised, and doing so resulted in much
flamage.)

The *only* personal badness I've met in the last several years on
<news://comp.text.tex> has come from two users of this mailing list who
decided to flame me on <news://comp.text.tex>, making reference to the
TeX on Macs mailing list as they did so, which is how I know where the
low-lifes came from.

As I say, it's the users: this mailing list clearly has a lot of
mean-spirited users who enjoy all that `flaming' and similar rubbish
(apparently supported, I'm sorry to say, by the list administrator).
Two of them actually took the flaming to a different forum; one of them
got told off by `someone else', who took the trouble to point out that
I'm not a troll.

(note to the list admin: you'll observe that I name no names)

> >> OK fmtutil. This tool is a shell script, so in principle, one can
> >> figure out what it does.
> >
> > I'm a Mac user, and no sort of Unix expert.  You might as well tell
> > me to read the Rosetta stone as read the source code.
> 
> The principle in my text was indeed meant as you interpretation. I
> just want to leave a paper-trail on how I figured this out.

I'm sorry, I don't follow what you mean.

> >> There is an --edit option to the tool, that
> >> you can use to edit the file,
> >
> > How does the --edit option work?
> 
> Depending on the permissions: fmtutil --edit

No, that's how to invoke it (and what permissions are you talking about
anyway?).

What I want to know is what does the computer do in response to a user
telling it:

fmtutil --edit

?

> >> however, there are some permissions
> >> checks on that, and for me this doesn't work.
> >
> > Er?
> 
> I'm running as a non-admin user, but I doubt that fmtutil will be  
> able to contact say BBEdit, because it is wriiten with a unix  
> background (and vi) in mind.

Sorry, I don't follow that at all.

> >> Luckily, the default
> >> name for the configuration file can be found in the script:
> >> "fmtutil.cnf",
> >
> > You seem to be suggesting that the best way to learn about this
> > sort of thing *is* to read the source code - is that what I'm
> > expected to do myself, to learn about this sort of stuff?
> 
> No, well, yes. At least that is the paper trail I left behind.  
> Another option is to look in the web2c directory in the texmf-tree,  
> and note that there is a fmtutil.cnf file, a updmap.cnf file, and  
> various other config files.

Er?  So you suggest that I look in all the directories that come with
MacTeX and note `interesting things' so that I can recall them at a
later date?  For what purpose would I want to spend those tedious weeks
looking in directories?  And what would I be noting, and why?

I don't see how I'm supposed to be able to remember any of it, or make
use of any information like that.  What does it mean?  I don't know.  So
I can look in folders and see files.  Yes?  And?  How does any of that
help me?  I don't see it.

> >> and kpsewhich can be used to find which one is used:
> >
> > `kpsewhich' returns only:
> >
> > Missing argument. Try `kpsewhich --help' for more information.
> 
> kpsewhich filename, i.e. kpsewhich fmtutil.cnf Do I really have to  
> spell out every detail?

<helpless>  Yes, of course.  In the early stages of learning, it is
always essential to provide examples of what you mean.  Without concrete
examples linked to explanations, it's very hard for anyone to learn
anything and most people will end up learning nothing.  I'm the trained
teacher round here, by the way.

In the case of almost everything to do with TeX on MacOS X, I'm in the
`early stages of understanding' where I need a good explanation coupled
with a good set of examples.

I've noticed that Unix people don't like giving explanations linked to
examples: they think that one or the other is good enough.  It's not.
It's worse that they seem to enjoy `optimizing' their explanations and
examples down to what they consider the bare minimum - which is rather
less than the bare minimum required by non-Unix experts.  Unix
documenation is mostly completely useless to everyone except Unix
experts due to this rather serious flaw.  The teTeX documentation
suffers from the same problem.

kpsewhich has many options.  I was expecting to have to search for a
*particular* fmtutil.cnf file, that is used for a particular
format(progname) or whatever.

I still don't see how I can trust that:

kpsewhich fmtutil.cnf

will find the file that will be used in a given circumstance.  I'll have
to RTFM again to find out exactly what the above invocation means,
exactly, but I would expect a reliable search using kpsewhich to be of
the form:

kpsewhich -progname=<XXX> fmtutil.cnf

and in any given situation, I've no idea what progname or other options
to use since I don't understand enough about how
MacTeX/teTeX/gwTeX/whatever works.

So: how can I find out which options with which to invoke kpsewhich when
I need particular information out of it?

> >> /usr/local/teTeX/share/texmf/web2c/fmtutil.cnf.
> >
> > Which command line incantation did you use to get that answer?
> >
> > kpsewhich <options> fmtutil.cnf
> >
> > is what you used, correct?  Which options, and why?
> 
> No options at all. Try! 

Why?   It's impossible to learn anything from trying things out with
these tools, and it's possible to mess things up badly.  Trying things
out is therefore pure vandalism.  I'm not going to do that.

>The worst that can happen is that you get an  
> error message.

Don't be daft.  The worst that can happen is that I trash everything on
the machine.  I've not tried it out, but I can't help feeling that:

sudo rm -r /

might be a bit problematic.  I once `broke' an Apollo box by
accidentally (really) typing in a command that endlessly created
directories in a recursive fashion.  The sysamin was faintly amused at
the novel way I'd managed to /completely accidentally/ use up all the
spare disc space (it was a home machine - student house: we had a PDP/11
upstairs - and very lacking in disc space; it had a 70MB HDD with
built-in 8 inch floppy, the whole disc drive unit being about the same
size as my 2003 MDD 2G4 tower), and it wasn't hard to `fix', but...

Anyway, I've had lots of experience of running in to similar trouble,
and nearly as much experience discovering that the only way out of most
of it is a local Unix expert.  I don't have one any more, so I dare not
play too freely: this is because of practical experience.  It is not
fear: it is rational caution based on personal experience.

> No, don't try the "rm" command so liberally, but these  
> tools are fairly robust.

Yes, but they are working on structures that are not robust.  Worse: I
can learn nothing by trying them out.  So I could do stuff with them,
trying to find out information.  So I get a tiny amount of information.
Not enough to be useful, with the additional question: is the
information I have worked out correct?  No way of finding out - except
by trying (again), and how can I find out if it works?  I'm working with
a system that's too complex for me to test.  I cannot discover anything
about it.  No, I can't find out what these commands do by trying them: I
simply have no means to test the state of the system before and after
and do the required comparison.  I must use other methods.

> >> There are some notes at the top of the file, and I copied an
> >> example:
> >>
> >> # The format of the table is:
> >> # format  engine      pattern-file    arguments
> >> # The last part of "arguments" must be the name of the file to run
> >> # initex (or another "ini"-engine) on.
> >>
> >> pdflatex  pdfetex     language.dat    -translate-file=cp227.tcx
> >> *pdflatex.ini
> >>
> >> so the pdflatex format uses the pdfetex engine, uses langage.dat
> >> for the language configuration, and needs some codepage
> >> translation. The macros themselves are loaded from pdflatex.ini.
> >
> > Okay - I've not come across these *.ini files before.  I've read the
> > teTeX manual, and it doesn't mention them.
> 
> The ini files are actually the core tex files. 

`Core tex files'?  I've never heard that phrase before.  I've no idea
what you might be talking about.

What does `core tex files' mean?

>they can be found with  
> kpsewhich:
> kpsewhich pdflatex.ini
>      /usr/local/teTeX/share/texmf.gwtex/tex/latex/config/pdflatex.ini

Does that find the file which will be used when I create formats using
ftmutil?

> and the contents of that file is:
> % Thomas Esser, 1998. public domain.
> \input pdftexconfig.tex
> \scrollmode
> \input latex.ltx
> \endinput

Yeah, okay, I had got that far myself - but which ini files are they,
that you find that way?  I don't know what they are used for or by what
- simply that these are ini files that kpsewhich tells me exist in some
of my texmf trees.  Which invocation of kpsewhich do I need to use to
find the *right* version of the ini files which will be used when I
create formats?

What I think I really need to know is this:

What place do these ini files have in the structure of teTeX?  What am I
allowed to do with them?  How are they supposed to fit in to the scheme
of TeX?  Where should I put modified versions that I want to have
over-ride the standard versions?

I don't know, and I need to know.  I've got written documentation for
pretty much everything to do with creating TeX formats under normal
conditions, but this is a worry.

> > Can you suggest where I can look to find out about these files and
> > how they fit in to the system of TeX (ini/La/pdf/whatnot) that I
> > know about?
> 
> They give the init command for the specific format, basically the  
> dump command: tex -ini '\input plain \dump' for plain, or pdfetex - 
> ini '\input pdftexconfig.tex\input latex.ltx' (the last command in  
> latex.ltx is \dump).

Righto - thanks.  That makes sense.

[snip]

> >> The fmtutil loops
> >> over all formats that are not commented out, and uses these
> >> parameters to create the format in the right location.
> >
> > What is fmtutil's idea of `the right location', and how do I find
> > out what it is?
> 
> see below.

I have done, and not seen any answer to this query.

> >> So, for formats where there is a format and a language file listed
> >> here, it is as easy as finding the pattern descriptions file
> >> (mostly language.dat, sometimes it is something else), and ask
> >> which one to use with:
> >>
> >> kpsewhich -progname="engine" pattern-file
> >>
> >> where engine and pattern-file refer to the table columns given
> >> above.
> >
> > Okay.  Which engine does one use as -progname?  It seems to me that
> > since iniTeX is used to build all formats, there's only one
> > language.dat file used, and that's the one that applies to iniTeX
> > in all instances of format building.
> 
> No. initex does not exist. I repeat: initex is dead.

TeX run with the -i option is iniTeX.  pdf[e]tex likewise.  iniTeX is
alive and well as far as I can see.  Why claim otherwise?

> The full command  
> as used by fmtutil to build the latex format is
>      pdfetex -ini   -jobname=pdflatex -progname=pdflatex -translate- 
> file=cp227.tcx *pdflatex.ini
> 
> That is: the engine name is passed to the pdfetex -ini as the
> progname.

I'm sorry, I can't work out what this means.

> > But that's just a logical interpretation of the way the system
> > appears to work from what I've been able to infer from the very
> > limited amount of information I've been able to find out - one
> > seems to be expected to work it all out as `logical inferences'
> > from a few hints, and I can't.
> 
> The actual command as issued by fmtutil should help, I hope.

Well, no, not really.  That's just one thing that fmtutil does under one
set of circumstances, so I don't find being given that information very
useful at all.

What I need to know is what fmtutil does.

Look, I need `explanation and examples'.  Look at it like this: I'm
trying to build a model from a set of graphs.  I need points on the
curves to create the graphs.  What I'm getting is single data points,
but generally without even finding out which graph they belong to.  This
does not help in the slightest.  And because it's information presented
in a way that *prevents* me keeping it my memory, it's worse than
useless: it's irritating as well.

> >> I seem to recall you wanted babel in plain tex as well. On Mac OS
> >> X I assume this to mean that you want babel support in pdftex.
> >
> > I don't /need/ it - it's just that what I read indicated that
> > `everything' seemed to be using Babel, so I thought I investigate
> > using `doing it the standard way' for a change instead of just
> > `rolling my own' as I've done in the past.
> >
> > Now I've spent some time trying to find out how to get Babel to do
> > what I want, I am reminded of why I've always `rolled my own': it's
> > so damned hard to find out enough about quite a lot of the standard
> > methods to do anything with 'em.
> >
> > Writing your own solution might produce something less optimal in
> > an abstract, theoretical sense, but at least you know what it does
> > and can get it to do what you want, more or less.  This makes it a
> > far more fit for purpose than the standard methods, which `just
> > don't work' due to my inability to learn how to use 'em.
> 
> The hard bit of babel with plain is that standard palin does not  
> include support any language _but_ US English.

Righto.  I'll probably just hack things to give Plain TeX UK English as
\language=1, then, and leave \language=0 as the default.  I don't use
Plain very much, so I don't mind the inconvenience of having to tell my
computer to speak my language in this case.

> >> This is a bit more tricky, as the following fragment shows. Well,
> >> at least the instructions are there…
> >>
> >> # Change "tex.ini -> bplain.ini" and "- -> language.dat"
> >> # if you want babel support in tex. Add -translate-file=cp227.tcx
> >> before tex.ini
> >> # if you want to make all characters directly "printable" for
> >> # any \write (instead of ^^xy).
> >
> > `if you want to make all characters directly "printable" for
> > any \write (instead of ^^xy).'
> >
> > Erm.  Do I want that?  What does it mean?
> 
> Yes, you want that. It concerns the \typeout macro, and you don't  
> want hte double escape control characters.

What does one get instead?

[snip]

> > At the moment, I mostly use LaTeX with occasional Plain TeX.  I'd
> > like to look at ConTeXt one day, when I've got everything else
> > working, and I might well look at other formats.  But I've got to
> > get things set up and working first.
> >
> >> They both use language.dat (at least after the changes listed
> >> above), which shortens the discussion. You'll want to have the
> >> language.dat file in the texmf.local tree.
> >
> > No, I want to have my language.dat file(s?) somewhere else.
> 
> It is a single file, no s.

Well, no: there are four copies of language.dat that I can find.

Hattie:rowland rowland$ find /usr/local/teTeX  -name "language.dat"
/usr/local/teTeX/share/texmf.gwtex/tex/generic/config/language.dat
/usr/local/teTeX/share/texmf.tetex/tex/generic/config/language.dat
/usr/local/teTeX/share/texmf.tetex/tex/lambda/config/language.dat
/usr/local/teTeX/share/texmf.tetex/tex/platex/config/language.dat

It's multiple files, but which are used, and for what?  I cannot find
out because I can't work out which invocation of kpsewhich applies to
what happens when one uses fmtutil to re-create formats.

> > I want them in my local texmf tree, not texmf.local where they're
> > likely to be over-written by something automatic in the future.
> 
> Someone else may try to add that.

It's been done, and I'm using it.

>I would suggest to keep a backup of  
> texmf.local,

Fair enough.  I already have an easier way of doing things.

> since that is the easiest to configure for this type of  
> files.

Not with MacTeX, it's not: it's full of other peoples' stuff.  Not
suitable for local additions at all.

> For your own personal stuff I would recommend to use /Users/ 
> YourName/Library/texmf/...

Yes, but that's not applicable to the setup I've got here.

I will be adding `my personal stuff' to /Users/texmf.rjmm/, where it
will be accessible to all users and I'll be able to maintain things
without any of the trouble I'd have if I followed your suggestion to put
it  in texmf.local.

> However, for the config files during  
> format creation, an language.dat is one of them, this will not work,  
> since that part is done under sudo.

Er?  What?

> a backup of the config is a  
> _lot_easier.

I'm sorry, I just don't understand this last paragraph at all.

[snip]

[snip]

> > That text you quote does not appear in the language.dat files that
> > came with MacTeX that I'm looking at.
> >
> > And I'm not sure what you're advising me to do.  You refer to using
> > the Babel package to activate the UK English hyphenation patterns. 
> > Okay, but in what way?  I want to use the Babel package at
> > format-building time to set up LaTeX so that it defaults to UK
> > English hyphenation, but with all other hyphenations usually
> > available, also available and `set up pretty much as normal'.
> 
> Ai, that is not easy: latex.ltx includes \dump as the last command,  
> and as such it is hard to build a format that adds to the latex.ltx  
> format. For plain you might be able to do so, but instruction on how  
> to use babel in plain are needed first.

Damn.  So you're saying I'll have to ditch Babel if I want conveniently
set-up multi-lingual hyphenation?

> > Are you saying that I would be committing some kind of LaTeX sin by
> > setting up Babel to give me UK English hyphenation patterns as the
> > default?  What I'd like to do is have US English as language 0 (as
> > is standard), with UK English as `A.N. Other' language number, and
> > the language number for UK English being the default.  This
> > maximises my personal convenience: I want my computer to speak my
> > language by default.
> 
> No, what I'm saying is that it is hard to build a custom LaTeX  
> format, because of the somewhat impractical \dump command within  
> latex.ltx.

<puzzled>  I'm not asking about that at all.

It's actually incredibly easy to customise your LaTeX format for
whatever hyphenation you want, via the standard LaTeX2e hyphen.cfg
config file mechanism.  There are all manner of easy ways to create a
custom LaTeX format - hyphen.cfg isn't the only standard configuration
file that'll be read at format-building time, and don't forget David
Carlisle's `mylatex' package.

I was just wondering if I could have Babel as well as `US English as
\language=0', `UK English as \language=1' and `\language=1' as a
default.

(okay, I've got LaTeX2e documentation from a very long way back which
explains it all superbly - unfortunately, this documentation was
withdrawn and replaced with the junk that's currently available.  I wish
I knew why - perhaps to persuade people to pay money for the books?
They're not much better.)

> Loading multiple languages in plain tex is (by some)  
> considered to ne a mortal sin, or a violation of D.E.K.'s license to  
> TeX if you still call it TeX. But, hey, it is your system anyway. The  
> dirty trick would be to make UK English the same as language 0. Since  
> babel refers to the language by name anyway, it should hurt only a  
> bit, but for LaTeX I maintain that selecting the language at document  
> compile time is the more practical soultion.

I'm telling you that you are definitely wrong.

The best and most practical solution for me is to have what I have had
for years: US English as \language=0, UK English as \language=1, and
\language=1 as the default.  I'm damned if I'm going to arrange things
so I have to tell my computer to speak English every time I use it!
It's going to speak my brand of human lingo by default, and that's
*that*.  <harumph>

How could it possibly be easier to have to type something to configure
the language of my computer every time I write a document, than to set
the computer up to speak /real/ ;-) English (or die) by default?

(For any USAians who might be reading: I actually rather like some
USAian linguistic constructions - it's a lively dialect that you've got.
The bit I get worked up about is US pronunciation, which often makes me
want to scream things like: `Just speak properly.  Those vowels are all
different, damnit!  And now open your mouth!  Thank you.'  `Nukuler
missels'.  Argh.  And I've heard 'em say it, so don't say they don't.
Back to normal service, such as it is.)

The code contents of the hyphen.cfg file that causes this to happen are
below - didn't you read?

> > That's my current setup - done with this hyphen.cfg file for LaTeX:
> >
> > =============================================================
> > \language=0% Make bloody sure that the language is set right.
> > %
> > \InputIfFileExists{hyphen.tex}%
> >    {\message{Loading hyphenation patterns for US english.}%
> >     \language=0
> >     \lefthyphenmin=2 \righthyphenmin=3 }%
> >    {\errhelp{The configuration for hyphenation is incorrectly
> >              installed.^^J%
> >              If you don't understand this error message you need
> >              to seek^^Jexpert advice.}%
> >     \errmessage{OOPS! I can't find any hyphenation patterns for
> >                 US english.^^J \space Think of getting some or the
> >                 latex2e setup will never succeed}\@@end}
> > %
> > %
> > %
> > \language=1% Make bloody sure that the language is right.
> > \InputIfFileExists{ukhyphen.tex}%
> >    {\message{Loading hyphenation patterns for UK English.}%
> >     \language=1
> >     \lefthyphenmin=2 \righthyphenmin=3 }%
> >    {\errhelp{The configuration for hyphenation is incorrectly
> >              installed.^^J%
> >              If you don't understand this error message you need
> >              to seek^^Jexpert advice.}%
> >     \errmessage{OOPS! I can't find any hyphenation patterns for
> >                 UK english.^^J \space Something is wrong.}\@@end}
> > %
> > %
> > %
> > \language=1
> > \message{UK hyphenation patterns installed as language 1; US  
> > hyphenation
> > as language 0.  Default language set to 1.}
> > \endinput
> > =============================================================
> >
> > Would I be better off removing Babel and sticking with this?
> 
> How and when is this loaded?

By latex.ltx at format-building time, of course.  hyphen.cfg, if it
exists, is loaded by the standard LaTeX format building process, at
format building time (a string search for `hyphen.cfg' inside latex.ltx
will show you the point at which this happens - close to the end of
proceedings, as it happens).

It's part of the standard LaTeX format config mechanism.

Read lthyphen.dtx and the rest of the LaTeX source code if you want more
information.  I think there are other documents that'll help - but it's
been a long time since I checked CTAN for this sort of thing.  One of
the most useful documents I've got about LaTeX2e I only have in paper
form (I think), and was made available before LaTeX2e `took over' from
2.09.  It was an excellent description of the system to help one modify
it, and then - well, it got replaced with the current pile of junky
unhelpful docs.  The doc just vanished from the `net.

[snip]

> > It seems that my suspicion was right: one /does/ have to be a Unix
> > sysadmin to learn how to set up and maintain a modern Mac TeX
> > distribution.  :-/  Ho hum.  I was hoping to avoid learning all
> > that Unix stuff.
> 
> Mac OS X in a Nutshell, by O'Reilly.

There are multiple books I'm going to have to read.  Thanks for the tip.

> But perhaps others who are  
> closer to your position on the learning curve can comment on this  
> recommendation. I agree taht most unix man pages contain the absolute  
> minimum to use a command.

Not even that.  It's the minimum you need *if you are already a Unix
expert*.  If you are not a Unix expert, man pages are virtually useless.

> To figure out which command to use is a  
> _bit_ harder.

I tend to find it very easy to work out which command needs to be used,
and virtually impossible to find out how to use them.

> >> There are two files in most text distributions (well, unix-
> >> distributions anyway) that control everything: texmf.cnf and
> >> fmtutil.cnf.
> >
> > Except, of course, that there are multiple files called texmf.cnf
> > and fmtutil.cnf, aren't there?  So the number is higher than two,
> > and confusion reigns as a result.
> 
> There is a hierarchy in the texmf.cnf files, with each level adding  
> bits, that is at least my understanding.

As I understand it, at any given call to a texmf.cnf file gives you one
file only.

[snip]

> >>>>> I was thinking about modifying the Babel setup so that I could
> >>>>> have the existing languages plus the one I need, with the one I
> >>>>> need set up as the default.
> >>>>>
> >>>>> I see that to do this, I need to edit the appropriate
> >>>>> language.dat file.
> >>>>
> >>>> a simple find command in the terminal gives that these are all
> >>>> language .dat files in the texmf trees.
> >>>
> >>> Okay - I've printed out the `find' man page and learnt how to do
> >>> this (details on how to do so at the end of this email).  But how
> >>> can I tell which file is used for which format?
> >>
> >> The one returned by kpsewhich, since that is the same routine used
> >> by tex itself.
> >
> > `kpsewhich' returns:
> >
> > Missing argument. Try `kpsewhich --help' for more information.
> >
> > It turns out that to use kpsewhich in an intelligent fashion, you
> > need to learn a lot about what it is that you're looking for.  I've
> > not yet learnt that, so I cannot find out how to find out which
> > language.dat file gets used by what for what.
> >
> > I do know that:
> >
> > Hattie:teTeX rowland$ kpsewhich language.dat
> > /usr/local/teTeX/share/texmf.gwtex/tex/generic/config/language.dat
> >
> > and
> >
> > Hattie:teTeX rowland$ find . -name "language.dat"
> > ./share/texmf.gwtex/tex/generic/config/language.dat
> > ./share/texmf.tetex/tex/generic/config/language.dat
> > ./share/texmf.tetex/tex/lambda/config/language.dat
> > ./share/texmf.tetex/tex/platex/config/language.dat
> >
> > which doesn't help me much.  What gets used for what, and when, and
> > why? I don't know and can't find out yet.
> 
> The texmf directories are searched in order, until a match is found:
>      /Users/YourName/Library/texmf, texmf.local, texmf.gwtex,  
> texmf.tetex
> That means that only the first one listed is of importance for  
> building formats. With the progname argument given above, the exact  
> match by the routines as used by TeX can be made.

I don't know what that means, and I can't see any useful connection to
what I asked.

[snip]

> >> See discussion of fmtutil.cnf
> >
> > I have done.  Doesn't help much.
> >
> >>> (and some sort of babel config file - damned if I can find any
> >>> info on how to set up Babel to give me a default language other
> >>> than US English)
> >>
> >> Babel is not part of the ...TeX format, so there is no default
> >> there. Load the package with \usepackage[english]{babel} and in
> >> latex you'll get the right patterns.
> >
> > That is not what I want to do.  In any event, surely with
> > `english', I'd get US English?
> 
> No, since I assume you'll put the =english line right after what you
> consider to the proper English.

Er?  What are you talking about?

Please note that since language.dat as supplied with MacTeX has no
explanation of the format of the file itself, and nor does the Babel
documentation, I cannot modify the file to meet my needs.  Ah.  No, I
lied - if you read enough Babel documentation files, the information is
there.  I found it.  Oh god it's nearly enough to make you wish for a
return to town gas...

> For certainty (and an error in case
> the uk patterns weren't loaded), you can use british instead.

Er?

> >> For pdftex (plain), you'll need to \input some file, and \def some
> >> things, but I'm at a loss here. However, at least I now know how
> >> to includekpsewhich the languages in the first place.
> >
> > Righto - well, I'd got the idea that `things had been set up so that
> > Plain TeX used Babel as a semi-routine matter', but it seems not.  I
> > might as well stick with my methods than use Babel for Plain TeX.
> 
> Babel is written to be usable under plain, so it is certainly  
> possible, a bit of Google will revlea stuff. However, when I tried  
> this the last time, I failed to notice that the patterns weren't  
> loaded at all, and then babel really will not work.

Righto - thanks.  I'll leave tex to itself, then - I'll just strap UK
English hyphenation patterns into it.  I think I'll do the same with
LaTeX and just use my old hyphen.cfg file.

[snip]

> >>>> (the languages are all there, but with most commented out, so
> >>>> there is no need to figure out what a language should be called).
> >>>
> >>> It's not the modifying of the file that's the problem, but
> >>> working out where to put my copy of the modified file so that
> >>> it's 1) used and 2) not overwritten; then I need to work out how
> >>> to re-build all the formats.
> >>
> >> 1) use kpsewhich with the engine and file-name for see if the file
> >> you had in mind is indeed found.
> >
> > Yes, but I don't understand exactly what `engine' means in this
> > context - which engine needs specifying for any given search, and
> > why?  I don't have much information about this, so I mostly can't
> > use kpsewhich.
> 
> The arguments to the -ini call as used by fmtutil and by kpsewhich  
> are the same. Does that help?

Not in the slightest.  I think you're playing some kind of intellectual
game with me, trying to feed me hints to point me in the direction you
think I ought to be going.  Well, you're wasting my time and yours in
doing so.  I can't follow you.

I'm looking for straightforward explanations with examples.
 
Hints and implications don't help.

> >> 2) copy that file to reside within the texmf.local tree, and try
> >> (1) again to see if it is found instead.
> >
> > Very bad idea - texmf.local is full of `other peoples' stuff' when
> > you install MacTeX.
> >
> > In my case, I'll copy to within /Users/Shared/texmf.rjmm/ in my
> > case.
> 
> Please keep notes on how you added that tree to the search path,  
> because that bit of the configuration is way more fragile than a  
> backup of texmf.local.

Eh?  I don't understand you at all.  How can a single file be `way more
fragile' than a whole directory tree?  Or even if it is, how can this be
a problem?  One file is more easily restored from a backup than a whole
directory tree, is it not?

I don't know anything about anything that messes about with the
installation I've got - but I do know that lots of software installers
make assumptions about stuff, and I've had trouble over the last 15-odd
years with installers making big mistakes and messing things up for me
very, very badly.

Because of this, *MY* additions to MacTeX are all going to be either
stored somewhere completely out of reach of the standard MacTeX setup's
knowledge, or be restricted to a very small number of files which I will
keep carefully marked, labelled, noted, indexed, examined after every
`installer or similar' run, and of course always backed up.

[snip]

> >> With the commands I
> >> gave it is not possible to store the configuration the your home
> >> directory.
> >
> > Why not?  Not that that's how I'm going to do things.
> 
> When you run fmtutil, or pdfetex -ini, you run as a super user, not  
> yourself. This means that TeX will not find the configurations files  
> at all, and will still use the default files.

How can running as superuser *prevent* access to part of the file
system?  Or rather, what's going on?

I don't see any reason why one shouldn't point TeX at one's home
directory as a place to look for config files, and if that's done -
well, it'll look there when you're superuser as well as `yourself',
surely?

I've not looked at the user-by-user specifics, mind.

Cheers,
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 MacOSX-TeX mailing list