CONNECT-platform

The Formula component allows for using math formulas in your docs:

1> :Formula align=center2>3> 4> f_n = 5> \begin{cases}6> 1 & \text{if $$n \leq 2$$} \\7> f_{n - 1} + f_{n - 2} & \text{otherwise} \\8> \end{cases}9> 
$f_n = \begin{cases}1 & \text{if $$n \leq 2$$} \\f_{n - 1} + f_{n - 2} & \text{otherwise} \\\end{cases}$1

You can also use Formula inline component:

1So lets talk about [\frak{L}_{SM}](:Formula), or lets just do it in 2the last example of the page.

So lets talk about $\frak{L}_{SM}$, or lets just do it in the last example of the page.

error IMPORTANT

YOU MUST ENABLE FORMULAS via config to be able to use them. Read the following section to find out how to enable Formulas.

Formulas are not by default plugged into CODEDOC, as they require additional resources. To enable them, simply import formulaPlugin and add it to your plugins via .codedoc/config.ts:

.codedoc/config.ts1import { configuration } from '@codedoc/core';2import { formulaPlugin } from '@codedoc/core/components';34// ...56export const config = /*#__PURE__*/configuration({7  // ...8  plugins: [9    // ...10    formulaPlugin11  ],12  // ...13});

CODEDOC uses KaTeX for producing its formulas, which means you can check this support table to find out which TeX functions are available. If you are lazy like me, you can also just use this nice cheatsheet:

Markdown syntax can collide with Tex functions. For example, if you have this formula:

1\begin{pmatrix}21 & -1 \\3-1 & i4\end{pmatrix}

Then the row delimiter, \\, would collide with markdown syntax. To avoid that, you can simply enclose the colliding parts with single backtick (i.e.  character):

1> :Formula 2>3> \begin{pmatrix}4> 1 & -1 \\       <!--> the \\ is enclosed with backticks to avoid collision with markdown -->5> -1 & i6> \end{pmatrix}
$\begin{pmatrix} 1 & -1 \\ -1 & i \end{pmatrix}$1

Alternatively, you could put all of your formula in a code-block (enclose it with three backticks, i.e. ):

1> :Formula 2>3>                 <!--> the whole formula is enclosed-->4> \begin{pmatrix}5> 1 & -1 \\          <!--> so the \\ doesn't need to be any more-->6> -1 & i7> \end{pmatrix}8> 
$\begin{pmatrix}1 & -1 \\-1 & i\end{pmatrix}$1

You can use align property to align formulas at the center. It can either be set to left or center:

1> :Formula align=center2>3> G_{\mu\nu} + \Lambda g_{\mu\nu} = \cfrac{8\pi G}{c^4}T_{\mu\nu}
$G_{\mu\nu} + \Lambda g_{\mu\nu} = \cfrac{8\pi G}{c^4}T_{\mu\nu}$1

You can also utilize size property to control size of your formulas. It can either be set to normal or large:

1> :Formula size=large, align=center2>3> G_{\mu\nu} + \Lambda g_{\mu\nu} = \cfrac{8\pi G}{c^4}T_{\mu\nu}
$G_{\mu\nu} + \Lambda g_{\mu\nu} = \cfrac{8\pi G}{c^4}T_{\mu\nu}$1

Each paragraph or code-block will be assumed as one line of formula, independent of how many actual lines it consists of:

1> :Formula2>3> \text{let}\;s \equiv G \cancel{\vdash} s4>5> G \vdash s \implies G \vdash (G \cancel{\vdash} s) \implies \bot6>7> G \vdash \neg{s} \implies G \vdash (G \vdash s) \implies G \vdash s \implies \bot8>9> \implies \neg(G \vdash s) \land \neg(G \vdash \neg{s}) \\   <!--> despite the newline, these will all be displayed as one "line" -->10> \implies G \;\text{is not complete.}                        <!--> despite the newline, these will all be displayed as one "line" -->
$\text{let}\;s \equiv G \cancel{\vdash} s$1
$G \vdash s \implies G \vdash (G \cancel{\vdash} s) \implies \bot$2
$G \vdash \neg{s} \implies G \vdash (G \vdash s) \implies G \vdash s \implies \bot$3
$\implies \neg(G \vdash s) \land \neg(G \vdash \neg{s}) \\ \implies G \;\text{is not complete.}$4

1> :Formula2> 3> 4> \frak{L}_{SM} = \quad5> \underbrace{6>   \frac{1}{4} W_{\mu\nu} 7>   \cdot \frac{1}{4} W^{\mu\nu} 8>   - \frac{1}{4} G^a_{\mu\nu} G^{\mu\nu}_a9> }_{\tiny{\text{kinetic energies and self-interactions of gauge bosons}}}10> 11> 12> \quad\quad\;+ \quad \underbrace{13>   \bar{L} \gamma^{\mu} (i\partial_\mu - \frac{1}{2}g\tau \cdot W_\mu - \frac{1}{2}g'YB_\mu)L14>  + \bar{R} \gamma^{\mu} (i\partial_\mu - \frac{1}{2}g'YB_\mu)R15> }_{\tiny{\text{kinetic energies and electroweak interactions of fermions}}}16> 17> 18> \quad\quad\; + \quad \underbrace{19>   \frac{1}{2}|(i\partial_\mu - \frac{1}{2}g\tau \cdot W_\mu) - \frac{1}{2}g'YB_\mu|^2 - V(\phi)20> }_{\tiny{W\pm,Z,\gamma\text{and Higgs masses and couplings}}}21> 22> 23> \quad\quad\; + \quad \underbrace{24>   g''(\bar{q}\gamma^\mu T_a q) G^a_\mu25> }_{\tiny{\text{interactions between gluons and quarks}}} \\       <!--> despite the newline, these will all be displayed as one "line" -->26> \space \\                                                         <!--> despite the newline, these will all be displayed as one "line" -->27> \quad\quad\; + \quad \underbrace{28>   (G_1 \bar{L}\phi R + G_2 \bar{L}\phi_c R + h.c.)29> }_{\tiny{\text{fermion masses and couplings to Higgs}}}30> 
$\frak{L}_{SM} = \quad\underbrace{ \frac{1}{4} W_{\mu\nu} \cdot \frac{1}{4} W^{\mu\nu} - \frac{1}{4} G^a_{\mu\nu} G^{\mu\nu}_a}_{\tiny{\text{kinetic energies and self-interactions of gauge bosons}}}$1
$\quad\quad\;+ \quad \underbrace{ \bar{L} \gamma^{\mu} (i\partial_\mu - \frac{1}{2}g\tau \cdot W_\mu - \frac{1}{2}g'YB_\mu)L + \bar{R} \gamma^{\mu} (i\partial_\mu - \frac{1}{2}g'YB_\mu)R}_{\tiny{\text{kinetic energies and electroweak interactions of fermions}}}$2
$\quad\quad\; + \quad \underbrace{ \frac{1}{2}|(i\partial_\mu - \frac{1}{2}g\tau \cdot W_\mu) - \frac{1}{2}g'YB_\mu|^2 - V(\phi)}_{\tiny{W\pm,Z,\gamma\text{and Higgs masses and couplings}}}$3
$\quad\quad\; + \quad \underbrace{ g''(\bar{q}\gamma^\mu T_a q) G^a_\mu}_{\tiny{\text{interactions between gluons and quarks}}} \\\space \\\quad\quad\; + \quad \underbrace{ (G_1 \bar{L}\phi R + G_2 \bar{L}\phi_c R + h.c.)}_{\tiny{\text{fermion masses and couplings to Higgs}}}$4
Markdownchevron_right
Code Featureschevron_right

Images & Assets

Configurationchevron_right
Customizationchevron_right