Re: Get rid of onion-like parentheses
- To: mathgroup at smc.vnet.net
- Subject: [mg37182] Re: Get rid of onion-like parentheses
- From: Pasquale Nardone <pasquale.nardone at ulb.ac.be>
- Date: Wed, 16 Oct 2002 14:25:00 -0400 (EDT)
- References: <aodnvf$mlm$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
In article <aodnvf$mlm$1 at smc.vnet.net>,
"JJJ Shen" <jushen1 at hotmail.com> wrote:
> Hi,
> I was trying to write a function, when given a list, say, {a,b,c,d}, the
> output is a op b op c op d, where op is (in LaTeX) \bigotimes, or "esc c *
> esc" (\[CircleTimes]) in Mathematica.
>
> Here's the code I wrote:
> f[{x_}]:=x;
> f[{x_, y_, z___}]:=f[Join[{x\[CircleTimes]y},{z}]];
>
> However, the output was not exactly what I expected, it looked like:
>
> ((a op b) op c) op d
>
> It seems when doing the "Join" operation, a pair of parenthesis was added.
>
> Can someone let me know how I can get rid of these parenthesis?
>
> Thanks a lot.
>
> JT
>
>
> _________________________________________________________________
> Chat with friends online, try MSN Messenger: http://messenger.msn.com
>
>
You can be very effective with a simple trick
f[MyList_]:=Drop[Flatten[Transpose[{MyList,Table[op,Length[MyList]]}]],-1
]
then you can apply on it a conversion to string
then save it to a file to be processed by TeX/LateX