Re: Transforming an expression to publication form
- To: mathgroup at smc.vnet.net
- Subject: [mg120584] Re: Transforming an expression to publication form
- From: carlos at colorado.edu
- Date: Sat, 30 Jul 2011 05:59:52 -0400 (EDT)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- References: <201107191057.GAA10297@smc.vnet.net> <j06auj$nig$1@smc.vnet.net>
On Jul 20, 4:33 am, Andrzej Kozlowski <a... at mimuw.edu.pl> wrote: > On 19 Jul 2011, at 11:57, car... at colorado.edu wrote: > > > > > > > Suppose I have the expression > > > C11=A*Em*(4-3*omega^2+nu*(-8+3*omega^2)+(-4+8*nu)*Cos[kappa]); > > > I want to transform this into > > > C11pub=Em*A*(4*(1-2*nu)*(1-Cos[kappa])-3*(1-nu)*omega^2); > > > which is the exactly the way it has to appear in a journal > > publication, > > once mapped to LaTeX. Both C11 and C11pub have the > > same LeafCount (27), and C11 is invariant under Simplify > > and FullSimplify. > > > How do I accomplish C11 -> C11pub within Mathematica, > > without using any extra packages? BTW this is part of one > > of 36 matrix entries, so transforming all by hand takes a while. > > On the one hand: in general, it is not reasonable to expect Mathematica > to do such things. It is not really intended for this purpose and while > one can often succeed by using special tricks, there is no general > approach and I don't think it is worth spending time on uncovering the > tricks needed in an individual case. > > On the other hand, in this particular case it is rather easy to see > these "tricks". Namely: > > C11 = A*Em*(4 - 3*omega^2 + > nu*(-8 + 3*omega^2) + (-4 + 8*nu)*Cos[kappa]) > > Collect[Collect[C11, omega, Factor], {Em, A}] > > A Em (4 (2 nu-1) (cos(kappa)-1)+3 (nu-1) omega^2) > > This is essentially your C11pub except for some signs in a few places. > > Andrzej Kozlowski Many thanks! I had forgotten that Collect can be nested. Related question: once I tried //TraditionalForm//InputForm hoping to get a nicer text to cut and paste in LaTeX. But InputForm regresses to the original unpublishable display, with minus signs in wrong places and superfluous parentheses. Can these filters be nested in some way?
- References:
- Transforming an expression to publication form
- From: carlos@colorado.edu
- Transforming an expression to publication form