I would like to make an array with some automatic calculations. I use the package ftlpoint.

I made a test, but it does not work:

    \fpMul{\produit}{#1}{#2}% Calculation
    \produit&%print result
    \produit&print result in another cell

On the first cell, no problem, but in the second cell, LaTeX says the command \produit doesn't exist (undefined control sequence).

How can do this?

Ps. Of course, my example is very simplified. I would like to make other calculations as well.

  • 1
    You example is to simplified ;-) Please add a minimal working example. – Marco Daniel Sep 7 '11 at 15:15
  • You should use \MyLine instead of \line as I believe that is already defined elsewhere. – Peter Grill Sep 7 '11 at 15:26
  • Yes, in fact, i work in french, so I use \ligne and not \line – Maïeul Sep 8 '11 at 15:58

I think you need to make the definition of \produit global. Otherwise it goes out of existence when you move into another table cell.

    \fpMul{\temp}{#1}{#2}\global\edef\produit{\temp}% Calcul                    
    \produit&%seeing result                                                     
    \produit%seeing result on a other cell                                      
  • Instead of \global\edef you could simply use \xdef. – mhp Sep 7 '11 at 15:37
  • the problem is that I have one value of produit by line. So I can't have an unique value – Maïeul Sep 8 '11 at 9:16
  • @Maieul --- That doesn't matter. \edef (or \xdef as @mhp suggests) will overwrite any old value that exists. – Ian Thompson Sep 8 '11 at 11:00
  • @lan Thompson : thank ! I did'nt know the \edef command :) – Maïeul Sep 8 '11 at 15:57
  • @Maieul: if this answers your question, you can select it. – ℝaphink Sep 10 '11 at 6:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.