Changes

Jump to navigation Jump to search
2,406 bytes removed ,  13:16, 9 August 2020
m
Text replacement - "<cmd>" to "{{cmd|"
< [[Math]] Be sure to also read the recent (2006-08-02) [http://dl.contextgarden.net/myway/mathalign.pdf Using \startalign and friends] written by Aditya Mahajan. This set of math examples is taken from the comments in the <tt>[[source:core-mat.tex|core-mat.tex</tt> ]] file, which contains most of the core ConTeXt math macros. The <tt>textwidth</tt> has been set to 8 cm in these examples so that the page isn't too wide (see [[Layout]] and {{cmd|setuplayout}} for further information specific to layout).
----
<context>
\setuplayout[textwidth=8cm]
This is a bit of text for purpose of example.\epar
\startitemize
</context>
In the next examples we explicitly align formulas to the left (<{{cmd>|raggedleft</cmd>}}), center and right (<{{cmd>|raggedright</cmd>}}):
<texcode>\setupformulas[aligncontext source=left]\startformula c^2 "yes" text= a^2 + b^2 \stopformula"Or in print:">\setupformulassetuplayout[aligntextwidth=middle8cm]\startformula c^2 = a^2 + b^2 \stopformula\setupformulas[align=right]\startformula c^2 = a^2 + b^2 \stopformula</texcode> Or in print: <context>
\setupformulas[align=left]
\startformula c^2 = a^2 + b^2 \stopformula
</context>
With formula numbers these formulas look as followsthe code is:
<contextsource="yes" text="And the formulas look like:">\setuplayout[textwidth=8cm]
\setupformulas[align=left]
\placeformula \startformula c^2 = a^2 + b^2 \stopformula
</context>
This was keyed in as: <texcode>\setupformulas[align=left]\placeformula \startformula c^2 = a^2 + b^2 \stopformula\setupformulas[align=middle]\placeformula \startformula c^2 = a^2 + b^2 \stopformula\setupformulas[align=right]\placeformula \startformula c^2 = a^2 + b^2 \stopformula</texcode> When tracing is turned on (<{{cmd>|tracemathtrue</cmd>}}) you can visualize the bounding box of the formula,
<context>
\setuplayout[textwidth=8cm]
\tracemathtrue
\setupformulas[align=left]
As you can see, the dimensions are the natural ones, but if needed you can force a normalized line:
<texcode>\setupformulas[align=middle,strutcontext source="yes]\tracemathtrue\placeformula \startformula c^2 " text= a^2 + b^2 \stopformula</texcode> "This time we get a more spacy result. [Ed. Note: For this example equation, there appears to be no visible change.]"> <context>\setuplayout[textwidth=8cm]
\setupformulas[align=middle,strut=yes]
\tracemathtrue
We will now show a couple of more settings and combinations of settings. In centered formulas, the number takes no space
<texcodecontext source="yes">\tracemathtrue\setupformulassetuplayout[aligntextwidth=middle8cm]\startformula c^2 = a^2 + b^2 \stopformula\placeformula \startformula c^2 = a^2 + b^2 \stopformula</texcode> <context>
\tracemathtrue
\setupformulas[align=middle]
You can influence the placement of the whole box with the parameters <tt>leftmargin</tt> and <tt>rightmargin</tt>.
<texcodecontext source="yes">Some example text, again, to show where the right and left margins of the text block are.\tracemathtrue\setupformulassetuplayout[align=right,leftmargintextwidth=3em8cm]\startformula c^2 = a^2 + b^2 \stopformula\placeformula \startformula c^2 = a^2 + b^2 \stopformula \setupformulas[align=left,rightmargin=1em]\startformula c^2 = a^2 + b^2 \stopformula\placeformula \startformula c^2 = a^2 + b^2 \stopformula</texcode> <context>
Some example text, again, to show where the right and left margins of the text block are.
\tracemathtrue
\placeformula \startformula c^2 = a^2 + b^2 \stopformula
</context>
 
You can also inherit the margin from the environment.
<texcodecontext source="yes">Some example text, again, to show where the right and left margins of the text block are.\tracemathtrue\setupformulassetuplayout[aligntextwidth=right,margin=standard8cm]\startformula c^2 = a^2 + b^2 \stopformula\placeformula \startformula c^2 = a^2 + b^2 \stopformula</texcode> <context>
Some example text, again, to show where the right and left margins of the text block are.
\tracemathtrue
The distance between the formula and the number is only applied when the formula is left or right aligned.
<texcodecontext source="yes">\setuplayout[textwidth=8cm]
\tracemathtrue
\setupformulas[align=left,distance=2em]
\startformula c^2 = a^2 + b^2 \stopformula
\placeformula \startformula c^2 = a^2 + b^2 \stopformula
</texcodecontext>
<context>\tracemathtrue\setupformulas[align=left,distance=2em]\startformula c^2 = a^2 + b^2 \stopformula\placeformula \startformula c^2 = a^2 + b^2 \stopformula</context>{{Columns navbox}}
[[Category:Math]]
[http://www.town-china.cn 中央吸尘][http://www.town-china.cn 新风系统]
[http://www.town-china.cn 杭州通诚投资公司][http://www.021boy.com 成人用品]
[http://www.91yg.com 成人用品][http://www.air520.com 杭州婚庆][http://www.anteyi.cn 屏蔽器]
[http://www.atetech.com.cn 手机信号屏蔽器][http://www.51wisdom.com 网站建设] [http://www.51wisdom.com 杭州网络公司]
[http://www.56918.com/web.htm 网站建设][http://www.56918.com 虚拟主机][http://www.56918.com 域名注册]
[http://www.56918.com/promote.htm 网站推广][http://www.56918.com/email.htm 企业邮箱][http://www.56918.com/domain.htm 域名申请]
[http://www.56156.com 物流][http://www.dzsc.com 电子][http://www.ic37.com IC]
[http://www.51wisdom.com/jianshe_1.htm 网站建设] [http://www.51wisdom.com/jz.htm 虚拟主机]
[http://www.51wisdom.com/yinyong_1.asp 域名注册] [http://www.51wisdom.com/tuiguang.asp 网站推广]
[http://www.51wisdom.com/youju.asp 企业邮局][http://www.zhkaw.com 癌症] [http://www.51wisdom.com.cn/vi.htm vi设计] [http://www.51wisdom.com.cn/wangye 网页设计] [http://www.air520.com 杭州婚庆]
[http://www.air520.com 杭州婚庆司仪][http://www.air520.com 杭州婚庆主持]
[http://www.ywxjm.com 腰带] [http://www.51wisdom.com.cn/pingmian.htm 平面设计]
[http://www.51wisdom.net/biaozhi.htm 标志设计] [http://www.anteyi.cn 手机信号屏蔽器] [http://www.anteyi.cn 屏蔽器]

Navigation menu