Difference between revisions of "Math with newmat"
Jump to navigation
Jump to search
m (Removed extraneous brackets, cleaned spacing, corrected "permeance" misspelling.) |
|||
(5 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
− | + | Here some short examples of how to use math with the [http://source.contextgarden.net/m-newmat.tex newmat] module, which "collects macros that TeX users kind of expect to be available when typesetting math," according to the documentation. These currently include the {{cmd|frac}} family ({{cmd|frac}}, {{cmd|dfrac}}, {{cmd|tfrac}}, {{cmd|binom}}, etc.), the {{cmd|QED}} symbol, the {{cmd|boxed}} command, and the <tt>subarray</tt>, <tt>substack</tt>, and <tt>smallmatrix</tt> environments, along with a few others. At one time it also included the {{cmd|text}} command, though that has now been moved to the core. | |
− | + | Inline maths: | |
+ | <context source="yes" text="produces"> | ||
+ | \usemodule[newmat] | ||
+ | |||
+ | Inline math: $x = \frac{y}{2z} + x_{\text{center}}$ | ||
+ | </context> | ||
− | < | + | Display math: |
+ | <context source="yes" text"produces"> | ||
\usemodule[newmat] | \usemodule[newmat] | ||
+ | Display math: | ||
\startformula | \startformula | ||
q = \delta \frac{\partial p}{\partial x} = | q = \delta \frac{\partial p}{\partial x} = | ||
Line 12: | Line 19: | ||
k \frac{\partial \phi}{\partial x} | k \frac{\partial \phi}{\partial x} | ||
\stopformula | \stopformula | ||
+ | </context> | ||
− | + | Legends: | |
− | + | <context source="yes"> | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | <context> | ||
\usemodule[newmat] | \usemodule[newmat] | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
\startlegend | \startlegend | ||
Line 47: | Line 31: | ||
\leg L \\ length \\ \\ | \leg L \\ length \\ \\ | ||
\stoplegend | \stoplegend | ||
+ | </context> | ||
− | + | Aligned display math: | |
+ | <context source="yes"> | ||
+ | \usemodule[newmat] | ||
\startformula\eqalign{ | \startformula\eqalign{ | ||
− | t_{L,early} & = t_{L,late} = t_{L,ray} \cr | + | t_{L,\text{early}} & = t_{L,\text{late}} = t_{L,\text{ray}} \cr |
& = 6\ \mu m \cr | & = 6\ \mu m \cr | ||
}\stopformula | }\stopformula | ||
+ | </context> | ||
+ | |||
+ | (These samples are adapted from an example sent to the mailing list on 2005-06-28 by Wolfgang Zillig.) | ||
− | |||
− | + | [[Category:Old_Content]] |
Latest revision as of 22:23, 11 May 2024
Here some short examples of how to use math with the newmat module, which "collects macros that TeX users kind of expect to be available when typesetting math," according to the documentation. These currently include the \frac family (\frac, \dfrac, \tfrac, \binom, etc.), the \QED symbol, the \boxed command, and the subarray, substack, and smallmatrix environments, along with a few others. At one time it also included the \text command, though that has now been moved to the core.
Inline maths:
\usemodule[newmat] Inline math: $x = \frac{y}{2z} + x_{\text{center}}$
produces
Display math:
\usemodule[newmat] Display math: \startformula q = \delta \frac{\partial p}{\partial x} = \delta(\phi) p_{vsat}(\theta) \frac{\partial \phi}{\partial x} = \left[ \frac{\delta_a}{\mu(\theta)} p_{vsat}(\theta) \right] \frac{\partial \phi}{\partial x} = k \frac{\partial \phi}{\partial x} \stopformula
Legends:
\usemodule[newmat] \startlegend \leg k \\ water vapor permeability \\ \\ \leg K \\ water vapor permeance \\ \\ \leg S \\ surface \\ \\ \leg L \\ length \\ \\ \stoplegend
Aligned display math:
\usemodule[newmat] \startformula\eqalign{ t_{L,\text{early}} & = t_{L,\text{late}} = t_{L,\text{ray}} \cr & = 6\ \mu m \cr }\stopformula
(These samples are adapted from an example sent to the mailing list on 2005-06-28 by Wolfgang Zillig.)