
Ich brauche den Wert einer Variable, die in ifeqcase gesetzt ist, außerhalb von ifeqcase. Dieser Code funktioniert beispielsweise nicht
\documentclass[12pt]{article}
\usepackage{fontspec}
\usepackage{xunicode}
\usepackage{geometry}
\usepackage{calculator,calculus}
\usepackage{multido}
\usepackage{xstring}
\usepackage[fontsize=22pt]{scrextend}
\setmainfont{Latin Modern Sans Quotation}
\geometry{papersize{30cm,19.35cm},left=1cm,right=1cm,top=1cm,bottom=1cm}
\pagestyle{empty}
\newcommand{\valeurcal}[2]{
\SUBTRACT{1}{\ra}{\partiell}
\MULTIPLY{\partiell}{#1}{\partielll}
\MULTIPLY{\ra}{#2}{\partiell}
\ADD{\partiell}{\partielll}{\leresultat}
}
\begin{document}
\multido{\ra=0.0+0.2}{1}{
\valeurcal{0}{5}
\ROUND[0]{\leresultat}{\coupe}
\IfEqCase{\coupe}{%
{1}{ \COPY{5}{\nouvcoupe}}% test with calculator
{2}{ \def\nouvcoupe{6}}}% test with def, edef and gdef (thank for the answer)
value of nouvcoupe : \nouvcoupe}
\end{document}
gib mir: Undefinierte Steuersequenz. (kompiliert mit xelatex)
Das Problem scheint bei aufzutreten \valeurcal{0}{5}
. Wenn ich \valeurcal{0}{5}
durch ersetze \COPY{2}{\leresultat}
, kann ich es kompilieren (aber es funktioniert nicht)!
\valeurcal{0}{5}
berechnen 0*(1-\ra)+5*\ra
wo \ra
Was rätst du mir? Vielen Dank im Voraus.
Antwort1
verwenden
\gdef\nouvcoupe{6}
Globalauf jedenEinleitung
Antwort2
OK [\def\nouvcoupe{6}]
hat gefehlt
\IfEqCase{\coupe}{%
{1}{ \COPY{5}{\nouvcoupe}}% test with calculator
{2}{ \def\nouvcoupe{6}}}[\def\nouvcoupe{6}]
ist in Ordnung