xstring から ifeqcase を使用して数値を格納する際の問題

xstring から ifeqcase を使用して数値を格納する際の問題

ifeqcase で設定された変数の値を ifeqcase の外で取得する必要があります。たとえば、このコードは機能しません。

\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}

教えてください: 未定義の制御シーケンスです。(xelatex でコンパイル)

問題は で発生するようです。を に\valeurcal{0}{5}置き換えるとコンパイルできます (ただし、うまくいきません)。\valeurcal{0}{5}\COPY{2}{\leresultat}

\valeurcal{0}{5}0*(1-\ra)+5*\raどこで計算しますか\ra ? 私に何をアドバイスしますか? よろしくお願いします。

答え1

使用

\gdef\nouvcoupe{6}

グローバル定義開始

答え2

OKが[\def\nouvcoupe{6}]ありませんでした

\IfEqCase{\coupe}{%
{1}{ \COPY{5}{\nouvcoupe}}% test with calculator
{2}{  \def\nouvcoupe{6}}}[\def\nouvcoupe{6}]

大丈夫です

関連情報