ConTeXt のフロート: キャプション名を変更して \input コマンドを機能させる

ConTeXt のフロート: キャプション名を変更して \input コマンドを機能させる

ロジック回路用の新しい float を定義しましたlogigram:

\definefloat [logigram] [logigrams]

ConTeXt のモード (条件付き処理など) を利用して、ドキュメントのフランス語版と英語版を並行して作成しています。

\starttext
    \startmode [english]
        \placelogigram [right] {Logigram of a negation} {\input negation.tikz}
        The logic circuit of a negation is the opposite logigram.
    \stopmode

    \starmode [french]
        \placelogigram [right] {Logigramme d'une négation} {\input negation.tikz}
        Le circuit logique d'une négation est le logigramme ci-contre.
    \stopmode
\stoptext

\placelogigramここで、デフォルトのキャプション名を英語では「Logigram」、フランス語では「Logigramme」にしたいと思います。

negation.tikz.texまた、コマンド\inputが内部で使用されている場合、 ConTeXt は Tikz 画像を見つけることができないことにも気付きました\placelogigram。これはファイルですnegation.tikz.tex:

%\usemodule [tikz]
%\usetikzlibrary [circuits.logic.US]
\starttikzpicture [circuit logic US]
    \node [not gate, point down, draw] at (0, 0) (notGate) {};
    \draw (notGate.input) -- ++(up:0.5) node [above] {$\phi$};
    \draw (notGate.output) -- ++(down:0.5);
\stoptikzpicture

ご協力いただければ幸いです。

答え1

frenchモードでコンパイルするときに使用する言語としてフランス語を設定する:

\startmode [french]
    \language [french]
    \setcharacterspacing [frenchpunctuation]
    \mainlanguage [french]
\stopmode

変更:

\definefloat [logigram] [logigrams]

に:

\definefloat [logigram] [logigrams]
\setuplabeltext [fr] [logigram=Logigramme~]

キャプション名の問題を解決します。

私はの\startplacelogigram ... \stopplacelogigram代わりに を使って を取得しました:\placelogigram\input

\startmode [english]
    \startplacelogigram [location=right, title={Logigram of a negation.}]
        \input negation.tikz
    \stopplacelogigram
    The logic circuit of a negation is the opposite logigram.
\stopmode

\startmode [french]
    \startplacelogigram [location=right, title={Logigramme d'une négation.}]
        \input negation.tikz
    \stopplacelogigram
    Le circuit logique d'une négation est le logigramme ci-contre.
\stopmode

編集。コメントに示されているように、の代わりにまたは の\startplacelogigram ... \stopplacelogigram使用を避けてください。\input filename \relax\ReadFile {filename}\input filename

関連情報