.ins ファイルからプライベートツリーにパッケージをインストールする

.ins ファイルからプライベートツリーにパッケージをインストールする

最近ドキュメント クラスを作成し、それを DTX ファイルにまとめ終えたところです。インストール ファイルは次のようになります。

%% 
%% Licence info
%% 

\input docstrip.tex
\keepsilent

\usedir{tex/latex/bil-CV}

\preamble

This is a generated file licenced under the MIT License:
The MIT License (MIT)…blah blah blah...

\endpreamble

\generate{\file{bil-CV.cls}{\from{bil-CV.dtx}{class}}}


\obeyspaces
\Msg{*********************************************************}
\Msg{*}
\Msg{* To finish the installation you have to move the}
\Msg{* following file into a directory searched by TeX:}
\Msg{*}
\Msg{* \space\space bil-CV.cls}
\Msg{*}
\Msg{* To produce the documentation run the file bil-CV.dtx} 
\Msg{* through LaTeX.}
\Msg{*}
\Msg{* Happy TeXing!} 
\Msg{*********************************************************}

\endbatchfile

を実行してこれを実行するlatex bil-CV.insと、次の出力が得られます。

This is pdfTeX, Version 3.14159265-2.6-1.40.15 (TeX Live 2014) (preloaded format=latex)
 restricted \write18 enabled.
entering extended mode
(./bil-CV.ins
LaTeX2e <2014/05/01>
Babel <3.9k> and hyphenation patterns for 78 languages loaded.
(/usr/local/texlive/2014/texmf-dist/tex/latex/base/docstrip.tex
Utility: `docstrip' 2.5d <2005/07/29>
English documentation    <2014/04/19>

**********************************************************
* This program converts documented macro-files into fast *
* loadable files by stripping off (nearly) all comments! *
**********************************************************

********************************************************
* No Configuration file found, using default settings. *
********************************************************

)

Generating file(s) ./bil-CV.cls 

Processing file bil-CV.dtx (class) -> bil-CV.cls
Lines  processed: 407
Comments removed: 262
Comments  passed: 9
Codelines passed: 130

*********************************************************
*
* To finish the installation you have to move the
* following file into a directory searched by TeX:
*
*    bil-CV.cls
*
* To produce the documentation run the file bil-CV.dtx
* through LaTeX.
*
* Happy TeXing!
*********************************************************
 )
No pages of output.
Transcript written on bil-CV.log.

を指定したのに、および ins ファイルで指定したとおりに\usedir{tex/latex/bil-CV}クラス ファイルが生成されず、CWD でクラス ファイルが生成されるのはなぜですか?~/Library/texmf/tex/latex/bil-CV/usr/local/texlive/2014/texmf.cnf

答え1

詳細はDocStrip マニュアルDocStrip の設計では、\BaseDirectory(TeX はインストール先を認識できないため) および\UseTDS(行の TDS 構造へのマッピングを有効にするため) を設定することが求められます。これらの行は、ファイル自体ではなく、ファイル\usedirに配置される可能性が最も高くなります。docstrip.cfg.ins

コメントで指摘されているように、最近の TeX システムでは、セキュリティ上の理由から、現在のディレクトリより上のディレクトリへの書き込みは許可されていません。(変更は可能ですが、決してお勧めできません。) TeX、つまり DocStrip はディレクトリを作成できないため、構造も事前に存在している必要があります。そのため、DocStrip の「TDS への抽出」機能は、歴史的なアイデアであり、現在では使用されていないと考えるのが最善です。DocStrip を使用してローカル ツリーを作成するのではなく、TDS スタイルの zip を作成してこれを使用する方が便利な方法です。このプロセスを支援するさまざまなスクリプトが用意されています。

関連情報