![ConTeXt 中的浮動:更改標題名稱並使 \input 命令起作用](https://rvso.com/image/281590/ConTeXt%20%E4%B8%AD%E7%9A%84%E6%B5%AE%E5%8B%95%EF%BC%9A%E6%9B%B4%E6%94%B9%E6%A8%99%E9%A1%8C%E5%90%8D%E7%A8%B1%E4%B8%A6%E4%BD%BF%20%5Cinput%20%E5%91%BD%E4%BB%A4%E8%B5%B7%E4%BD%9C%E7%94%A8.png)
我為邏輯電路定義了一個新的浮點數,稱為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
該命令時,ConTeXt 無法找到我的 Tikz 圖片。這是文件:\input
\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
.