summaryrefslogtreecommitdiff
path: root/doc/context/sources/general/manuals/math
diff options
context:
space:
mode:
authorContext Git Mirror Bot <phg42.2a@gmail.com>2016-06-18 16:51:50 +0200
committerContext Git Mirror Bot <phg42.2a@gmail.com>2016-06-18 16:51:50 +0200
commit22e02504c253153b4e57030334989a95c5b62a46 (patch)
tree8400bc7ca7e5db6b67b6c67aff23321ff385189b /doc/context/sources/general/manuals/math
parenteefbee47c0b7ac3a179e1e7fcd2e6ea1af990676 (diff)
downloadcontext-22e02504c253153b4e57030334989a95c5b62a46.tar.gz
2016-06-18 16:33:00
Diffstat (limited to 'doc/context/sources/general/manuals/math')
-rw-r--r--doc/context/sources/general/manuals/math/math-framing-001.tex113
-rw-r--r--doc/context/sources/general/manuals/math/math-mkiv.tex79
-rw-r--r--doc/context/sources/general/manuals/math/math-spacing-001.tex73
3 files changed, 265 insertions, 0 deletions
diff --git a/doc/context/sources/general/manuals/math/math-framing-001.tex b/doc/context/sources/general/manuals/math/math-framing-001.tex
new file mode 100644
index 000000000..5081b8ad2
--- /dev/null
+++ b/doc/context/sources/general/manuals/math/math-framing-001.tex
@@ -0,0 +1,113 @@
+\setuplayout[topspace=5mm,bottomspace=5mm,height=middle,header=1cm,footer=0cm]
+
+\starttext
+
+\startbuffer[sample]
+ \enabletrackers[formulas.framed] \showboxes
+ \startformula
+ e = mc^2
+ \stopformula
+ \par
+ \startformula
+ e = mc^2
+ \stopformula
+ \startformula
+ e = mc^2
+ \stopformula
+ \startformula
+ e \dorecurse{12} { = mc^2 }
+ \stopformula
+ \startplaceformula
+ \startformula
+ e = mc^2
+ \stopformula
+ \stopplaceformula
+ \startplaceformula
+ \startformula
+ e \dorecurse{12} { = mc^2 }
+ \stopformula
+ \stopplaceformula
+\stopbuffer
+
+\startbuffer[setup-b]
+\setupformula
+ [option=frame]
+\stopbuffer
+
+\startbuffer[setup-d]
+\setupformulaframed
+ [frame=on,
+ %toffset=10pt,
+ %boffset=10pt,
+ foregroundcolor=white,
+ background=color,
+ backgroundcolor=gray]
+\stopbuffer
+
+\startbuffer[setup-c]
+\setupformula
+ [frame=number]
+\stopbuffer
+
+\startbuffer[all]
+\start
+ \typebuffer[setup-a]
+ \getbuffer[setup-a]
+ \getbuffer[sample]
+ \typebuffer[setup-b]
+ \typebuffer[setup-d]
+ \getbuffer[setup-b]
+ \getbuffer[setup-d]
+ \getbuffer[sample]
+ \typebuffer[setup-c]
+ \getbuffer[setup-c]
+ \getbuffer[sample]
+ \page
+\stop
+\stopbuffer
+
+\startbuffer
+ \startbuffer[setup-a]
+ \setupformula
+ [align=flushleft]
+ \stopbuffer
+ \getbuffer[all]
+ \startbuffer[setup-a]
+ \setupformula
+ [align=flushleft,location=left]
+ \stopbuffer
+ \getbuffer[all]
+
+ \startbuffer[setup-a]
+ \setupformula
+ [align=middle]
+ \stopbuffer
+ \getbuffer[all]
+ \startbuffer[setup-a]
+ \setupformula
+ [align=middle,location=left]
+ \stopbuffer
+ \getbuffer[all]
+
+ \startbuffer[setup-a]
+ \setupformula
+ [align=flushright]
+ \stopbuffer
+ \getbuffer[all]
+ \startbuffer[setup-a]
+ \setupformula
+ [align=flushright,location=left]
+ \stopbuffer
+ \getbuffer[all]
+\stopbuffer
+
+\getbuffer
+
+\startbuffer[setup-b]
+\setupformula
+ [option={tight,frame}]
+\stopbuffer
+
+\getbuffer
+
+\stoptext
diff --git a/doc/context/sources/general/manuals/math/math-mkiv.tex b/doc/context/sources/general/manuals/math/math-mkiv.tex
index 0148a8807..f16359fcb 100644
--- a/doc/context/sources/general/manuals/math/math-mkiv.tex
+++ b/doc/context/sources/general/manuals/math/math-mkiv.tex
@@ -606,8 +606,87 @@ We might add some more control in the future, but this is what you get:
\startlinecorrection \getbuffer \stoplinecorrection
+Framing a formula is also supported as a option, where the full power of framed can
+be applied to the formula. We will illustrate this in detail on the next pages. For this
+we use the following sample:
+
+\typefile{math-framing-001.tex}
+
+In \in {figure} [framing-flushleft], \in [framing-middle] \in {and}
+[framing-flushright] you see some combinations. You can run this example on your
+machine and see the details.
+
+\startplacefigure[location=page,reference=framing-flushleft,title={Framed formulas flushed left.}]
+ \startcombination[2*2]
+ {\typesetfile[math-framing-001.tex][page=01,height=.45\textheight]} {\tttf right + flushleft}
+ {\typesetfile[math-framing-001.tex][page=02,height=.45\textheight]} {\tttf right + flushleft}
+ {\typesetfile[math-framing-001.tex][page=07,height=.45\textheight]} {\tttf left + flushleft + tight}
+ {\typesetfile[math-framing-001.tex][page=08,height=.45\textheight]} {\tttf left + flushleft + tight}
+ \stopcombination
+\stopplacefigure
+
+\startplacefigure[location=page,reference=framing-middle,title={Framed formulas centered.}]
+ \startcombination[2*2]
+ {\typesetfile[math-framing-001.tex][page=03,height=.45\textheight]} {\tttf right + middle}
+ {\typesetfile[math-framing-001.tex][page=04,height=.45\textheight]} {\tttf right + middle}
+ {\typesetfile[math-framing-001.tex][page=09,height=.45\textheight]} {\tttf left + middle + tight}
+ {\typesetfile[math-framing-001.tex][page=10,height=.45\textheight]} {\tttf left + middle + tight}
+ \stopcombination
+\stopplacefigure
+
+\startplacefigure[location=page,reference=framing-flushright,title={Framed formulas flushed right.}]
+ \startcombination[2*2]
+ {\typesetfile[math-framing-001.tex][page=05,height=.45\textheight]} {\tttf right + flushright}
+ {\typesetfile[math-framing-001.tex][page=06,height=.45\textheight]} {\tttf right + flushright}
+ {\typesetfile[math-framing-001.tex][page=11,height=.45\textheight]} {\tttf left + flushright + tight}
+ {\typesetfile[math-framing-001.tex][page=12,height=.45\textheight]} {\tttf left + flushright + tight}
+ \stopcombination
+\stopplacefigure
+
\stopchapter
+With each formula class a framed variants is automatically created:
+
+\startbuffer
+\defineformula
+ [foo]
+
+\setupformulaframed
+ [foo]
+ [frame=on,
+ framecolor=red]
+
+\startfooformula[frame]
+ e=mc^2
+\stopfooformula
+\stopbuffer
+
+\typebuffer
+
+This time you get a red frame:
+
+\getbuffer
+
+You can also frame the number, as in:
+
+\startbuffer
+\setupformulaframed[framecolor=red,frame=on,offset=1ex]
+\setupformula[option=frame,color=blue]
+\setupformula[numbercommand={\inframed[framecolor=green]}]
+
+\startplaceformula
+ \startformula
+ 2 + 2 = 2x
+ \stopformula
+\stopplaceformula
+\stopbuffer
+
+\typebuffer
+
+The boxes get properly aligned:
+
+\start \showboxes \getbuffer \stop
+
\stoptext
% when we compare these tables with the one that the ff loader produces we notice
diff --git a/doc/context/sources/general/manuals/math/math-spacing-001.tex b/doc/context/sources/general/manuals/math/math-spacing-001.tex
new file mode 100644
index 000000000..a0ccda449
--- /dev/null
+++ b/doc/context/sources/general/manuals/math/math-spacing-001.tex
@@ -0,0 +1,73 @@
+\doifmodeelse {with-struts} {
+ \def\Line{\dontleavehmode{\showstruts\dorecurse{18}{x \strut x }}}
+} {
+ \def\Line{\dontleavehmode{\showstruts\dorecurse{18}{x x }}}
+}
+
+\setuplayout
+ [width=middle,
+ height=middle,
+ backspace=1mm,
+ topspace=1cm]
+
+\setupbodyfont
+ [17.3pt]
+
+\starttext
+
+\Line
+
+\startformula
+ x
+\stopformula
+
+\Line
+
+\startformula
+ y
+\stopformula
+
+\Line
+
+\startformula
+ \strut x
+\stopformula
+
+\Line
+
+\startformula \startalign
+ \NC c - a = \NC b \NR
+ \NC d + c - b = \NC a \NR
+\stopalign \stopformula
+
+\Line
+
+\startformula \startalign
+ \NC c - a = \NC b \NR
+ \NC d + c - b = \NC a \NR
+\stopalign \stopformula
+
+\Line
+
+\startformula
+\mframed
+ [offset=1mm,loffset=3mm,roffset=3mm] {
+ a + b = c
+ }
+\stopformula
+
+\Line
+
+\startformula
+\mframed
+ [offset=1mm,loffset=3mm,roffset=3mm] {
+ \startalign
+ \NC c - a = \NC b \NR
+ \NC d + c - b = \NC a \NR
+ \stopalign
+ }
+\stopformula
+
+\Line
+
+\stoptext