[Date Index]
[Thread Index]
[Author Index]
Re: Re: Display Math Formula
*To*: mathgroup at smc.vnet.net
*Subject*: [mg92489] Re: Re: Display Math Formula
*From*: Alexei Boulbitch <Alexei.Boulbitch at iee.lu>
*Date*: Wed, 1 Oct 2008 18:33:52 -0400 (EDT)
John wrote:
> Mathematica 6 Notebook
>
> A pallette version of the formula is available if needed.
>
> The formula must be print when the notebook is formatted, but nothing
> that I have tried works.
>
> The evaluation executes, but there is a empty box, tinted red, where
> the formula should appear.
Unfortunatly it needs some wild guessing when trying to understand what
you try to achieve, so the follwing might be off topic. Probably
ExpressionCell is what you are looking for, e.g.:
ExpressionCell[(x + 1)^a/(1 + y)^2]
> Am I right to expect that Cell[????....?] will do the job, if the ?s
> are replaced with correct code?
Cell is the low level version, which needs some extra effort to create a
correctly formatted cell in the notebook. This would be one way to
create a cell with a formatted formula within it:
CellPrint[Cell[BoxData[ToBoxes[(x + 1)^a/(1 + y)^2]], "Output"]]
hth,
albert
Hi, John,
just to add few things to what Albert advised.
We very recently had a discussion on how to introduce a expression and accentuate it. You can have a look for various ideas
proposed in this discussion.
Few further possibilities:
This shows the integral and the integration result:
aa = ExpressionCell[
"\!\(\*SubsuperscriptBox[\"\[Integral]\", \"a\", \"b\"]\)x\
\[DifferentialD]x=" \!\(
\*SubsuperscriptBox[\(\[Integral]\), \(a\), \(b\)]\(x \
\[DifferentialD]x\)\), "Traditional"];
aa
(ExpressionCell[
"\!\(\*SubsuperscriptBox[\(\[Integral]\), \(a\), \(b\)]\)x\
\[DifferentialD]x=" (
Rational[-1, 2] $CellContext`a^2 + Rational[
1, 2] $CellContext`b^2), "Output"])
This in addition fixes a format of one part of the expression different from that of another part:
Clear[cell];
cell = Row[{ExpressionCell[
Style["\!\(\*SubsuperscriptBox[\"\[Integral]\", \"a\", \"b\"]\)x\
\[DifferentialD]x=", Italic, 22, Blue, Bold]],
ExpressionCell[Style[\!\(
\*SubsuperscriptBox[\(\[Integral]\), \(a\), \(b\)]\(x \
\[DifferentialD]x\)\), Italic, 22]]}];
cell
(Row[{ExpressionCell[
Style["\!\(\*SubsuperscriptBox[\(\[Integral]\), \(a\), \(b\)]\)x\
\[DifferentialD]x=", Italic, 22, RGBColor[0, 0, 1], Bold]],
ExpressionCell[
Style[Rational[-1, 2] $CellContext`a^2 + Rational[
1, 2] $CellContext`b^2, Italic, 22]]}])
However, it seems me that the most comfortable way is to fix the expression using Style. Like this:
In[9]:= Style["\!\(\*FractionBox[SuperscriptBox[\"x\", \"y\"],
RowBox[{\"1\", \"+\",
RowBox[{\"a\", \"/\", \"b\"}]}]]\)", 22, Italic, Bold, Red, "Courier \
New"]
Out[9]= \!\(\*
StyleBox["\<\"\\!\\(\\*FractionBox[SuperscriptBox[\\(x\\), \\(y\\)], \
\\(1 + a/b\\)]\\)\"\>", "Courier New",
StripOnInput->False,
FrontFaceColor->RGBColor[1, 0, 0],
BackFaceColor->RGBColor[1, 0, 0],
GraphicsColor->RGBColor[1, 0, 0],
FontSize->22,
FontWeight->Bold,
FontSlant->Italic,
FontColor->RGBColor[1, 0, 0]]\)
This also allows to differently format part of the formula like this:
Row[{Style["\!\(\*FractionBox[SuperscriptBox[\"x\", \"y\"],
RowBox[{\"1\", \"+\",
RowBox[{\"a\", \"/\", \"b\"}]}]]\)", 22, Italic, Bold, Red,
"Courier New"],
Style["\!\(\*FractionBox[\"dz\", \"dx\"]\)", 28, Italic, Bold,
Blue, "Times New Roman"]
}]
or place them into a column, again with an independent formatting like this:
Column[{Style["\!\(\*FractionBox[SuperscriptBox[\"x\", \"y\"],
RowBox[{\"1\", \"+\",
RowBox[{\"a\", \"/\", \"b\"}]}]]\)", 22, Italic, Bold, Red,
"Courier New"],
Style["\!\(\*FractionBox[\"dz\", \"dx\"]\)", 28, Italic, Bold,
Blue, "Times New Roman"]
}]
Have fun, Alexei
--
Alexei Boulbitch, Dr., Habil.
Senior Scientist
IEE S.A.
ZAE Weiergewan
11, rue Edmond Reuter
L-5326 Contern
Luxembourg
Phone: +352 2454 2566
Fax: +352 2454 3566
Website: www.iee.lu
This e-mail may contain trade secrets or privileged, undisclosed or otherwise confidential information. If you are not the intended recipient and have received this e-mail in error, you are hereby notified that any review, copying or distribution of it is strictly prohibited. Please inform us immediately and destroy the original transmittal from your system. Thank you for your co-operation.
Prev by Date:
**Re: extracting contour points**
Next by Date:
**Re: fellow authors**
Previous by thread:
**Re: data source for demonstration**
Next by thread:
**Re: fellow authors**
| |