Formatting Engee scripts with LaTeX¶
This example provides a set of commands in the document markup language $\LaTeX{}$, which allow you to format mathematical expressions, text and graphics in user interactive scripts Engee in a convenient and presentable way.
When layout scripts in Engee you should keep in mind that the display of mathematical symbols in expressions embedded in a string, for example: $\int \frac{1}{\sigma {\sqrt {2\pi }}}\,e^{-{(x-\mu )^{2}/2\sigma ^{2}}}\;dx$ may differ from the display of symbols switched off from the string: $$\int \frac{1}{\sigma {\sqrt {2\pi }}}},e^{-{-{(x-\mu )^{2}/2\sigma ^{2}}}}\;dx$$$.
The list of commands in the example $\LaTeX{}$ is not exhaustive.
1. Signs and symbols¶
1.1 Number systems¶
Natural $\mathbb N$
Natural with zero $\mathbb N_0$
Plain $\mathbb P$
Whole $\mathbb Z$
Rational $\mathbb Q$
Algebraic $\overline{\mathbb Q}$, $\mathbb A$
Irrational $\mathbb I$
Real $\mathbb R$
Complex $\mathbb C$
Quaternions $\mathbb H$
Octonions (Caley numbers) $\mathbb O$
Cedenions $\mathbb S$
1.2 Greek alphabet¶
$A\ \alpha$
$B\ \beta$
$\Gamma\ \gamma$
$\Delta\ \delta$
$E\ \epsilon\ \varepsilon$
$Z\ \zeta$
$H\ \eta$
$\Theta\ \theta\ \vartheta$
$I\ \iota$
$K\ \kappa\ \varkappa$
$\Lambda\ \lambda$
$M\ \mu$
$N\ \nu$
$\Xi\ \xi$
$O\ o$
$\Pi\ \pi\ \varpi$
$P\ \rho\ \varrho$
$\Sigma\ \sigma\ \varsigma$
$T\ \tau$
$\Upsilon\ \upsilon$
$\Phi\ \phi\ \varphi$
$X\ \chi$
$\Psi\ \psi$
$\Omega\ \omega$
1.3 Multiple dots and matrices¶
Multiple dots at the bottom
$k = 1, 2, \dots, n-1$
$k = 1, 2, \ldots, n-1$
Centred dots
$k = 1, 2, \cdots, n-1$
Vertical dotted line
$\vdots$
Diagonal punctuation
$\ddots$
Matrices
$\begin{matrix} x_{11} & x_{12} & x_{13} \\ x_{21} & x_{22} & x_{23} \\ x_{31} & x_{32} & x_{33} \\ \end{matrix}$
$M = \left[ \begin{matrix} x_{11} & x_{12} & x_{13} \\ x_{21} & x_{22} & x_{23} \\ x_{31} & x_{32} & x_{33} \\ \end{matrix} \right]$
$A_{m,n} = \begin{pmatrix} a_{1,1} & a_{1,2} & \cdots & a_{1,n} \\ a_{2,1} & a_{2,2} & \cdots & a_{2,n} \\ \vdots & \vdots & \ddots & \vdots \\ a_{m,1} & a_{m,2} & \cdots & a_{m,n} \end{pmatrix}$
1.4 Brackets, stoppers¶
Horizontal braces
$\underbrace{1+2+\ldots+x}_{n} \quad$
$\overbrace{1+2+\ldots+x}^{n}$
Parentheses
$(\frac{A^2}{B_i})$
$\Bigg( \bigg( \Big( \big( \, ( \quad ) \, \big) \Big) \bigg) \Bigg)$
Automatic scaling of brackets
$\left( \frac{A^2}{B_i} \right)$
Brackets
$\Bigg\{ \bigg\{ \Big\{ \big\{ \{ \quad \} \big\} \Big\} \bigg\} \Bigg\}$
Square brackets
$\Bigg[ \bigg[ \Big[ \big[ \, [ \quad ] \, \big] \Big] \bigg] \Bigg]$
Angle brackets
$\Bigg\langle \bigg\langle \Big\langle \big\langle \langle \quad \rangle \big\rangle \Big\rangle \bigg\rangle \Bigg\rangle$
Straight brackets
$\Bigg| \bigg| \Big| \big| | \quad | \big| \Big| \bigg| \Bigg|$
Double straight brackets
$\Bigg\| \bigg\| \Big\| \big\| \| \quad \| \big\| \Big\| \bigg\| \Bigg\|$
1.5 Indices and accents¶
Indices
$x_{i^2}$
Indices and degrees
$x_{i_n^2}^{n_2^i}$
Ordinary Emphases
$\hat{x}, \check{x}, \tilde{x}, \acute{x}, \grave{x}$
$\dot{x}, \ddot{x}, \breve{x}, \bar{x}, \vec{x}$
Wide accents
$\widehat{xyz}, \widetilde{xyz}$
$\overrightarrow{AB}$
1.6 Other¶
Hebrew symbols
$\aleph, \, \beth, \, \gimel$
Planck's reduced constant (Dirac constant)
$\hbar = 1,054571800(13) \times 10^{-34} \ Дж \cdot с$
Some of the more specific signs not given in this example can be found in the documentation of Engee.
2. arithmetic and elementary algebra¶
Not equal
$a \ne b$
$a \neq b$
Approximate equality
$x \approx y$
Identity
$m \equiv n$
Proportionality
$x \sim y$
$x \propto y$
Give or take
$\pm$
Minus-plus
$\mp$
Amount
$\sum _{i=1} ^{n} x_i$
$\sum \limits _{i=1} ^{n} x_i$
The product of a dot
$a \cdot b$
Vector and matrix product
$A \times B$
Tensor product
$A \otimes B$
Element product
$A \odot B$
Work
$\prod \limits ^{n} _{i=0} x_i$
Fractions
$\frac{3}{4}$
$T = T_0 {g H \over {g_0 H_0}}$
Obelus
$\div$
Square root
$i = \sqrt{-1}$
Root of nth degree
$\sqrt[n]{a+b}$
Elevation
$x^{n_0}$
Infinity
$\infty$
Actual part
$\Re(z)$
imaginary part
$\Im(z)$
3. set theory¶
An empty set
$\emptyset$,
$\varnothing$
Belongs to $n \in \mathbb C$ Does not belong $n \notin \mathbb C$
Subset
$A \subseteq B$
$A \subset B$
Superset
$A \supseteq B$
$A \supset B$
Own subset
$A \subsetneq B$
Eigenset
$A \supsetneq B$
union
$A \cup B$
Intersection
$A \cap B$
Difference of sets
$A \setminus B$
function
$f:X \to Y$
Display
$f:x \mapsto f(x)$
4. Comparisons and mathematical logic¶
Less than or equal to
$A \leq B$
$A \leqslant B$
Greater than or equal to
$A \geq B$
$A \geqslant B$
A lot less
$A \ll B$
Much more
$A \gg B$
Implication
$A \Rightarrow B$
$A \rightarrow B$
$A \supset B$
Equivalence
$A \Leftrightarrow B$
Quantifier of universality ("for everyone...")
$\forall n \in \mathbb{N}$
Quantor of existence
$\exists z \in \mathbb{Z} \quad$ ("exists...")
$\nexists z \in \mathbb{Z} \quad$ ("does not exist...")
Definition
$x:=y$
$P :\Leftrightarrow Q$
$P \stackrel{\rm{def}}{=} Q$
Negation "NOT."
$\bar{A}$
$\lnot A$
$\neg A$
OR disjunction
$A \lor B$
$A \vee B$
"And" conjunction
$A \land B$
$A \wedge B$
Negation of disjunction (Pierce's arrow) OR-NE
$A \downarrow B$
Negation of conjunction (Schaeffer's stroke) "AND-NE"
$A | B$
$A \uparrow B$
"EXCLUDING OR"
$A \oplus B$
5. Trigonometry and geometry¶
5.1 Signs¶
Angle
$\angle ABC$
Perpendicular
$AB \bot CD$
Parallel
$AB \parallel CD$
Proportionality
$AB \sim CD$
$AB \propto CD$
Gradus
$\alpha = 90^\circ$
Vector
$\vec a$
$\overrightarrow{AB}$
5.2 Functions¶
Sine
$\sin{\frac{\pi}{2}}$
Cosine
$\cos{\frac{\pi}{2}}$
tangent
$\tan{\frac{\pi}{2}}$
Cotangent
$\cot{\frac{\pi}{2}}$
arcsinus
$\arcsin{\frac{\sqrt{3}}{2}}$
Arccosine
$\arccos{\frac{\sqrt{3}}{2}}$
Arctangent
$\arctan{\frac{\sqrt{2}}{2}}$
Sekans
$\sec{\alpha}$
Cosecans
$\csc{\alpha}$
5.3 Hyperbolic functions¶
Hyperbolic sine
$\sinh{x}$
Hyperbolic cosine
$\cosh{x}$
Hyperbolic tangent
$\tanh{x}$
Hyperbolic tangent
$\coth{x}$
6. Mathematical analysis¶
Indefinite integral (within a paragraph)
$\int f(x) dx$
Undefined integral (off)
$$\int f(x) dx$$
Definite integral (within a paragraph)
$\int_{a}^{b}f(x)dx$
$\int\limits_{a}^{b}f(x)dx$
Double, triple integrals
$\iint f(x) dx$
$\iiint f(x) dx$
Integral over a closed contour
$\oint dl$
partial derivative
${\partial\over{\partial y}}f(x)$
Limit
$\lim \limits_{x \to \infty} f(x) = 0$
Maximum, minimum
$\max X$
$\min X$
Supremum, infimum
$\sup X$
$\inf X$
Nabla operator (Hamilton operator)
$\nabla = \frac{\partial}{\partial x} \vec \imath +\frac{\partial}{\partial y} \vec \jmath + \frac{\partial}{\partial z} \vec k$
7. $\LaTeX{}$ in graphs¶
Using the library LaTeXStrings.jl
you can simplify the design of labels and symbols in graphs in the markup $\LaTeX{}$.
using Plots, LaTeXStrings
gr(size=([500, 300]))
default(fontfamily="Computer Modern", linewidth=2, framestyle=:nothing, grid=true)
F = collect(1:10);
m = 2;
a = F.*m;
Plots.plot(F, a, label = L"a=f(F)", legend = :topleft)
xlabel!(L"Сила\ F,\ [Н \cdot м]")
ylabel!(L"Ускорение\ a,\ [\frac{м}{с^2}]")
title!(L"График\ зависимости\ ускорения\ от\ силы")
To learn more about the layout of Engee charts in $\LaTeX{}$, see documentation.
8. Formatting¶
8.1 Spaces¶
$Текст и формула без пробелов.$ $f(x)=x^2+3x+2$
$Пробелы\ как\ в\ тексте.$ $f(x)=x^2\ +\ 3x\ +\ 2$
$Пробелы,\qquad эквивалентные\qquad двойному\qquad размеру\qquad шрифта.\qquad(36\qquad mu)$ $f(x)=x^2\qquad +\qquad 3x\qquad +\qquad 2$
$Пробелы,\quad эквивалентные\quad размеру\quad шрифта.\quad(18\quad mu)$ $f(x)=x^2\quad +\quad 3x\quad +\quad 2$
$Пробелы,\; эквивалентные\; \frac{5}{18}\; размера \;шрифта.\; (5\; mu)$ $f(x)=x^2\; +\; 3x\; +\; 2$
$Пробелы,\: эквивалентные\: \frac{4}{18}\: размера \:шрифта.\: (4\: mu)$ $f(x)=x^2\: +\: 3x\: +\: 2$
$Пробелы,\, эквивалентные\, \frac{3}{18}\, размера \,шрифта.\, (3\, mu)$ $f(x)=x^2\, +\, 3x\, +\, 2$
$Пробелы,\! эквивалентные\! -\frac{3}{18}\! размера \! шрифта.\! (-3 \! mu)$ $f(x)=x^2\!+\!3x\!+\!2$