Question: How to make unique symbol tau__n where n is integer?

Currently I generate unique local symbol inside a proc to use for intergation dummy variable. And need to make sure this symbol is not already used somewhere else in other proc. (so all symbols display different)

So I use this code

`tools/genglobal`[1](tau, 1, :-reset);
z:=`tools/genglobal`(tau);
z:=`tools/genglobal`(tau);

Which works ok, except that the symbols generated do not display nice in Latex.  Instead of  

which when rendered in latex look like this 

Which is bad as you see.  It looked like tau is being multiplied by a number.

I'd like to get the generated symbols to be  tau__1 and tau__2 instead of tau1 and tau2 and so on. Which will now display much nicer.

Is there a way in Maple to still use `tools/genglobal`(...); but generate subscripted unique symbols, where only the subscript number changes like the above.

Not able to find what syntax to use. Also not able to find any help pages on tools/genglobal.

If there is no way, I can make a global  N counter and use that to increment it and append it to a local variable, something like

 

foo:=proc()
   local z:=convert( cat("tau__",N), '`local`');
   z;
end proc;

THen call it as

But would prefer to use `tools/genglobal` if possible.

Any other suggestions?

Maple 2026

Please Wait...