examples-mathmeanings.tex /size: 22 Kb    last modification: 2025-02-21 11:03
1% macros=mkvi
2
3% \unprotect \pushoverloadmode
4% \protect
5
6\setupbackend[format=pdf/ua-2]
7% \setuptagging[state=start]
8% \nopdfcompression
9% \enabletrackers[structures.tags]
10% \enabletrackers[structures.tags.showtree]
11
12\environment examples-style
13\environment examples-style-math
14
15% todo-group.txt
16
17% \setupnote[mathnote][location=page]
18% \enabletrackers[math.textblobs]
19
20% \disabledirectives[structures.tags.shipout]
21% \enabledirectives [structures.tags.math.standalone]
22% \disabledirectives[structures.tags.math.strip]
23
24% \setuptagging
25%   [state=start]
26
27\definemathgroupset
28%   [demob]
29  [every]
30
31% \setmathgroupset
32%   [demob]
33
34\registermathfunction[𝑓]
35\registermathfunction[𝑔]
36
37% \registermathsymbol[default][en][𝐮][the vector]
38% \registermathsymbol[default][en][𝐯][the vector]
39% \registermathsymbol[default][en][𝖠][the matrix]
40
41\registermathsymbol[default][en][lowercasebold]           [the vector] % [of]
42\registermathsymbol[default][en][uppercasesansserifnormal][the matrix]
43
44% \registermathsymbol[default][sv][𝐮][vektorn]
45% \registermathsymbol[default][sv][𝐯][vektorn]
46
47\registermathsymbol[default][sv][lowercasebold]           [vektorn]
48\registermathsymbol[default][sv][uppercasesansserifnormal][matrisen]
49
50% \registermathsymbol[default][en][𝒞][the continuous functions]
51% \registermathsymbol[default][sv][𝒞][de kontinuerliga funktionerna]
52
53        \registermathsymbol[default][ua][lowercasebold]           [vektorn]
54        \registermathsymbol[default][ua][uppercasesansserifnormal][matrisen]
55
56%         \registermathsymbol[default][de][lowercasebold]           [vektorn]
57%         \registermathsymbol[default][de][uppercasesansserifnormal][matrisen]
58
59\def\ExampleLanguages{en,sv}
60\def\ExampleLanguages{debug,en,sv}
61% \def\ExampleLanguages{debug,en,sv,nl}
62% \def\ExampleLanguages{debug,en,sv,ua}
63% \def\ExampleLanguages{en,sv,ua}
64% \def\ExampleLanguages{en,sv,ua,de}
65
66% \enablemode[issues]
67
68% \enabletrackers[structures.tags.math.times]
69% \enabletrackers[structures.tags.math.keeplast=mmldata]
70% \enabletrackers[structures.tags.math.save]
71
72% The document itself:
73
74\startbuffer [colophon]
75
76\startsubject[title=About this document]
77
78This document is used by Mikael Sundqvist and Hans Hagen to check out how well a
79formula translates to a verbose meaning. It's an experiment with accessibility on
80the one hand but also a way to get documents validated and even annotated.
81Eventually there will be support for many languages but we started with English,
82Swedish and Dutch.
83
84\blank
85
86This feature is only available in \CONTEXT\ \MKXL, aka \LMTX. You can enable
87tracking in your document by for instance:
88
89\starttyping[option=TEX]
90\setuptagging
91  [state=start]
92
93\definemathgroupset
94  [mydemogroup]
95  [every]
96
97\setmathgroupset
98  [mydemogroup]
99
100\setupnote
101  [mathnote]
102  [location=page]
103
104\enabletrackers
105  [math.textblobs]
106\stoptyping
107
108By default a \type {mathnote} is set up to be an endnote in which case you need
109to place them with:
110
111\starttyping[option=TEX]
112\placenote[mathnode]
113\stoptyping
114
115\stopsubject
116\stopbuffer
117
118\startdocument
119  [title={Meaningfull Math},
120   author={Mikael Sundqvist & Hans Hagen}]
121
122\StartExample
123    % Addition and equals
124    \im {1 + 2 = 3}
125\StopExample
126
127\StartExample
128    % Subtraction and negative number
129    \im {1 - 2 = -1}
130\StopExample
131
132\StartExample
133    % Multiplication
134    \im {2 \times 3 = 2 \cdot 3 = 6}
135\StopExample
136
137\StartExample
138    % Decimal numbers
139    \im {1.1 + 2.22 = 3.33 = 3 + (0.1 + .22) \neq - \digits{1.23^4} \neq 10^5}
140\StopExample
141
142\StartExample
143    % Hexadecimal with \mn
144    \im {\mn{0x34BE} = 13502 = \digits{13502}}
145\StopExample
146
147\StartExample
148    % Squared
149    \im {3^2 + 4^2 = 5^2}
150\StopExample
151
152\StartExample
153    % Higher power
154    \im {3^4 + 4^4 \neq 5^4}
155\StopExample
156
157\StartExample
158    % Simple fraction
159    \dm {\frac{1}{2} = \frac{1}{3} + \frac{1}{6}}
160\StopExample
161
162\StartExample
163    % Fraction with symbols
164    \dm {\frac{1}{x} + \frac{1}{y} = \frac{x + y}{xy}}
165\StopExample
166
167\StartExample
168    % Fraction multiplied by number
169    \m{\frac{1}{2}2 = \frac{1}{2} \cdot 2 = \frac{1}{2} \times 2 = 2 \frac{1}{2} = 2 \cdot \frac{1}{2} = 2 \times \frac{1}{2}}
170\StopExample
171
172\StartExample
173    % Fraction multiplied by symbol
174    \m{\frac{1}{2}a = \frac{1}{2}\cdot a = \frac{1}{2} \times a = a \frac{1}{2} = a \cdot \frac{1}{2} = a \times \frac{1}{2}}
175\StopExample
176
177\StartExample
178    % With fraction times fraction
179    \dm {a\frac{1 + x}{x - 1} + \frac{1 - x}{1 + x}\frac{1 - y}{1 + y} + \frac{1 - x}{1 + x}y}
180\StopExample
181
182\StartExample
183    % Group and number/variable
184    \im {2(1 + x) + (1 + y)3 - a(1 + z) - (1 + u)b}
185\StopExample
186
187\StartExample
188    % Group and number/variable with explicit multiplication
189    \im {2 \cdot (1 + x) + (1 + y) \cdot 3 - a \cdot (1 + z) - (1 + u) \cdot b}
190\StopExample
191
192\StartExample
193    % Multiplication of indexed/sub (use \notimes if times should be surpressed)
194    \dm {a__2b__1 - a_1b_2 = a__2\notimes b__1 - a_1\notimes b_2}
195\StopExample
196
197\StartExample
198    % A few indices, both as one and as multi
199    % Do we want to use invisible comma anywhere? Probably not.
200    \dm {A_{1,20} + A_1_{20} + A_{1,20} + A_1_{20}}
201\StopExample
202
203\StartExample
204    % Group and element with sub(index)
205    \im {a__1(1 + x) + (1 + y)b__1 - a_2(1 + z) - (1 + u)b_2}
206\StopExample
207
208\StartExample
209    % Group and element with sub(index) and with explicit multiplication
210    \im {a__1 \cdot (1 + x) + (1 + y) \cdot b__1 - a_2 \cdot (1 + z) - (1 + u) \cdot b_2}
211\StopExample
212
213\StartExample
214    % Groups and times
215    \im {(n+k)n + (n+k)(n+1) + n(n+k)}
216\StopExample
217
218\StartExample
219    % Left right groups times
220    \im {\left(n+k\right)n + \left(n+k\right)\left(n+1\right) + n\left(n+k\right)}
221\StopExample
222
223\StartExample
224    % Fenced and times
225    \im {\fenced[parenthesis]{n+k}n + \fenced[parenthesis]{n+k}\fenced[parenthesis]{n+1} + n\fenced[parenthesis]{n+k}}
226\StopExample
227
228\StartExample
229    % Groups with powers and times
230    \dm {(1 + x)^n a  = a (1 + x)^n \neq (1 + x)^n (1 + y) - (1 + x)(1 + y)^n}
231\StopExample
232
233\StartExample
234    % Simple parenthesis usage
235    % Better use structured input (see next two examples)
236    \im {(1 + 2 + 3 + 4)^2 = 1^3 + 2^3 + 3^3 + 4^3}
237\StopExample
238
239\StartExample
240    % Better, but next one might be even more clear
241    \im {\left(1 + 2 + 3 + 4 \right)^2 = 1^3 + 2^3 + 3^3 + 4^3}
242\StopExample
243
244\StartExample
245    % Structured parenthesis usage
246    \im{\fenced[parenthesis]{1 + 2 + 3 + 4 }^2 = 1^3 + 2^3 + 3^3 + 4^3}
247\StopExample
248
249\StartExample
250    % Plus minus
251    \im {x \neq x + -1}
252\StopExample
253
254\StartExample
255    % Decimal period last in math goes
256    \im {x = 1.}
257\StopExample
258
259\StartExample
260    % Also goes for mathtextpunctuation
261    % (Mostly for displayed formulas, otherwise, keep the punctuation outside math)
262    \im {x = 1\mtp{.}}
263\StopExample
264
265\StartExample
266    % Period at end -> period goes
267    \im {x = y.}
268\StopExample
269
270\StartExample
271    % Also goes for mathtextpunctuation
272    \im {x=z\mtp{.}}
273\StopExample
274
275\StartExample
276    % Shoulf comma at the end also go? (bad input)
277    \im {x = y,}
278\StopExample
279
280\StartExample
281    % Variables can be used as placeholders for numbers (explaining decimals)
282    % We use \notimes to get rid of the explicit multiplication
283    \im {a__{0}.a__{1}\notimes a__{2} \ldots a__{n} \ldots}
284\StopExample
285
286\StartExample
287    % Different ways to access the multiplication dot
288    \im {y·z = y \cdot z = y \scalarproduct z}
289\StopExample
290
291\StartExample
292    % The f and g are in this document registered as functions
293    % There should be TIMES between g and h
294    \im {abcdefghikl}
295\StopExample
296
297\StartExample
298    % Lots of times
299    \im {xx \sin(x) x \frac{x}{x} x \sqrt{x} x \int x \sin \cos x \sin(x) \cos}
300\StopExample
301
302\StartExample
303    % f is registered as a function, h is not
304    \im {af(x) + bh(x) + f(x + b)}
305\StopExample
306
307\StartExample
308    % Apply function or whatever
309    \dm { A(X) \neq A\notimes(X) \neq A\applyfunction(X) \neq A\of(X)}
310\StopExample
311
312\StartExample
313    % Just an example where \of makes sense
314    \dm {\Sigma \of (X \vee Y) = \Sigma \of X \vee \Sigma \of Y}
315\StopExample
316
317\StartExample
318    % An example with something of two variables
319    \dm { F\of(x,t) = f__t(x) = \mathrm{f}__t\of(x)}
320\StopExample
321
322\StartExample
323    % Prime with and without \of
324    \dm { h'\of(x) \neq h'(x)}
325\StopExample
326
327\StartExample
328    % C \of examples
329    % We shall not get rid of the grouping since it gives structure
330    % One could think of a \nogroup (just as \notimes)
331    \im { C \of (\openinterval{a,b}) \neq C^^2 \of (\interval{a,b}) \neq C^^2 \of \interval{0,1} \neq C\of(\Omega) \neq 𝒞 \of (\Omega)}
332\StopExample
333
334\StartExample
335    % Nesting groups. Could it have meaning? Or should we only get one group.
336    \im { (((x))) \neq ((x)) \neq (\parenthesis{x})}
337\StopExample
338
339\StartExample
340    % Nesting groups/parentheses need to be there
341    \im { s\of(1) = s\of(\set{0}) = \set{0} \cup \set{\set{0}}}
342\StopExample
343
344\StartExample
345    % Algebra (ring) examples
346    \dm {\reals \of \bracket{x + 1} = \reals\fenced[bracket]{x} \neq \reals\of[x]}
347\StopExample
348
349\StartExample
350    % This is a result of
351    % \registermathsymbol[default][en][lowercasebold][the vector]
352    % \registermathsymbol[default][en][uppercasesansserifnormal][the matrix]
353    \im {\mathss{A}__{\mathbf{u}}\mathbf{v} \colonequals \mathbf{u} \crossproduct \mathbf{v}}
354\StopExample
355
356\StartExample
357    % Binomials are fractions
358    \im {\binom{3}{2} = \frac{3!}{(3-2)!2!}}
359\StopExample
360
361\StartExample
362    % With symbols it gets a bit long
363    \im {\binom{2n}{n + 1} = \frac{(2n)!}{(n - 1)!(n + 1)!}}
364\StopExample
365
366\StartExample
367    % Binomials, multiplied
368    \im {a\binom{n}{k} + \binom{n}{k}\binom{n}{a} + \binom{n}{k}x^k + \binom{n}{k}x}
369\StopExample
370
371\StartExample
372    % Binomial theorem
373    \dm {\parenthesis{1 + x}^n = \sum_{k = 0}^{n} \binom{n}{k}x^k}
374\StopExample
375
376\StartExample
377    % \ldots = , and so on
378    \im {x + x^2 + x^3 + \ldots = x/(1 - x)}
379\StopExample
380
381\StartExample
382    % Well-known complex formula
383    \im {3i \neq 3\ii \neq 1 + i \neq 2 + \ii \neq 3 + a i \neq 3 + a \ii }
384\StopExample
385
386\StartExample
387    % Well-known complex formula
388    \im {\ee^{\pi \ii } = -1}
389\StopExample
390
391\StartExample
392    % Do we need "times" before the \ee?
393    \im {a + b \ii = \sqrt{a^2 + b^2}\ee^{\ii\arg(a + \ii b)}}
394\StopExample
395
396\StartExample
397    % Simple conjugate
398    \im {\conjugate{a + b \ii} = a - b \ii}
399\StopExample
400
401\StartExample
402    % Implication
403    \im {x^2 = -1 \implies x = \pm \ii}
404\StopExample
405
406\StartExample
407    % Some radicals
408    \im {\sqrt{x} = x^{1/2} \neq x^{1/3} = \root[3]{x}}
409\StopExample
410
411\StartExample
412    % Some radicals with multiplication
413    \im {2\sqrt{x} = 2x^{1/2} \neq 2x^{1/3} = 2\root[3]{x}}
414\StopExample
415
416\StartExample
417    % Some radicals with multiplication
418    \im {a\sqrt{x} = ax^{1/2} \neq ax^{1/3} = a\root[3]{x}}
419\StopExample
420
421\StartExample
422    % Some radicals with multiplication
423    % This is bad input!
424    \im {\sqrt{x}2 = x^{1/2}2 \neq x^{1/3}2 = \root[3]{x}2}
425\StopExample
426
427\StartExample
428    % Product of radicals
429    \im {\sqrt{x} \sqrt{y} = \sqrt{xy}}
430\StopExample
431
432\StartExample
433    % Some radicals with multiplication
434    \im {\sqrt{x}a = x^{1/2}a \neq x^{1/3}a = \root[3]{x}a}
435\StopExample
436
437\StartExample
438    % Just a few numbersets with subsets
439    \im {\naturalnumbers \subset \integers \subset \rationals \subset \reals \subset \complexes}
440\StopExample
441
442\StartExample
443    % Just a few numbersets with intersection
444    \im {\naturalnumbers \cap \reals = \naturalnumbers}
445\StopExample
446
447\StartExample
448    % A set with a \fence. Notice that no group should be started after the fence
449    \im {\set{a \in \naturalnumbers \fence \mtext{\im{a} is even}}}
450\StopExample
451
452\StartExample
453    % A set with a \fence. More conditions
454    \dm {\rationals = \set{\frac{p}{q} \fence p,q \in \integers \land q \neq 0}}
455\StopExample
456
457\StartExample
458    % Maps colon is given by \maps (defined function)
459    \im {f \maps \reals \to \reals}
460\StopExample
461
462\StartExample
463    % Maps colon is given by \maps (named function)
464    \im {\sin \maps \reals \to \reals}
465\StopExample
466
467\StartExample
468    % Maps as colon by \mapsas
469    \im {f \mapsas x \mapsto x + \exp(x)}
470\StopExample
471
472\StartExample
473    % Maps as colon by \mapsas
474    \im {\sin \mapsas x \mapsto \sin(x)}
475\StopExample
476
477\StartExample
478    % Logarithms, spelled out
479    % Todo, add for other or remove for ln
480    \im {x \mapsto \ln(x)}
481\StopExample
482
483\StartExample
484    % The grouping is sometimes needed
485    \im {\sin x = \sin(x) \neq \sin(x) + 1 \neq \sin(x + 1)}
486\StopExample
487
488\StartExample
489    % Just a function
490    \im {f = \sin}
491\StopExample
492
493\StartExample
494    % Just a limit
495    \im {\lim a_{k} = -\infty}
496\StopExample
497
498\StartExample
499    % A limit with sub on lim
500    \im {\lim_{k \tendsto +\infty} a_{k}}
501\StopExample
502
503\StartExample
504    % Using index (__)
505    \im {\lim__{k \tendsto +\infty} a__{k} = -\infty}
506\StopExample
507
508\StartExample
509    % Limit and fractin (no times inbetween)
510    \dm {\lim \frac{a__{k}}{b__{k}}}
511\StopExample
512
513\StartExample
514    % Limit and fraction with sub on lim
515    \dm {\lim_{k \tendsto +\infty} \frac{A__k}{B__k}}
516\StopExample
517
518\StartExample
519    % Should be two formulas, but in this document we only show the last one
520    \im {f(x) \tendsto A \mtext{ as } x \tendsto a}
521\StopExample
522
523\StartExample
524    % Just a standard limit
525    \dm {\lim_{x \tendsto 0} \frac{\sin (x)}{x} = 1}
526\StopExample
527
528\StartExample
529    % More complicated in the sub.
530    \dm {\lim_{f(x) \tendsto 0} g(x)}
531\StopExample
532
533\StartExample
534    % Some derivatives
535    % Do we want "The function" here? (That is a more general question)
536    \im {f'(x) + f''(x) + f'''(x) + f''''(x)}
537\StopExample
538
539\StartExample
540    % Variable primed
541    \im {f' + h' + h'' + h''' + h''''}
542\StopExample
543
544\StartExample
545    % More derivatives
546    \im { \secondderivative{f} = f'' }
547\StopExample
548
549\StartExample
550    % An example with derivative
551    \im {\sin''(x) = -\sin(x) = \sin(x + \pi)}
552\StopExample
553
554\StartExample
555    % Even more derivatives, also with indices
556    \im {f__1'(x) + f__1^^2'(x) }
557\StopExample
558
559\StartExample
560    % Without \notimes we get a times. See also next example
561    \im {(f)'(x) + (f)'\notimes(x) + \derivative{(f)}(x) + \derivative{(f)}\notimes(x)}
562\StopExample
563
564\StartExample
565    % Here we want times, so we cannot block it in previous example
566    \im {(f+g)'(f+g) }
567\StopExample
568
569\StartExample
570    % More indices
571    \im {(f__1)^2 = (f_1)^2 \neq f_1^2 }
572\StopExample
573
574\StartExample
575    % A few more
576    \im {(x_1)^2 \neq x_1^2 }
577\StopExample
578
579\StartExample
580    % More indiced, we probably can remove some
581    \im {h_1 + h__1 + h^1 + h^^1}
582\StopExample
583
584\StartExample
585    % Amazing multiscript example
586    \im{
587        h_{}      ^{\lambda} ___{s}
588         _{\kappa}^{} % \noscript  %
589         _{\mu}   ^{} % \noscript  %
590         _{}      ^{\nu}     ___{t}
591         _{\phi}  ^{} % \noscript
592        }
593\StopExample
594
595\StartExample
596    % Multiscripts
597    \im {\Gamma_1^2_3^4 \neq \Gamma__1^^2__3^^4}
598\StopExample
599
600\StartExample
601    % Even more multiscripts
602    \im {\Gamma__1^^2__3^^4 \neq \Gamma__1^^2^^{}__3^^4}
603\StopExample
604
605\StartExample
606    % One example with prescript
607    The hypergeometric function \im {F____2__1}
608\StopExample
609
610\StartExample
611    % A sum and a fraction
612    \dm {\sum_{n = 1}^{+\infty} \frac{1}{n^2} = \frac{\pi^2}{6}}
613\StopExample
614
615\StartExample
616    % A sum with only sub index, and a fraction
617    \dm {\sum_{n \in \naturalnumbers} \frac{1}{n^2} = \frac{\pi^2}{6}}
618\StopExample
619
620\StartExample
621    % A product followed by a delimitered parenthesis
622    \dm {\sin x = \prod_{n = 1}^{+\infty} \left(1 - \frac{x^2}{\pi^2n^2}\right)}
623\StopExample
624
625\StartExample
626    % A product followed by a fence
627    \dm {\sin x = \prod_{n = 1}^{+\infty} \parenthesis{1 - \frac{x^2}{\pi^2n^2}}}
628\StopExample
629
630\StartExample
631    % A simple integral with limits
632    \dm {\int_{a}^{b} f'(x) \dd x = f(b) - f(a)}
633\StopExample
634
635\StartExample
636    % A bit more complex lower limit
637    \dm {\int_{x=a}^{b} f'(x) \dd x = f(b) - f(a)}
638\StopExample
639
640\StartExample
641    % An integral over the domain
642    \dm {\int_{\Omega} f \dd \mu = 0}
643\StopExample
644
645\StartExample
646    % An integral followed by a fraction
647    \dm {\int \frac{1}{1 + x^2} \dd x}
648\StopExample
649
650\StartExample
651    % An integral with limits, followed by a fraction
652    \dm {\int_0^1 \frac{1}{1 + x^2} \dd x}
653\StopExample
654
655\StartExample
656    % Some tuples
657    \im {\tuple{x^1, x^2, x^3} \neq \tuple{x^^1, x^^2, x^^3} = \tuple{x__1, x__2, x__3}}
658\StopExample
659
660\StartExample
661    % Complement shall not give times
662    \im {A \cup \complement A}
663\StopExample
664
665\StartExample
666    % Quantifiers
667    % We need to think about unary operators (class) in a broader sense
668    \im {\forall x \in A \exists y \in B: \abs{x - y} > 1}
669\StopExample
670
671\StartExample
672    % Right function adjoint
673    \im {\adjoint{T}T = T\adjoint{T} \neq \adjoint{T}}
674\StopExample
675
676\StartExample
677    % Same comment as for adjoint
678    \im {A \adj(A) = \det(A) I}
679\StopExample
680
681\StartExample
682    % Convolution with non-regiestered functions, note the \of
683    \im {(u \convolve v) (x) \colonequals \int_{\reals} u\of(\xi) v\of(x - \xi) \dd \xi}
684\StopExample
685
686\StartExample
687    % Convolution with registered functions
688    \im {(f \convolve g) (x) \colonequals \int_{\reals} f(\xi) g(x - \xi) \dd \xi}
689\StopExample
690
691\StartExample
692    % Right transpose function
693    \im {\transpose{A} + \transpose{(A + B^2)} + \transpose{\left(A^2 + B\right)}}
694\StopExample
695
696\StartExample
697    % Partial derivatives with lower indices. Beware of order.
698    \im {\secondderivative{f__{xy}} = \secondderivative{f__{yx}} = f__{xy}'' \neq \secondderivative{f}__{yx}}
699\StopExample
700
701\StartExample
702    % Inverse of function f
703    % It is the preimage that is the issue
704    \im {f(x) = y \iff x = \inverse{f}\of(y)}
705\StopExample
706
707\StartExample
708    % Inverse of variable h
709    \im {h\of(x) = y \iff x = \inverse{h}\of(y)}
710\StopExample
711
712\StartExample
713    % Preimage of function f
714    \im {\preimage{f}\of(Y) = \set{x \in X \fence f(x) = y}}
715\StopExample
716
717\StartExample
718    % Preimage of variable h
719    \im {\preimage{h}\of(Y) = \set{x \in X \fence h\of(x) = y}}
720\StopExample
721
722\StartExample
723    % Leibniz derivatives
724    \dm {\frac{\dd u}{\dd t} = u' = \dot{u}}
725\StopExample
726
727\StartExample
728    % More derivatives, Laplace operator
729    % Maybe we need operatorof here?
730    \dm {\frac{\partial u}{\partial t} = c^2 \laplace u}
731\StopExample
732
733\StartExample
734    \dm {\frac{\partial u}{\partial t} = c^2 \frac{\partial^2u}{\partial x^2}}
735\StopExample
736
737\StartExample
738    % More derivatives
739    % Here we see that "the function" from the registered
740    % function is not always wanted
741    \dm {\dd + \frac{\dd^3 u}{\dd x^3} + \frac{\dd f}{\dd x}}
742\StopExample
743
744\StartExample
745    % Upright d
746    \setupmathematics[differentiald=upright]
747    \dm {\dd + \frac{\dd^3 u}{\dd x^3} + \frac{\dd f}{\dd x}}
748\StopExample
749
750\StartExample
751    % A mixed partial derivative
752    \dm {\frac{\partial^3 u}{\partial x^2 \partial y}}
753\StopExample
754
755\StartExample
756    % A complex analysis way of writing it.
757    % To be thought of
758    \im {\conjugate{\partial} u = \bar{\partial} u = f}
759\StopExample
760
761\StartExample
762    % Experimented with partial derivative d d x group u plus v end group...
763    % but for accessibility reasons it is better to keep the partial
764    % We need \of here because one can have products as well
765    % Without \of one could consider \notimes, but if none is there we should get a TIMES
766    \dm {\frac{\partial}{\partial x}\of(u + v) = \frac{\partial u}{\partial x} + \frac{\partial v}{\partial x}}
767\StopExample
768
769\StartExample
770    % One example with Laplace followed by a close parenthesis
771    \im {(1 - \laplace)u = f}
772\StopExample
773
774\StartExample
775    % Just a few operators
776    \im {\laplace = \gradient \scalarproduct \gradient = \gradient^2 = \nabla \scalarproduct \nabla}
777\StopExample
778
779\StartExample
780    % Operator and crossproduct
781    \im {\gradient \crossproduct \gradient}
782\StopExample
783
784\StartExample[issue]
785    % Maybe shorter end
786    % Made an issue to enable discussion
787    \im {\floor{3.6} = \ceiling{2.7} = \integerpart{3.2}}
788\StopExample
789
790\StartExample
791    % Just a set
792    \im {A = \set[size=1]{1, 2, 3}}
793\StopExample
794
795\StartExample
796    % Just a tuple
797    \im {A = \tuple{1, 2, 3}}
798\StopExample
799
800\StartExample
801    % Just an absolute value
802    \im {|\abs[size=0]{a__{n__k} - A} < \epsilon}
803\StopExample
804
805\StartExample
806    % Inner product
807    \im {\innerproduct{u \fence v} = \conjugate{\innerproduct{v \fence u}}}
808\StopExample
809
810\StartExample
811    % A set with a fence
812    \im {\reals__{+} \colonequals \set{x \fence x \in \reals \land x > 0}}
813\StopExample
814
815\StartExample
816    % Simple unstructured input works, but do not use!
817    % \setupmathematics[autointervals=no]
818    \im {[a,b[ \neq ]a,b] \neq ]a,b[ \neq [a,b]}
819\StopExample
820
821\StartExample
822    % Warning: Nesting with weird parenthesis is not supported
823    \im {X = \varleftopeninterval{a,(b + 1)} \neq ]a,(b + 1)]}
824\StopExample
825
826\StartExample
827    % Closure of interval
828    \im {\closure{\openinterval{a,b}} = \closedinterval{a,b}}
829\StopExample
830
831\StartExample
832    % Closure of interval
833    \im {\closure{\varopeninterval{0,1}} = \closedinterval{0,1}}
834\StopExample
835
836\StartExample
837    % Random formula
838    % Mikael: Think about the Delta
839    \dm {u\of(b)-u\of(a)=\lim_{n\to+\infty} \parenthesis{f(x__1)\Delta x__1+f(x__2)\Delta x__2+\ldots+f(x__n)\Delta x__n}}
840\StopExample
841
842\StartExample
843    % Absolute value, triangle inequality
844    \im {\abs{x + y} \leq \abs{x} + \abs{y}}
845\StopExample
846
847\StartExample
848    % Norm, triangle inequality
849    \im {\norm{x + y} \leq \norm{x} + \norm{y}}
850\StopExample
851
852\StartExample
853    % Both norm and absolute value
854    \im {\norm{\alpha x} = \abs{\alpha} \norm{x}}
855\StopExample
856
857\StartExample
858    % Example with \mtp
859    \im {f(x) = x^2 \mtp{,} x \in \reals}
860\StopExample
861
862\StartExample
863    % Logic example
864    \im {\lnot(P \lor Q) = (\lnot P) \land (\lnot Q)}
865\StopExample
866
867\StartExample
868    % \neg is now defined as a function. Maybe char-def
869    % TODO Fix \neg?
870    \im {\neg(P \land Q) \iff (\lnot P) \lor (\lnot Q)}
871\StopExample
872
873\StartExample
874    % Yet another example with quantifier
875    % Observe the usage of \notimes
876    \im {(\forall x \in \reals)\notimes (x > 0 \lor x = 0 \lor x < 0)}
877\StopExample
878
879\StartExample
880    % Cases example
881    \dm {f(x) =
882        \startcases
883            \NC x  \NC x > 0 \NR
884            \NC -x \NC x < 0 \NR
885        \stopcases}
886\StopExample
887
888\StartExample
889    % Cases with lefttext
890    \dm{f(x) =
891        \startcases[lefttext=\mtp{,}]
892            \NC x  \NC x > 0 \NR
893            \NC -x \NC x < 0 \NR
894        \stopcases}
895\StopExample
896
897\StartExample
898    % Cases with righttext
899    \dm{f(x) =
900        \startcases[righttext=\mtext{if }]
901            \NC x  \NC x > 0 \NR
902            \NC -x \NC x < 0 \NR
903        \stopcases}
904\StopExample
905
906\StartExample
907    % Chemistry example
908    % Todo: maybe defaultstyle to \tf
909    \setupmathematics[domain=chemistry]
910    \dm{
911        {\tf X}^^^{123}__{12}^{+4} \approx X^^^{123}__{12}^{+4}
912    }
913\StopExample
914
915\StartExample
916    \dm{
917        \left(1 + x + x^2\right)^2
918    }
919\StopExample
920
921\StartExample
922    \setupmathematics[domain=simplified]
923    \dm{
924        \left(1 + x + x^2\right)^2
925    }
926\StopExample
927
928\StartExample
929    % User formula
930    % Maybe add something inbetween nedsted sums (and integrals)?
931    \startformula \chi^{2} = \sum_{i = 1}^{r}{\sum_{j = 1}^{c}\frac{\left( O_{ij} - E_{ij} \right)^{2}}{E_{ij}}} \stopformula
932\StopExample
933
934\StartExample
935    \im {\fourier{x+1} \neq \fourier{x}}
936\StopExample
937
938\stopdocument
939