Floats in ConTeXt: Ändern des Beschriftungsnamens und Funktionieren des \input-Befehls

Floats in ConTeXt: Ändern des Beschriftungsnamens und Funktionieren des \input-Befehls

Ich habe einen neuen Float für Logikschaltungen definiert, genannt logigram:

\definefloat [logigram] [logigrams]

Ich nutze die Modi von ConTeXt (d. h. bedingte Verarbeitung) und erstelle parallel eine französische und eine englische Version meines Dokuments:

\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

Jetzt möchte ich \placelogigramden Standardbeschriftungsnamen „Logigram“ auf Englisch, aber „Logigramme“ auf Französisch erstellen.

Mir ist auch aufgefallen, dass ConTeXt mein Tikz-Bild nicht finden kann, negation.tikz.texwenn der Befehl \inputdarin verwendet wird \placelogigram. Dies ist die Datei 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

Vielen Dank im Voraus für jede Hilfe.

Antwort1

Festlegen von Französisch als Sprache beim Kompilieren im frenchModus:

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

und ändern:

\definefloat [logigram] [logigrams]

Zu:

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

löst das Problem mit dem Untertitelnamen.

Ich habe \startplacelogigram ... \stopplacelogigramanstelle von verwendet, \placelogigramum Folgendes zu erhalten \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

BEARBEITEN. Wie in den Kommentaren angegeben, \startplacelogigram ... \stopplacelogigramverwenden Sie zur Vermeidung \input filename \relaxoder \ReadFile {filename}anstelle von \input filename.

verwandte Informationen