Jean-Marc Lasgouttes wrote: > Angus> Can you explain it to someone who doesn't read LaTeX (me)? > > OK, what you have to know is that \the\everyjob contains something > like > \typeout{LaTeX2e <2001/06/01>} > \typeout{Babel <v3.7h> and hyphenation patterns for american, french, > german, ngerman, nohyphenation, loaded.} > > This is the command which is executed when the format is loaded > (displays info on screen). > > Angus> +{\def\typeout#1{\global\def\mesg{#1}} > Angus> + \the\everyjob} > > Here, we replace locally \typeout by a macro that defines \mesg as its > argument. We use \global\def so that the definition of \mesg survives > the {} group. Note that we are only interested by the second typeout > (this is the assumption I am the less comfortable with, actually).
So, {\def\typeout#1#2{\global\def\mesg{#1}}\the\everyjob} would mean you were interested in the third typeout? > Angus> +\def\strip#1patterns for #2, loaded.{\def\langs{#2}} > > When you define a macro like \def\foo#1bar#2baz{...} and invoke it > like > \foo abcbardefbaz, then you get #1=abc and #2=def > > The net effect of \strip is to extract the list of languages from the > babel message. The #1 argument is just ignored. Ok, understood. > Angus> +\expandafter\strip\mesg > > I want the \strip macro to see the _contents_ of \mesg, so I use > \expandafter that first expands \mesg and then invokes \strip as if it > was followed by the expansion of \mesg (kind of like what backquoting > does in unix shell). Again, understood. > Angus> +\message{^^J\prefix checking for available hyphenation > patterns... \langs} > > Kind of obvious > > Angus> +\AddVariable{languages}{\langs} > > This creates the sed pattern. > > Clear? I'm reminded of how I used to feel when my father explained my maths homework to me. I sort of see how it works, but if you were to ask me to do it myself, you'd find me creeping back into the room to grab the scrumpled up notes from the waste paper basket... -- Angus