- 
  VineLinux3.1では、tetex のインストールをすれば、基本的にそのままで
  TeX/LaTeX が使用可能な状況になっています。しかし、先日の inputenc.sty 
  を使ったときのログが気になっていました。そこで、まず、tetexの環境回り
  を調べてから、babel でドイツ語のハイフネーションを設定するまでの顛末
  をまとめました。今回は、LaTeX 編。
  
- 基本的情報の収集:tetex のバージョン
 /usr/share/doc/に、tetex-2.0.2 というディレクトリがあることから、2.0.2 であろう。
その中のREADME には、
  To get started after installation, look at the documentation in the
  installed texmf tree, most notably
    texmf/doc/index.html
    texmf/doc/tetex/TETEXDOC.pdf
  Thomas Esser, February 2003
となっているので、2003年2月頃のバージョンか?
ちなみに、/usr/share/texmf 以下には、./doc ディレクトリがない。
 これは、tetex-doc-2.0.2-0vl14.i386.rpm をインストールすることで、
/usr/share/texmf/doc/generic/babel にインストールされる。
- 
基本的情報の収集:TeX, pTeX, Web2C のバージョン
 
  [hoge@orara texmf]$ tex
  This is TeX, Version 3.14159 (Web2C 7.4.5)
  [hoge@gorara inbox]$ platex
  This is pTeX, Version 3.14159-p3.1.5 (euc) (Web2C 7.4.5)
 
- 
基本的情報の収集:babel のバージョン
 /usr/share/texmf/tex/generic/babel/babel.sty を見ると:
\ProvidesPackage{babel}
                [2001/03/01 v3.7h The Babel package]
- 
基本的情報の収集:babel 関係のファイルの位置
 /usr/share/texmf/tex/generic/babel
 /usr/share/texmf/tex/generic/hyphen
 /usr/share/texmf/tex/generic/config 以下に、language.dat がある。
- 
基本的情報の収集:language.dat の中身
 /usr/share/texmf/tex/generic/config/language.dat 
の中身は以下のようになっている。すでに、米語(USenglish),フランス語
(french),ドイツ語(新正書法,エイリアスとしてのオーストリアドイツ語)
が有効になっているように見える。nohyphenation というハイフネーション
設定があり、zerohyph.tex を使っていることが分かる。language.datは,
後で問題となる設定を含むので、そのまま以下に掲載する。
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  % File    : language.dat
  % Purpose : specify which hypenation patterns to load
  %           while running iniTeX
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  % CAUTION: the first language will be the default if no style-file
  %          (e.g. german.sty) is used.
  % Since version 3.0 of TeX, hyphenation patterns for multiple languages are
  % possible. Unless you know what you are doing, please let the american
  % english patterns be the first ones. The babel system allows you to
  % easily change the active language for your texts. For more information,
  % have a look to the documentation in texmf/doc/generic/babel.
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  % The hyphenation pattern files are in the dirctory:
  %       texmf/tex/generic/hyphen
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  % The US-english patterns should be loaded *always* and as *first* ones.
  % Define USenglish as an alias for american.
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  american ushyph1.tex
  =USenglish
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  % UK english, TWO LINES! To enabling these lines, remove %! and the space.
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %! british  ukhyphen.tex
  %! =UKenglish
  % english should always be defined. Either an alias for american or british.
  =english
  % French, TWO lines!
  french          frhyph.tex
  =patois
  german          dehypht.tex
  =austrian
  % For use with ngerman.sty (neue Rechtschreibung):
  ngerman         dehyphn.tex
  =naustrian
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  % The following languages are disabled by default. Uncomment, what you need.
  % To enable, remove %! and the space.
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %! bahasa       inhyph.tex
  %! basque       bahyph.tex
  %! croatian     hrhyph.tex
  %! czech        czhyph.tex      % depends on csplain being installed
  %! danish       dkhyphen.tex
  %! dutch        nehyph.tex
  %! finnish      fi8hyph.tex
  %! greek        grhyph.tex
  %! italian      ithyph.tex
  %! latin        lahyph.tex
  %! magyar       huhyph.tex
  %! norsk        nohyph.tex      % old file
  %! norsk        nohyphb.tex     % see texmf/doc/generic/nohyph/README.nohyph
  %! norsk        nohyphbc.tex    % see texmf/doc/generic/nohyph/README.nohyph
  %! polish       plhyph.tex
  %! portuges     pt8hyph.tex
  %! romanian     rohyphen.tex
  %! russian      ruhyphen.tex    % note: edit ruhyphen.tex for your encoding!
  %! slovak       skhyph.tex      % depends on csplain being installed
  %! slovene      sihyph23.tex
  %! spanish      sphyph.tex
  %! turkish      trhyph.tex
  % For Ukrainian, either use ukrhyph.tex (and edit that file for the encoding
  % that you need) or use one of the ukrhyph.ENC files.
  %! ukrainian    ukrhyph.tex
  %! ukrainian    ukrhyph.t2a
  %! ukrainian    ukrhyph.lcy
  %! ukrainian    ukrhyph.ot2
  % A "language" without hyphenation:
  nohyphenation zerohyph.tex
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  % Please contact me, if for any of the following languages there are
  % freely available hyphenation tables:
  %       catalan esperanto galician swedish
  % I might want to include them in a future version of this file.
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  % Email   : Thomas Esser, te@dbs.uni-hannover.de
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
- babelのハイフネーションを有効にするための準備(1)
 
 Vine3.1では:
[root@orara texmf]# kpsewhich hyphen.tex
/usr/share/texmf/tex/generic/hyphen/hyphen.tex
 となり、このhyphen.tex は、The Plain TeX hyphenation tables を提供してい
る。改名しておかないと、pTeX で babelを使う際に、hyphen.tex を
見に行ってしまい、babel のハイフネーションが有効にならないらしい。
[06/25/05修正]
 
  [root@orara hyphen]# mv hyphen.tex plainhyphen.tex
 
 
  参考:
  [root@orara texmf]# locate hyphen.tex
  /usr/share/texmf/tex/generic/hyphen/dkhyphen.tex
  /usr/share/texmf/tex/generic/hyphen/hyphen.tex
  /usr/share/texmf/tex/generic/hyphen/mnhyphen.tex
  /usr/share/texmf/tex/generic/hyphen/rohyphen.tex
  /usr/share/texmf/tex/generic/hyphen/ukhyphen.tex
  /usr/share/texmf/tex/generic/ruhyphen/ruhyphen.tex
  /usr/share/texmf/tex/csplain/czhyphen.tex
  /usr/share/texmf/tex/csplain/skhyphen.tex
  /usr/share/texmf/ptex/platex209/hyphen.tex
  
- babelのハイフネーションを有効にするための準備(2)
 
 babel のhyphen.cfg が優先されて使われるように設定しなければ
ならない。
Vine3.1では:
  [root@orara texmf]# kpsewhich hyphen.cfg
  /usr/share/texmf/tex/generic/babel/hyphen.cfg
 となるので、そのままで大丈夫。
 
 参考:
  [root@orara texmf]# locate hyphen.cfg
  /usr/share/texmf/tex/generic/babel/hyphen.cfg
  /usr/share/texmf/tex/platex/config/hyphen.cfg
  /usr/share/texmf/tex/cslatex/hyphen.cfg
  /usr/share/texmf/ptex/platex/config/hyphen.cfg
 
- 
LaTeX フォーマットファイル作成
 まず、バックアップ:
  [root@orara web2c]# cp -p latex.fmt latex.fmt.orig
 そして、いよいよ、texmf/tex/latex/base で、フォーマットファイルを
作成しようとしたら、以下のような●エラー●。
 
  # cd /usr/share/texmf/tex/latex/base
  [root@orara base]# initex latex.ltx
...snip...
  Local config file preload.cfg used
  =====================================
  (/usr/share/texmf/tex/generic/config/preload.cfg (./preload.ltx)) page nos.,
  x-ref, environments, center, verbatim, math definitions, boxes, title,
  sectioning, contents, floats, footnotes, index, bibliography, output,
  ===========================================
  Local configuration file hyphen.cfg used
  ===========================================
  (/usr/share/texmf/tex/generic/babel/hyphen.cfg
  ! I can't find file `ushyph1.tex'.
  
                     \relax
  l.319   \repeat
   ushyph1.tex が無い。
そこで、 hyphenation のファイルは、/usr/share/texmf/tex/generic/hyphen
だが、
確かに、ushyph1.tex はない。
 ring server で検索しても、ushyph1.tex はなく、あるのは、ushyph.tex 。
 ▼対策
 そこで、(1) ushyph.tex をダウンロードし、 
(2) /usr/share/texmf/tex/generic/hyphen に置き、
(3)  /usr/share/texmf/tex/generic/config/language.dat の ushyph1.tex
をushyph.tex に書き換えて保存(26-27行目を
 american ushyph.tex
 =USenglish
 とした)、
(4) mktexlsr でデータベースを更新。
- 
LaTeXのフォーマットファイル作成に再挑戦:
 
  # cd /usr/share/texmf/tex/latex/base
  [root@orara base]# initex latex.ltx
  This is TeX, Version 3.14159 (Web2C 7.4.5) (INITEX)
  (./latex.ltx (/usr/share/texmf/tex/latex/config/texsys.cfg)
  ./texsys.aux found
  ...snip...
    Hyphenation trie of length 23913 has 759 ops out of 35111
    235 for language 3
    207 for language 2
    88 for language 1
    229 for language 0
    No pages of output.
  Transcript written on latex.log.
となり、無事終了。
- 
LaTeX のフォーマットファイルの置き換え
 まず、バックアップ:
 
[root@orara web2c]# cp -p latex.fmt latex.fmt.orig
 /usr/share/texmf/tex/latex/baseに作成された、latex.fmt
を /usr/share/texmf/web2cへ移動。これで作業終了。
[root@orara base]# mv -f latex.fmt /usr/share/texmf/web2c/
 
- 
 pLaTeXでドイツ語のハイフネーションを組み込まないと、
Schlafzimmer が Schlafz-  immer となってしまう例。
 このソースファイルを、もともとの
platex でコンパイルしたものの一部が以下のものです。
 
  
 
- 
LaTeXでbabel のハイフネーションを有効にすると、無事に、
Schlafzimmer は、Schlaf-   zimmer となった。
 
  
 
- 
疑問:もともとVine3.1をインストールした時点のLaTeXでは、
babel のハイフネーションが有効になっていたのではないか?[06/25/2005]
 この疑問を抱くきっかけは、inputenc.sty を使ってWebのページをそのままソースに
を書いた時に、LaTeXでコンパイルしたログを見た時に始まる。
 そこには、以下のような画面出力があった。
LaTeX2e <2001/06/01>
Babel  and hyphenation patterns for american, french, german, ngerman, nohyphenation, loaded.
 そして、ログファイルの頭には、
This is TeX, Version 3.14159 (Web2C 7.4.5) (format=latex 2005.1.31)  
 と出力されていた。つまり、ここから考えると、VineLinux3.1 では、
/usr/share/texmf/web2c/latex.fmt は、2005年1月31日に作成され、
babel のハイフネーションとして、アメリカ英語、フランス語、
ドイツ語旧正書法、ドイツ語新正書法、
そして「ハイフネーション無し(というハイフネーション)」
(nohyphenation)の形で作られたフォーマットファイルだった。
そして、babel のハイフネーションは有効になっていた、と推定できる。
 当初勘違いしたのは、nohyphenation, loadedの部分。
これは、「ハイフネーション無し(というハイフネーションファイル)」
がロードされた、という意味。
pLaTeXでbabelを含むファイルをコンパイルした時に出る、以下のようなログとは明らかに違う。
 
  Package babel Warning: No hyphenation patterns were loaded for
  (babel)                the language `German'
  (babel)                I will use the patterns loaded for \language=0 instead.
 しかし、この2005年1月31日に作成された latex.fmt は、
VineLinux3.1のインストール後の状態とは、
ushyph1.texが無い、という点で異なっている。
ネットで見ると、Win32 環境でも同じような状況に陥った人もいるようなので、
配布先のどこか、
あるいはパッケージャーの誰かの所で起きた些細なミスだったのだろう。
ushyph1.tex が無い場合、babelで英語のハイフネーションはどのように処理されるのだろうか?
ちなみに、2005年1月31日に作成された latex.fmtを覗いてみたら、
@americanushyph1/var/tmp/tetex-2.0.2-root/usr/share/texmf/tex/generic/hyphen/
/var/tmp/tetex-2.0.2-root/usr/share/texmf/tex/generic/hyphen/hyphen.tex
/var/tmp/tetex-2.0.2-root/usr/share/texmf/tex/generic/hyphen/hyphen.tex
 というushyph1を含む部分がある。新しく作ったlatex.fmtには、
@americanushyph/usr/share/texmf/tex/generic/hyphen/ushyph.tex
 という該当部分がある。
- 
LaTeXのフォーマットファイルを作る時に、
バックアップしておいたlatex.fmt.origを元に戻して、上記のソースをコンパイルした結果、
13.と同じドイツ語のハイフネーションが出来ていることを確認した。
 結論:Vine3.1をインストール後の状態で、
LaTeXは babel でのハイフネーション(米語、ドイツ語<新・旧正書法>、フランス語)対応になっている。
米語と書いたが、american ushyph1.tex USenglish
の部分が副作用を起こすのか否かは追求していない。
/usr/share/texmf/tex/generic/hyphen/hyphen.tex がおそらく The Plain TeX hyphenation tables
を提供しているので、これが使われるのだろう。