Re: Defining output formats

*To*: mathgroup at smc.vnet.net*Subject*: [mg88124] Re: Defining output formats*From*: dh <dh at metrohm.ch>*Date*: Fri, 25 Apr 2008 05:30:09 -0400 (EDT)*References*: <fukes1$s4t$1@smc.vnet.net>

Hi Szabolcs, this seems a bug of TeXForm. In other forms it seems to work. If you say: Format[x]:="{\\bf x}"; without explizite format, your example seems to work: In[3]:= TeXForm[1+x^2] Out[3]//TeXForm= \text{$\{\backslash \backslash $bf x$\}$}^2+1 hope this helps, Daniel Szabolcs Horvát wrote: > On the doc page tutorial/DefiningOutputFormats there is an example: > > """ > This specifies the TeXForm for the symbol x. > > In[1]:= Format[x, TeXForm] := "{\\bf x}" > > The output format for x that you specified is now used whenever the TeX > form is needed. > > In[2]:= TeXForm[1 + x^2] > > Out[2]//TeXForm= > x^2+1 > """ > > Quite obviously, this does not work in the way the documentation > suggests. I would have expected {\bf x}^2 + 1. > > Let's try another example: > > In[3]:= TeXForm[x] > > Out[3]//TeXForm= > \text{$\{\backslash \backslash $bf x$\}$} > > So is there a way to tell Mathematica that x should always be formatted > in bold in TeXForm? >