![Flutua no ConTeXt: alterando o nome da legenda e fazendo o comando \input funcionar](https://rvso.com/image/281590/Flutua%20no%20ConTeXt%3A%20alterando%20o%20nome%20da%20legenda%20e%20fazendo%20o%20comando%20%5Cinput%20funcionar.png)
Eu defini um novo float para circuitos lógicos chamado logigram
:
\definefloat [logigram] [logigrams]
Aproveitando os modos do ConTeXt (ou seja, processamento condicional), estou fazendo paralelamente uma versão em francês e inglês do meu documento:
\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
Agora, gostaria de \placelogigram
produzir o nome de legenda padrão "Logigram" em inglês, mas "Logigramme" em francês.
Observei também que o ConTeXt não consegue encontrar minha imagem Tikz negation.tikz.tex
quando o comando \input
é usado dentro de \placelogigram
. Este é o arquivo 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
Agradecemos antecipadamente por qualquer ajuda.
Responder1
Definindo o francês como idioma usado durante a compilação no french
modo:
\startmode [french]
\language [french]
\setcharacterspacing [frenchpunctuation]
\mainlanguage [french]
\stopmode
e mudando:
\definefloat [logigram] [logigrams]
para:
\definefloat [logigram] [logigrams]
\setuplabeltext [fr] [logigram=Logigramme~]
resolve o problema do nome da legenda.
Eu usei \startplacelogigram ... \stopplacelogigram
em vez de \placelogigram
para obter meu \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
EDITAR. Conforme indicado nos comentários, para evitar \startplacelogigram ... \stopplacelogigram
o uso \input filename \relax
ou \ReadFile {filename}
em vez de \input filename
.