手順の最初の部分

手順の最初の部分

私は TeX をマクロ パッケージ AmS-TeX とともに使用しています。イタリア語で使用して、単語が正しい方法でハイフンで区切られるようにしたいと思います (たとえば、イタリア語の単語「distante」は di-stante に分割する必要がありますが、TeX では英語の単語「distant」を分割するのと同じように、dis-tante に分割されます)。

さらに、同じドキュメント内で異なる言語を切り替えることは可能ですか? 可能であれば、どのようにすればよいですか?

私はこの問題の解決策を LaTeX に対してのみ見つけました。代わりに、TeX に対する解決策が必要です。

答え1

手順の最初の部分

この手順では、Unix ボックス上で TeX Live を実行していることを前提としています。

  1. 何も上書きしないように、作業ディレクトリに移動します。

  2. bplain.cnf次の行を含むファイルを準備します。

    bplain pdftex language.dat -translate-file=cp227.tcx *bplain.ini
    
  3. 以下のコマンドラインを実行します

    fmtutil --cnffile bplain.cnf --fmtdir . --all
    
  4. コマンドを実行する

    mv pdftex/bplain.fmt .
    
  5. matteo.tex以下のテストファイルを処理します。

    pdftex -fmt bplain -output-format pdf matteo
    

テストファイルはこちら

% test file matteo.tex
% activate italian
\language\csname l@italian\endcsname
\lccode`'=`'
\righthyphenmin=2
%%%

\overfullrule=0pt % just for the example

\input amstex
\documentstyle{amsppt}

\topmatter
\title A paper\endtitle
\author Matteo\endauthor
\endtopmatter

\document

\vbox{\hsize=3pt\hskip0pt % show some hyphenations
 distante
 amicizia
 dell'amicizia
 ricordo
}

\enddocument

そしてこれが出力です

ここに画像の説明を入力してください

bplain.fmtこれで、 TeX Liveが見つけられる場所に移動できます。たとえば、

~/texmf/web2c/pdftex

(または~/Library/texmf/web2c/pdftexMac OS X の場合) 上記のコマンド ラインはどのディレクトリからでも機能します。

大胆な場合は、手順3と4、およびbplain.fmtファイルの最終的な移動を1つの手順で実行できます。

fmtutil --cnffile bplain.cnf --fmtdir $(kpsewhich -var-value TEXMFHOME) --all

手順の2番目の部分

これでセットアップは完了です。.bashrcファイルに次のエイリアスを追加します。

alias bpdftex='pdftex -fmt bplain -output-format pdf'

そして、新しいシェルを開くと、実行できるようになります

bpdftex matteo

言語を切り替える方法を示す、より複雑なサンプル ファイル:

\catcode`@=11
\def\italian{%
  \language\l@italian
  \lccode`'=`'
  \righthyphenmin=2
}
\def\english{%
  \language\l@english
  \lccode`'=0
  \righthyphenmin=3
}
% you can add other languages, if you want
\catcode`@=12
\english % initialization
%%%

\overfullrule=0pt % just for the example

\input amstex
\documentstyle{amsppt}

\topmatter
\title A paper\endtitle
\author Matteo\endauthor
\endtopmatter

\document

% this will use English hyphenation
\vbox{\hsize=3pt\hskip0pt % show some hyphenations
 distance
 pleasure
 confidential
 record
}

\medskip\hrule\smallskip

\italian % this will use Italian hyphenation
\vbox{\hsize=3pt\hskip0pt % show some hyphenations
 distante
 amicizia
 dell'amicizia
 ricordo 
}

\enddocument

ここに画像の説明を入力してください

手順の3番目の部分

LaTeXに切り替える

答え2

エグレのも試してみてくださいハイプレーンPlain TeX のフォーマットとして。インストールには 3 つのファイルのみが必要で、ドキュメントは 2 ページのリーフレットです。

関連情報