Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2012

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

Search the Archive

Re: Print TraditionalForm

  • To: mathgroup at smc.vnet.net
  • Subject: [mg126654] Re: Print TraditionalForm
  • From: Alexei Boulbitch <Alexei.Boulbitch at iee.lu>
  • Date: Tue, 29 May 2012 05:46:08 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com

I want to typeset a math equation that is is printed in TraditionalForm. Here is an example:



t = (Subscript[c, v1] Subscript[n, 1] Subscript[T, 1] + 

   Subscript[c, v2] Subscript[n, 2] Subscript[T, 2])/(

  Subscript[c, v1] Subscript[n, 1] + Subscript[c, v2] Subscript[n, 2]);



Print["T" // TraditionalForm, " = ", t]



The Print statement gives me the equation I want but in Courier font, which is default for Print. If I select the output cell and use the notebook interface to Convert to TraditionalForm, then the equation is printed in the default font for text, which is really how I want it. Is it possible to obtain the final result using only Mathematica expressions, without having to go through the notebook interface?





If you do not especially attached to using Print, this could be done in a number of ways. If I would want it in an output cell (as you seems to want it) and to have a full control on font, size, slanting and so on, I would do like this:



ExpressionCell[

 Style["T=\!\(\*FractionBox[\(\*SubscriptBox[\(c\), \(v1\)]\\\ \

\*SubscriptBox[\(n\), \(1\)]\\\ \*SubscriptBox[\(T\), \(1\)] + \

\*SubscriptBox[\(c\), \(v2\)]\\\ \*SubscriptBox[\(n\), \(2\)]\\\ \

\*SubscriptBox[\(T\), \(2\)]\), \(\*SubscriptBox[\(c\), \(v1\)]\\\ \

\*SubscriptBox[\(n\), \(1\)] + \*SubscriptBox[\(c\), \(v2\)]\\\ \

\*SubscriptBox[\(n\), \(2\)]\)]\)", 18, Italic, Bold, 

  RGBColor[0, 0.5, 0], FontFamily -> "Tahoma"], "Output"]



Try it. Otherwise you may do it like this:



ExpressionCell[

 Style[HoldForm[

   T = (Subscript[c, v1] Subscript[n, 1] Subscript[T, 1] + 

     Subscript[c, v2] Subscript[n, 2] Subscript[T, 2])/(

    Subscript[c, v1] Subscript[n, 1] + 

     Subscript[c, v2] Subscript[n, 2])], 18, Italic, Bold, Blue, 

  FontFamily -> "Arial"], "Output"]



Try this also. Have fun.



Alexei BOULBITCH, Dr., habil.

IEE S.A.

ZAE Weiergewan,

11, rue Edmond Reuter,

L-5326 Contern, LUXEMBOURG



Office phone :  +352-2454-2566

Office fax:       +352-2454-3566

mobile phone:  +49 151 52 40 66 44



e-mail: alexei.boulbitch at iee.lu









  • Prev by Date: Re: GraphPath With Edge Weights
  • Next by Date: Re: Sqrt of complex number
  • Previous by thread: Re: Print TraditionalForm
  • Next by thread: Re: Print TraditionalForm