MathGroup Archive 1998

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: TeXForm, OutputForm questions ?

Your query has been forwarded to me by the
comp.soft-sys.math.mathematica moderator. 

> To: comp-soft-sys-math-mathematica@moderators
> Message-ID: <>
> Date: Tue, 17 Feb 1998 13:16:54 +0100
> From: Alexej Jerschow <>
> Subject: [mg11118] TeXForm, OutputForm questions ?

> 1) TeXForm creates matrices where the columns are separated by \& rather
> than &, so I have to change that every time I include text in the LaTeX
> file. Can this be switched ?
> 2) Matrices are created with the\matrix command, this does not seem to
> suit amstex or amsmath package. Simple way to fix this ?

> 3) Possibility to create LaTeX tabulars with formulae as entries ? (so
> that I don't have to include $ pairs for every entry myself)

The behavior of TeXForm under Mathematica 2.x and 3.0 are significanly
different.  It is not clear from the behaviors you describe what version
you might be using.  Could you give me a more precise description of what
you do to generate the TeX form of matrices and tables?   If you are using
Mathematica 3.0, I may be able to provide you with some guidance on how to
get the best output possible by taking advantage of the front end's
typesetting mechanisms.
> These questions may be rather related to Mathematica output form:
> 4) Simple way to represent exp ans exp rather than e^{...}.

(* First, disable spell warning message because exp is similar to Exp *)


(* Temporarily disable protection on changes to the Power function *)


(* Use Format to tell TeXForm how to format expression.  See Mathematica
   book, Section 2.8.16 *)

Format[Power[E,x_],TeXForm]:= exp[x]

(* Restore protection on Power *)


(* Reenable spelling warnings *)


(* Now when we apply TeXForm... *)

E^(x^2+y^2)  // TeXForm

(* we get exp instead *)

\exp({x^2} + {y^2})

> 5) represent factors like \frac{1}{\sqrt{2}} as 2^{-1/2}, possible ?
Similar line of reasoning, except this time we have to turn to
Mathematica 3.0's box typesetting mechanism:


        RowBox[{"-", "1"}], "/", "2"}]]


When we evaluate:

1/(x^2 + y^2)^(1/2) // TeXForm

We get:


> 6) represent \cos(\frac{\beta}{2})^2 rather as \cos^2\frac{\beta}{2},
> possible ?

Similar to question (5)

Format[Power[Cos[x_],2],TeXForm]:= RowBox[{
      SuperscriptBox["Cos", "2"], "(", MakeBoxes[x], ")"}]

Evaluation of:

Cos[beta/2]^2 //TeXForm


{{\cos }^2}\Big(\frac{\beta}{2}\Big)

P.J. Hinton
Mathematica Programming Group  Wolfram
Research, Inc.        

  • Prev by Date: Re: 2nd level pure function
  • Next by Date: Re: Conic Sections and Quadric Surfaces
  • Prev by thread: Re: exponential rule application
  • Next by thread: RE: ISO data management, graph