Re: TeXForm and negative exponents

• To: mathgroup at smc.vnet.net
• Subject: [mg32626] Re: TeXForm and negative exponents
• From: Paul Abbott <paul at physics.uwa.edu.au>
• Date: Fri, 1 Feb 2002 02:02:27 -0500 (EST)
• Organization: University of Western Australia
• References: <a1gv2g$n6g$1@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

Jens Dreger <jens.dreger at physik.fu-berlin.de> wrote:

> Example:
>
>  In[1]:= TeXForm[1/(1 + 2 Exp[-3 t])]
>  Out[1]:= \frac{1}{1 + \frac{2}{e^{3\,t}}}
> ....
>
> The output I want is:
>
>  \frac{1}{1 + 2 e^{-3 t}}

Here is one way:

In[1]:= Unprotect[Times]

Out[1]= {Times}

In[2]:= Format[a_*E^(b_),TeXForm]:= a HoldForm[e^b]

In[3]:= Protect[Times]

Out[3]= {Times}

In[4]:= TeXForm[1/(1 + 2 Exp[-3 t])]

Out[4]//TeXForm= \frac{1}{1 + 2\,e^{-3\,t}}

Cheers,
Paul

--
____________________________________________________________________
Paul Abbott                                   Phone: +61-8-9380-2734
Department of Physics                           Fax: +61-8-9380-1014
The University of Western Australia      (CRICOS Provider No 00126G)
35 Stirling Highway
Crawley WA 6009                      mailto:paul at physics.uwa.edu.au
AUSTRALIA                            http://physics.uwa.edu.au/~paul

God IS a weakly left-handed dice player
____________________________________________________________________



• Prev by Date: Re: Keeping order with Union
• Next by Date: Re: help: recursive functions
• Previous by thread: Re: Keeping order with Union
• Next by thread: Re: finding independent variable groups