
# Table of Contents

1.  [Requirements](#org4ef3068)
2.  [Preamble](#org5057cfc)
3.  [Text](#org38fc526)
    1.  [Headline](#orgd7aec77)
    2.  [Formatting](#org45bd66e)
    3.  [Line break](#org4c59219)
    4.  [Color](#orgc65280f)
    5.  [Glyphs & More](#orge4f0791)
    6.  [Makros](#org2d382d6)
4.  [Links](#orgd461620)
5.  [Rule](#orgd2864d8)
6.  [Blocks](#orge509350)
    1.  [Lists](#org7a757d0)
    2.  [Tables, Figures, Listings](#org6a67108)
    3.  [Tables](#org1aec460)
        1.  [Alignment and Bookstab style](#orgb0eb069)
        2.  [Alignment](#org56a805e)
        3.  [Fixed width / multi-line cells](#org7d1ce47)
        4.  [Multi-page table / longtable](#org7196622)
        5.  [Number alignment](#org15b4bfd)
        6.  [Custom caption command for LaTeX](#org04ba224)
        7.  [Overlay using tikz](#org4cee948)
        8.  [From Python src block output](#org65c531b)
    4.  [Figures](#orgc31a623)
        1.  [file svg](#orgc7b3cb4)
        2.  [file png](#orgcff0d65)
        3.  [latex using tikz with data file](#orgc7679b4)
        4.  [python using matplotlib](#org652ad40)
        5.  [dot graphviz](#org9912238)
    5.  [Example / Verbatim](#orgfefe34c)
    6.  [Source](#org3a33e67)
7.  [Math](#orgfdf528c)
    1.  [Symbols and Functions](#org87778fa)
        1.  [Quotation, Fraction](#org898036b)
        2.  [Units](#orga1efd2d)
        3.  [Fields](#org5aff887)
        4.  [Functions](#org4909920)
        5.  [Operators](#org42b3c8d)
        6.  [Others](#org5c23188)
        7.  [Tensor](#org1633eb6)
    2.  [Equation](#org0ff7fd8)
    3.  [Matrix](#org4dfe99b)
8.  [Glossary and Acronym and References](#org3d43a21)
    1.  [Glossary](#org1c7eefb)
    2.  [Acronym](#orgb013133)
    3.  [References](#org49df23a)
9.  [LaTeX](#orgf649abc)
10. [Examples](#org7f3208b)
    1.  [Org table to data file](#org4b4a7d1)
    2.  [Data file to Org table](#org88bd729)

If exporting only a subtree; the heading will be the document title if
not overwritten by the property `EXPORT_TITLE`.

Inside emacs org use `org-ref-list-of-tables` and
`org-ref-list-of-figures` to open a list of tables or figures.


<a id="org4ef3068"></a>

# Requirements

`latexmk`: for glossary and acronym add the following to `~/.config/latexmk/latexmkrc`

    add_cus_dep( 'acn', 'acr', 0, 'makeglossaries' );
    add_cus_dep( 'glo', 'gls', 0, 'makeglossaries' );
    $clean_ext .= " acr acn alg glo gls glg";
    sub makeglossaries {
      my ($base_name, $path) = fileparse( $_[0] );
      my @args = ( "-q", "-d", $path, $base_name );
      if ($silent) { unshift @args, "-q"; }
      return system "makeglossaries", "-d", $path, $base_name;
    }
    
    add_cus_dep('glo', 'gls', 0, 'makeglo2gls');
    sub makeglo2gls {
        system("makeindex -s '$_[0]'.ist -t '$_[0]'.glg -o '$_[0]'.gls '$_[0]'.glo");
    }
    
    add_cus_dep('acn', 'acr', 0, 'makeacn2acr');
    sub makeacn2acr {
        system("makeindex -s \"$_[0].ist\" -t \"$_[0].alg\" -o \"$_[0].acr\" \"$_[0].acn\"");
    }


<a id="org5057cfc"></a>

# Preamble

The preamble is defined by Org-keywords.

First line of the file can be used to define the spelling language of
the document.

    # -*- ispell-local-dictionary: "english" -*-
    # -*- ispell-local-dictionary: "german" -*-

The title (also used in pdf metadata field)

    #+TITLE: The title

The subtitle

    #+SUBTITLE: The subtitle

The date

    #+DATE: May 16, 2022
    #+DATE: \today

Author(s) (also used in pdf metadata field)

    #+AUTHOR: Max Muster
    #+AUTHOR: Max Muster and Maxi Muster
    #+AUTHOR: Max Muster, Maxi Muster

Email(s)

    #+EMAIL: max.muster@example.com
    #+EMAIL: max.muster@example.com and maxi.muster@example.com
    #+EMAIL: max.muster@example.com, maxi.muster@example.com

Keywords (also used in pdf metadata field)

    #+KEYWORDS: manual, examples

Export options

    # draft:t - display a block at the end of a line, which is too long (indication bad line break)
    # fontsize:"12pt" - set fontsize to 12pt (default: 11pt)
    #+OPTIONS: draft:t fontsize:"12pt"

Language (en default)

    #+LANGUAGE: en
    #+LANGUAGE: de

Description (also used in pdf metadata field: subject). Keyword can be
used multiple times to extend the description.

    #+DESCRIPTION: Multiline
    #+DESCRIPTION: description

Type of the document. (The abstract template uses or can reference to
the keyword variable &rsquo;document\_type&rsquo; via the macro &rsquo;title-name&rsquo;)

    #+DOCUMENT_TYPE: Seminararbeit

Overwrite references setup

    #+BIBLATEX: \usepackage[backend=biber,citestyle=alphabetic,bibstyle=authoryear,sorting=nyt,sortcase=false]{biblatex}\setlength{\bibhang}{0pt}\addbibresource{references.bib}

Additional peamble setup

    #+LATEX_HEADER_EXTRA: \usepackage{layout}


<a id="org38fc526"></a>

# Text


<a id="orgd7aec77"></a>

## Headline

    * 1st level heading
    ** this is 2nd level heading
    *** this is 3rd level heading

To have a headline in Org but not in an export set the header tag
`:ignore:`.

    * Header not listed in toc but its content                           :ignore:
    bla bla bla

To have a headline with its content in Org but not in an export set
the header tag `:noexport:`.

    * Section not exported                                             :noexport:
    bla bla bla, this will not be exported

To have a headline unnumbered in the table of contents set the header
property `:UNNUMBERED: t`.

    * Header listed unnumbered
    :PROPERTIES:
    :UNNUMBERED: t
    :END:
    bla bla bla

To have a headline in a LaTeX export started on a new page use the
header property `:CLEARPAGE: t`.

    * Section will start on a clear page (LaTeX)
    :PROPERTIES:
    :CLEARPAGE: t
    :END:
    bla bla bla


<a id="org45bd66e"></a>

## Formatting

    *bold*
    /italic/
    _underlined_
    =verbatim=
    ~code~
    +strike-through+
    X_{subscript}
    X^{superscript}


<a id="org4c59219"></a>

## Line break

    Hello, \\  (enforce line break within a paragraph)
    World.


<a id="orgc65280f"></a>

## Color

-   via link-decorator : [colored text in orange](#c09000)
-   via makro : <font color="#002659">colored text in darkblue</font>


<a id="orge4f0791"></a>

## Glyphs & More

-   in text
    -   `\LaTeX{}` LaTeX (do not miss the brackets to get an whitespace after)
    -   `\euro{}` €
    -   `\leftarrow` ←
    -   `\rightarrow` →
    -   `\uparrow` ↑
    -   `\downarrow` ↓
-   in math
    -   `\ho{}` (hochstellen) for math mode similar to `^{}` but sets roman font
    -   `\ti{}` (tiefstellen) for math mode similar to `_{}` but sets roman font
    -   `\rom{3}` iii
    -   `\Rom{3}` III


<a id="org2d382d6"></a>

## Makros

Active Org macros (`org-macro-templates`):

-   Org built-ins (see
    <https://www.gnu.org/software/emacs/manual/html_node/org/Macro-Replacement.html>)
    -   **`{{{title}}}`:** The title
    -   **`{{{author}}}`:** Max Muster Max Muster and Maxi Muster Max Muster, Maxi Muster
    -   **`{{{email}}}`:** max.muster@example.com
    -   **`{{{date}}}`:** May 16, 2022
    -   **`{{{time(FORMAT)}}}`:** Mar : format see function `format-time-string`
    -   **`{{{input-file}}}`:** my-org-article.org
    -   **`{{{modification-time(FORMAT[,VC])}}}`:** 2024-03-05 Tue 11:06:17 : vc is a toogle
        (nil,t) to retrieve the time from version control system
    -   **`{{{keyword(KEYWORD)}}}`:** The subtitle
    -   **`{{{property(PROPERTY-NAME[,LOCATION])}}}`:** optional location see function
        
        `org-link-search`
        (<https://www.gnu.org/software/emacs/manual/html_node/org/Search-Options.html>)
    -   **`{{{n}}}` `{{{n(COUNTER[,ACTION])}}}`:** 1 1
        1 5 6 1 : increment
        counter name, if optional action is &rsquo;-&rsquo; do not increment, if
        number set to number, if somthing else reset to 1
-   custom
    -   **`{{{textsc(text)}}}`:** <span style="font-variant-caps: small-caps;">Gauß</span>
    -   **`{{{color(hex,text)}}}`:** <font color="#884488">text</font>
    -   **`{{{kbd(text)}}}`:** <kbd>text</kbd>
    -   **`{{{highlight(text[,options])}}}`:** <mark style="">text highlighted in default color</mark>, <mark style="background-color:red;">text highlighted in red</mark>, <mark style="background-color:green;border:1px solid blue;">text highlighted in green and blue borders</mark>


<a id="orgd461620"></a>

# Links

    [[http://example.com/]]
    [[http://example.com/][description]]


<a id="orgd2864d8"></a>

# Rule

a horizontal rule, 5 or more only dashes

---


<a id="orge509350"></a>

# Blocks

Easy Templates (enter `<x[TAB]`)

-   s #+BEGIN\_SRC &#x2026; #+END\_SRC
-   e #+BEGIN\_EXAMPLE &#x2026; #+END\_EXAMPLE
-   q #+BEGIN\_QUOTE &#x2026; #+END\_QUOTE
-   v #+BEGIN\_VERSE &#x2026; #+END\_VERSE
-   c #+BEGIN\_CENTER &#x2026; #+END\_CENTER
-   l #+BEGIN\_EXPORT latex &#x2026; #+END\_EXPORT
-   L #+LATEX:
-   h #+BEGIN\_EXPORT html &#x2026; #+END\_EXPORT
-   H #+HTML:
-   a #+BEGIN\_EXPORT ascii &#x2026; #+END\_EXPORT
-   A #+ASCII:
-   I #+INCLUDE: file
-   I #+INCLUDE: interactive version


<a id="org7a757d0"></a>

## Lists

Org reference: <https://orgmode.org/manual/Plain-lists-in-LaTeX-export.html#Plain-lists-in-LaTeX-export>

Inline list:
Some ways to say &ldquo;Hello&rdquo;:

-   Hola
-   Bonjour
-   Guten Tag.

Unordered list

-   One
    -   Two
        -   Three
            -   Four
            -   Four 2
            -   Four 3

Ordered list

1.  One
2.  Two
    1.  Two one
    2.  Two two
        1.  Two two one
        2.  Two two two
            1.  Two two two one
20. Test
21. foo
22. baz

List with custom item spacing

-   One
-   Two
-   Three
-   Four
-   Five

Description list

-   **an item:** a description


<a id="org6a67108"></a>

## Tables, Figures, Listings

\#+CAPTION[Optional short version for the lot, lof, lol]: Caption of the table, figure or listing


<a id="org1aec460"></a>

## Tables

Default tables having a placement atrribute set to `[htbp]` (still
allows to find a sweet spot).  For a &rsquo;here in place&rsquo; placement use
`:placement [h]` (approximately at the same point) `:placement [H]`
(precisely at point, will deactivate settings from the `float` package,
similar to `[h!]`)

Org reference:
<https://www.gnu.org/software/emacs/manual/html_node/org/Tables-in-LaTeX-export.html>

Alignment using column type  `#+ATTR_LATEX: :align xxx`

-   built-in
    -   l: left-aligned cells
    -   c: center-aligned cells
    -   r: right-aligned cells
    -   p{width}: top-aligned cells with fixed width
    -   m{width}: middle-aligned cells with fixed width
    -   b{width}: bottom-aligned cells with fixed width
    -   >{declaration}: pre-column-declaration, used before lcrpmb
    -   <{declaration}: post-column-type declaration, user after lcrpmb
    -   @{text}: column containing the text in every cell of the column
-   custom
    -   L{width}: left-aligned cells with fixed width
    -   C{width}: center-aligned cells with fixed width
    -   R{width}: right-aligned cells with fixed width


<a id="orgb0eb069"></a>

### Alignment and Bookstab style

<table>
<caption class="t-above"><span class="table-number">Table 1:</span> Table using bookstab and align</caption>

<colgroup>
<col  class="org-left">

<col  class="org-left">

<col  class="org-left">
</colgroup>
<thead>
<tr>
<th scope="col" class="org-left">right</th>
<th scope="col" class="org-left">center</th>
<th scope="col" class="org-left">left</th>
</tr>
</thead>

<tbody>
<tr>
<td class="org-left">A1</td>
<td class="org-left">A2</td>
<td class="org-left">A2</td>
</tr>


<tr>
<td class="org-left">B1.1</td>
<td class="org-left">B2.1</td>
<td class="org-left">B3.1</td>
</tr>


<tr>
<td class="org-left">C1.1.1</td>
<td class="org-left">C2.1.1</td>
<td class="org-left">C3.1.1</td>
</tr>
</tbody>
</table>


<a id="org56a805e"></a>

### Alignment

<table>
<caption class="t-above"><span class="table-number">Table 2:</span> Table using align</caption>

<colgroup>
<col  class="org-left">

<col  class="org-left">

<col  class="org-left">
</colgroup>
<thead>
<tr>
<th scope="col" class="org-left">right</th>
<th scope="col" class="org-left">center</th>
<th scope="col" class="org-left">left</th>
</tr>
</thead>

<tbody>
<tr>
<td class="org-left">A1</td>
<td class="org-left">A2</td>
<td class="org-left">A3</td>
</tr>


<tr>
<td class="org-left">B1.1</td>
<td class="org-left">B2.1</td>
<td class="org-left">B3.1</td>
</tr>


<tr>
<td class="org-left">C1.1.1</td>
<td class="org-left">C2.1.1</td>
<td class="org-left">C3.1.1</td>
</tr>
</tbody>
</table>


<a id="org7d1ce47"></a>

### Fixed width / multi-line cells

Multi-line cells with fixed width cells using `pmbLCR`
and forced newline using `\newline`.

<table>
<caption class="t-above"><span class="table-number">Table 3:</span> Table using <code>#+ATTR_LATEX: :align rC{0.6\textwidth}l</code> and <code>\newline</code></caption>

<colgroup>
<col  class="org-left">

<col  class="org-left">

<col  class="org-left">
</colgroup>
<thead>
<tr>
<th scope="col" class="org-left">right</th>
<th scope="col" class="org-left">center</th>
<th scope="col" class="org-left">left</th>
</tr>
</thead>

<tbody>
<tr>
<td class="org-left">A1</td>
<td class="org-left">A2</td>
<td class="org-left">A3</td>
</tr>


<tr>
<td class="org-left">B1.1</td>
<td class="org-left">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\newline Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</td>
<td class="org-left">B3.1</td>
</tr>


<tr>
<td class="org-left">C1.1.1</td>
<td class="org-left">C2.1.1</td>
<td class="org-left">C3.1.1</td>
</tr>
</tbody>
</table>


<a id="org7196622"></a>

### Multi-page table / longtable

<table>
<caption class="t-above"><span class="table-number">Table 4:</span> Longtable</caption>

<colgroup>
<col  class="org-left">

<col  class="org-left">
</colgroup>
<tbody>
<tr>
<td class="org-left">&#x2026;</td>
<td class="org-left">&#x2026;</td>
</tr>


<tr>
<td class="org-left">&#x2026;</td>
<td class="org-left">3.456</td>
</tr>


<tr>
<td class="org-left">&#x2026;</td>
<td class="org-left">2,842</td>
</tr>
</tbody>
</table>


<a id="org15b4bfd"></a>

### Number alignment

Alignment of numbers (numprint) using column type n (numbers in math)
and N (numbers in text)

<table>
<caption class="t-above"><span class="table-number">Table 5:</span> Table using column type n and N</caption>

<colgroup>
<col  class="org-right">

<col  class="org-right">

<col  class="org-right">

<col  class="org-right">
</colgroup>
<thead>
<tr>
<th scope="col" class="org-right"><code>n{5}{3}</code></th>
<th scope="col" class="org-right"><code>n[3]{5}{3}</code></th>
<th scope="col" class="org-right"><code>n[3][1]{5}{3}</code></th>
<th scope="col" class="org-right"><code>N{5}{3}</code></th>
</tr>
</thead>

<tbody>
<tr>
<td class="org-right">123.45e12</td>
<td class="org-right">123.45e12</td>
<td class="org-right">123.45e12</td>
<td class="org-right">123.45e12</td>
</tr>


<tr>
<td class="org-right">12345.678e123</td>
<td class="org-right">12345.678e123</td>
<td class="org-right">12345.678e123</td>
<td class="org-right">12345.678e123</td>
</tr>


<tr>
<td class="org-right">123.45e12.3</td>
<td class="org-right">123.45e12.3</td>
<td class="org-right">123.45e12.3</td>
<td class="org-right">123.45e12.3</td>
</tr>


<tr>
<td class="org-right">12345.678e123.3</td>
<td class="org-right">12345.678e123.3</td>
<td class="org-right">12345.678e123.3</td>
<td class="org-right">12345.678e123.3</td>
</tr>
</tbody>
</table>


<a id="org04ba224"></a>

### Custom caption command for LaTeX

Set caption with \LaTeX{} command

<table>


<colgroup>
<col  class="org-left">

<col  class="org-left">
</colgroup>
<tbody>
<tr>
<td class="org-left">&#x2026;</td>
<td class="org-left">&#x2026;</td>
</tr>


<tr>
<td class="org-left">&#x2026;</td>
<td class="org-left">&#x2026;</td>
</tr>
</tbody>
</table>


<a id="org4cee948"></a>

### Overlay using tikz

<table>
<caption class="t-above"><span class="table-number">Table 6:</span> Table with tikz overlay</caption>

<colgroup>
<col  class="org-right">

<col  class="org-left">

<col  class="org-left">

<col  class="org-left">

<col  class="org-left">

<col  class="org-left">
</colgroup>
<thead>
<tr>
<th scope="col" class="org-right">&#xa0;</th>
<th scope="col" class="org-left">1, 2, 7</th>
<th scope="col" class="org-left">3</th>
<th scope="col" class="org-left">4, 6</th>
<th scope="col" class="org-left">5</th>
<th scope="col" class="org-left">&larr; Oberseite</th>
</tr>


<tr>
<th scope="col" class="org-right">Schicht</th>
<th scope="col" class="org-left">8, 13, 14</th>
<th scope="col" class="org-left">12</th>
<th scope="col" class="org-left">9, 11</th>
<th scope="col" class="org-left">10</th>
<th scope="col" class="org-left">&larr; Unterseite</th>
</tr>
</thead>

<tbody>
<tr>
<td class="org-right">1</td>
<td class="org-left">\tikzmark{LAa}Gelcoat</td>
<td class="org-left">\tikzmark{LAc}Gelcoat</td>
<td class="org-left">\tikzmark{LAe}Gelcoat</td>
<td class="org-left">\tikzmark{LAg}Gelcoat</td>
<td class="org-left">\tikzmark{LAi}Saertex(DB)</td>
</tr>


<tr>
<td class="org-right">2</td>
<td class="org-left">SNL(Triax)</td>
<td class="org-left">SNL(Triax)</td>
<td class="org-left">SNL(Triax)</td>
<td class="org-left">SNL(Triax)</td>
<td class="org-left">FOAM</td>
</tr>


<tr>
<td class="org-right">3</td>
<td class="org-left">SNL(Triax)</td>
<td class="org-left">SNL(Triax)</td>
<td class="org-left">SNL(Triax)</td>
<td class="org-left">SNL(Triax)</td>
<td class="org-left">\tikzmark{LAj}Saertex(DB)</td>
</tr>


<tr>
<td class="org-right">4</td>
<td class="org-left">\tikzmark{LAb}SNL(Triax)</td>
<td class="org-left">E-LT-5500(UD)</td>
<td class="org-left">FOAM</td>
<td class="org-left">Carbon(UD)</td>
<td class="org-left">&#xa0;</td>
</tr>


<tr>
<td class="org-right">5</td>
<td class="org-left">&#xa0;</td>
<td class="org-left">FOAM</td>
<td class="org-left">\tikzmark{LAf}SNL(Triax)</td>
<td class="org-left">\tikzmark{LAh}SNL(Triax)</td>
<td class="org-left">\(\uparrow\) Längsver-</td>
</tr>


<tr>
<td class="org-right">6</td>
<td class="org-left">&#xa0;</td>
<td class="org-left">\tikzmark{LAd}SNL(Triax)</td>
<td class="org-left">&#xa0;</td>
<td class="org-left">&#xa0;</td>
<td class="org-left">\phantom{\(\uparrow\)} steifungen</td>
</tr>
</tbody>
</table>

![img](./img/table-overlay-tikz.png)


<a id="org65c531b"></a>

### From Python src block output

<table>


<colgroup>
<col  class="org-left">

<col  class="org-right">
</colgroup>
<tbody>
<tr>
<td class="org-left">b</td>
<td class="org-right"><span class="underline">foo</span></td>
</tr>


<tr>
<td class="org-left">\(R^{2}\)</td>
<td class="org-right">1.363</td>
</tr>
</tbody>
</table>


<a id="orgc31a623"></a>

## Figures


<a id="orgc7b3cb4"></a>

### file svg

![img](img/emacs.svg "svg figure")

See figure <fig-svg-import> as a reference.


<a id="orgcff0d65"></a>

### file png

![img](img/emacs.png "png figure")


<a id="orgc7679b4"></a>

### latex using tikz with data file

file path to data file need to be an absolute path, bacause the
compilation is done in a tmp directory (`/tmp/babel-XXXXXX/`).

<figure id="org05aa364">

<figure id="org046d712">
<img src="img/figure-tikz.svg" alt="figure-tikz.svg" class="org-svg">

</figure>
</figure>


<a id="org652ad40"></a>

### python using matplotlib

SRC block header `:prologue (mpl-prologue)` for non-latex exports (.svg
exports) to loads my.mplstyle including kpfonts. Other style via
optional argument, e.g. `:prologue (mpl-prologue "my-tex")` rendering
via latex including kpfonts.

SRC block header `:var fname=(mpl-var "<file_name>")` to export figure
as .pgf for latex and .svg otherwise, like HTML.

1.  using my.mplstyle

    Python matplotlib figure using matplotlib `my`. The style `my` renders
    without LaTeX but using the kpfonts.
    
        import math as m
        import matplotlib as mpl
        
        n = 30
        t = [i/n*m.pi for i in range(n+1)]
        
        fig, ax = plt.subplots()
        [ax.plot(t, [m.sin(i+j/12*m.pi) for i in t], color=f'C{j}', label=f'$C_{j}$') for j in range(10)]
        ax.legend()
        ax.set_title(r'Functions: $\sin(x + \pi \, i/12)$')
        ax.set_xlabel(r'$x ~ \times \pi$')
        ax.set_ylabel('$y$')
        ax.set_xticks([0, m.pi/4, m.pi/2, m.pi*3/4, m.pi])
        ax.set_xticklabels([0.00, 0.25, 0.50, 0.75, 1.00])
        ax.xaxis.set_minor_locator(mpl.ticker.AutoMinorLocator(3))
        ax.grid()
        ax.grid(which='minor', linestyle=':')
        
        fig.savefig(fname)
        plt.close()
        print(fname, end='')

2.  using my-tex.mplstyle

    Python matplotlib figure using matplotlib `my-tex`. The style `my-tex`
    renders with LaTeX and uses the kpfonts.
    
        import math as m
        import matplotlib as mpl
        
        n = 30
        t = [i/n*m.pi for i in range(n+1)]
        
        fig, ax = plt.subplots()
        [ax.plot(t, [m.sin(i+j/12*m.pi) for i in t], color=f'C{j}', label=f'$C_{j}$') for j in range(10)]
        ax.legend()
        ax.set_title(r'Functions: $\sin(x + \pi \, i/12)$')
        ax.set_xlabel(r'$x ~ \times \pi$')
        ax.set_ylabel('$y$')
        ax.set_xticks([0, m.pi/4, m.pi/2, m.pi*3/4, m.pi])
        ax.set_xticklabels([0.00, 0.25, 0.50, 0.75, 1.00])
        ax.xaxis.set_minor_locator(mpl.ticker.AutoMinorLocator(3))
        ax.grid()
        ax.grid(which='minor', linestyle=':')
        
        fig.savefig(fname)
        plt.close()
        print(fname, end='')


<a id="org9912238"></a>

### dot graphviz

![img](img/figure-dot.png)


<a id="orgfefe34c"></a>

## Example / Verbatim

    verbatime example

or using `:` (start the example lines with a colon followed by a space.)

    a single line example
    can be indented


<a id="org3a33e67"></a>

## Source

    <body>

    string = 'hello' + ', world' + !*3  # comment
    print(string)


<a id="orgfdf528c"></a>

# Math


<a id="org87778fa"></a>

## Symbols and Functions


<a id="org898036b"></a>

### Quotation, Fraction

    - \[\underbracket[1pt][0pt]{bla}_\text{blo}\]
    - \[\Dfrac{3}{7}\]
    - \[\slfrac{3}{7}\]
    - \[\sfrac{3}{7}\]
    - \[\nicefrac{3}{7}\]
    - \[\faktor{3}{7}\]
    - \[\Faktor{3}{7}\]


<a id="orga1efd2d"></a>

### Units

    - \(\unit{123.45}{\milli\meter}\)


<a id="org5aff887"></a>

### Fields

    - \(\field{X}\) : field
    - \(\fA{}\) : Affine field
    - \(\fC\) : Complex field
    - \(\fFp\) : Finite field
    - \(\fFq\) : Finite field
    - \(\fGa\) : Group scheme
    - \(\fK\) : Generic field (Körper)
    - \(\fN\) : Natural numbers
    - \(\fPj\) : Projective field
    - \(\fR\) : Real numbers
    - \(\fQ\) : Rational numbers
    - \(\fI\) : Irrational numbers
    - \(\fZ\) : Integers
    - \(\Def\) : Domain of a function D (Definitionsbereich)
    - \(\LM\) : Solution set L (Lösungsmenge)


<a id="org4909920"></a>

### Functions

    - \(\sins\) : Short sin
    - \(\coss\) : Short cos


<a id="org42b3c8d"></a>

### Operators

    - \(\norm{x}\) : ||x||
    - \(\abs{x}\) : |x|
    - \(\innerProd{x}{y}\) : <x,y>
    - \(\Bild U\) : Map of a function (mapping, transformation)
    - \(\rank U\) : Rank of a matrix
    - \(\tr U\) : Matrix trace
    - \(\dev U\) : Matrix deviation
    - \(\var U\) : Variance
    - \(\grad U\) : Gradiant
    - \(\divergence U\) : Divergence div
    - \(\rot U\) : Rotation
    - \(\diag U\) : Diagonal matrix
    - \(\adj\) : Adjoint operator H
    - \(\adjugate U\) : Classical adjoint adj (adjugate)
    - \(()^\T\) : Transpose operator


<a id="org5c23188"></a>

### Others

    - \(\corresponds\) : equal sign with a hat
    - \(\dt{u}\) : dot above symbol (time derivative)
    - \(\ddt{u}\) : two dots above symbol (time derivative)
    - \(\Eval{a}{b}{c}\) : evaluation limits a|_b^c
    - \(\fdg\) : 'für die gilt' | (vertical bar)
    - \(\E\) : E
    - \(\qed\) : Q.E.D. quod erat demonstrandum "what was to be shown" -> "which was to be demonstrated"
    - \(\euler\) : Euler e
    - \(\deg\) : Degree °
    - \(\degC\) : °C
    - \(\TF\) : sign for transfomed values: low tilde
    - \(\dif\) : d


<a id="org1633eb6"></a>

### Tensor

    - \(\tensor{U}\) : general bold, no further decoration
    - \(\tensorI{U}\) : underline
    - \(\tensorII{U}\) : two underlines
    - \(\tensorIII{U}\) : tilde 3 below symbol
    - \(\tensorIV{U}\) : tilde 4 below symbol
    - \(\tensori{U}\) : harpoon right
    - \(\tensorii{U}\) : harpoon right and left
    - \(\tensoriii{U}\) : arrow right and harpoon left
    - \(\tensoriv{U}\) : arrow right and left


<a id="org0ff7fd8"></a>

## Equation

named equation:

\begin{equation}
\label{org823582d}
e^x = 4
\end{equation}

And refer to Eq. <eq-in-name> in document.


<a id="org4dfe99b"></a>

## Matrix

Create math matrix objects with org tables

<table>


<colgroup>
<col  class="org-left">

<col  class="org-left">
</colgroup>
<tbody>
<tr>
<td class="org-left">a</td>
<td class="org-left">b</td>
</tr>


<tr>
<td class="org-left">c</td>
<td class="org-left">d</td>
</tr>
</tbody>
</table>

<table>


<colgroup>
<col  class="org-right">

<col  class="org-right">
</colgroup>
<tbody>
<tr>
<td class="org-right">1</td>
<td class="org-right">2</td>
</tr>


<tr>
<td class="org-right">3</td>
<td class="org-right">4</td>
</tr>
</tbody>
</table>


<a id="org3d43a21"></a>

# Glossary and Acronym and References


<a id="org1c7eefb"></a>

## Glossary

See command `org-ref-glossary-gls-commands` and use
`org-ref-insert-glossary-link` to insert a link with completion (`C-c
C-l`).

Use a glossary entry using

-   only link location tree or shrub
-   link location and description shrub, the description is only visible in Org
-   not recommended latex command \gls{tree}

<table>
<caption class="t-above"><span class="table-number">Table 7:</span> Glossary types</caption>

<colgroup>
<col  class="org-left">

<col  class="org-left">
</colgroup>
<tbody>
<tr>
<td class="org-left"><code>gls</code></td>
<td class="org-left">The term associated with the label</td>
</tr>


<tr>
<td class="org-left"><code>glspl</code></td>
<td class="org-left">The plural term</td>
</tr>


<tr>
<td class="org-left"><code>Gls</code></td>
<td class="org-left">The capitalized term</td>
</tr>


<tr>
<td class="org-left"><code>Glspl</code></td>
<td class="org-left">The plural capitalized term</td>
</tr>


<tr>
<td class="org-left"><code>glssymbol</code></td>
<td class="org-left">The symbol defined (only with latex definition)</td>
</tr>


<tr>
<td class="org-left"><code>Glssymbol</code></td>
<td class="org-left">The capitalized symbol defined (only with latex definition)</td>
</tr>


<tr>
<td class="org-left"><code>glsdesc</code></td>
<td class="org-left">The description associated with the label</td>
</tr>


<tr>
<td class="org-left"><code>Glsdesc</code></td>
<td class="org-left">The capitalized description associated with the label</td>
</tr>
</tbody>
</table>


<a id="orgb013133"></a>

## Acronym

See command `org-ref-acronym-types` and use `org-ref-insert-acronym-link`
to insert a link with completion (`C-c C-l`).

Use a acronyms entry using

-   only link location BB
-   link location and description BB QOS

<table>
<caption class="t-above"><span class="table-number">Table 8:</span> Acronym types</caption>

<colgroup>
<col  class="org-left">

<col  class="org-left">
</colgroup>
<tbody>
<tr>
<td class="org-left"><code>acrshort</code></td>
<td class="org-left">The acronym for label</td>
</tr>


<tr>
<td class="org-left"><code>acrshortpl</code></td>
<td class="org-left">The acronym for label in plural</td>
</tr>


<tr>
<td class="org-left"><code>Acrshort</code></td>
<td class="org-left">Capitalized acronym</td>
</tr>


<tr>
<td class="org-left"><code>Acrshortpl</code></td>
<td class="org-left">Plural capitalized acronym</td>
</tr>


<tr>
<td class="org-left"><code>ACRshort</code></td>
<td class="org-left">ALL-CAPS acronym</td>
</tr>


<tr>
<td class="org-left"><code>ACRshortpl</code></td>
<td class="org-left">ALL-CAPS plural acronym</td>
</tr>


<tr>
<td class="org-left"><code>acrlong</code></td>
<td class="org-left">The label definition</td>
</tr>


<tr>
<td class="org-left"><code>acrlongpl</code></td>
<td class="org-left">The plural definition</td>
</tr>


<tr>
<td class="org-left"><code>Acrlong</code></td>
<td class="org-left">Capitalized definition</td>
</tr>


<tr>
<td class="org-left"><code>Acrlongpl</code></td>
<td class="org-left">Plural capitalized definition</td>
</tr>


<tr>
<td class="org-left"><code>ACRlong</code></td>
<td class="org-left">ALL-CAPS definition</td>
</tr>


<tr>
<td class="org-left"><code>ACRlongpl</code></td>
<td class="org-left">plural ALL-CAPS definition</td>
</tr>


<tr>
<td class="org-left"><code>acrfull</code></td>
<td class="org-left">Both the acronym and its definition</td>
</tr>


<tr>
<td class="org-left"><code>acrfullpl</code></td>
<td class="org-left">Both the acronym and its definition in plural</td>
</tr>


<tr>
<td class="org-left"><code>Acrfull</code></td>
<td class="org-left">Capitalized both the acronym and its definition</td>
</tr>


<tr>
<td class="org-left"><code>Acrfullpl</code></td>
<td class="org-left">Capitalized both the acronym and its definition in plural</td>
</tr>


<tr>
<td class="org-left"><code>ACRfull</code></td>
<td class="org-left">Both the acronym and its definition in ALL-CAPS</td>
</tr>


<tr>
<td class="org-left"><code>ACRfullpl</code></td>
<td class="org-left">Both the acronym and its definition in plurall ALL-CAPS</td>
</tr>
</tbody>
</table>


<a id="org49df23a"></a>

## References

check regarding the style defined in the preamble

    biber --validate-datamodel <texfilebasename>

this only checks the bib with default style

    biber --tool --validate-datamodel <filename>.bib

Insert cite entry with (`C-c C-l`).

<table>
<caption class="t-above"><span class="table-number">Table 9:</span> <code>org-ref-biblatex-types</code></caption>

<colgroup>
<col  class="org-left">

<col  class="org-left">
</colgroup>
<tbody>
<tr>
<td class="org-left">Cite</td>
<td class="org-left">basic citation with capitalization</td>
</tr>


<tr>
<td class="org-left">parencite</td>
<td class="org-left">similar to cite with parentheses</td>
</tr>


<tr>
<td class="org-left">Parencite</td>
<td class="org-left">similar to cite with parentheses and capitalization</td>
</tr>


<tr>
<td class="org-left">footcite</td>
<td class="org-left">Put the citation in a footnote</td>
</tr>


<tr>
<td class="org-left">footcitetext</td>
<td class="org-left">Put the citation in a footnote using <code>\footnotetext</code></td>
</tr>


<tr>
<td class="org-left">textcite</td>
<td class="org-left">print the authors or editors as a subject of the sentence</td>
</tr>


<tr>
<td class="org-left">Textcite</td>
<td class="org-left">print the authors or editors as a subject of the sentence with capitalization</td>
</tr>


<tr>
<td class="org-left">smartcite</td>
<td class="org-left">like parencite in a footnote, and footcite in the body</td>
</tr>


<tr>
<td class="org-left">Smartcite</td>
<td class="org-left">like parencite in a footnote, and footcite in the body with capitalization</td>
</tr>


<tr>
<td class="org-left">cite</td>
<td class="org-left">&ldquo;similar to cite, but prints the year or title</td>
</tr>


<tr>
<td class="org-left">parencite</td>
<td class="org-left">&ldquo;similar to parencite, but prints the year or title</td>
</tr>


<tr>
<td class="org-left">supercite</td>
<td class="org-left">superscripted numeric citation (only in numberic styles)</td>
</tr>


<tr>
<td class="org-left">autocite</td>
<td class="org-left">handles some punctuation nuances</td>
</tr>


<tr>
<td class="org-left">Autocite</td>
<td class="org-left">handles some punctuation nuances with punctuation</td>
</tr>


<tr>
<td class="org-left">autocite</td>
<td class="org-left">&ldquo;same as autocite but * is passed to the backend</td>
</tr>


<tr>
<td class="org-left">Autocite</td>
<td class="org-left">&ldquo;same as Autocite but * is passed to the backend</td>
</tr>


<tr>
<td class="org-left">citetitle</td>
<td class="org-left">the shorttitle or title field</td>
</tr>


<tr>
<td class="org-left">citetitle</td>
<td class="org-left">&ldquo;the full title</td>
</tr>


<tr>
<td class="org-left">citeyear</td>
<td class="org-left">the year field</td>
</tr>


<tr>
<td class="org-left">citeyear</td>
<td class="org-left">&ldquo;the year field and extradate information if available</td>
</tr>


<tr>
<td class="org-left">citedate</td>
<td class="org-left">the full date or year</td>
</tr>


<tr>
<td class="org-left">citedate</td>
<td class="org-left">&ldquo;the full date or year, including extradate information if available</td>
</tr>


<tr>
<td class="org-left">citeurl</td>
<td class="org-left">the url field</td>
</tr>


<tr>
<td class="org-left">fullcite</td>
<td class="org-left">create a full citation similar to what is in the bibliography</td>
</tr>


<tr>
<td class="org-left">footfullcite</td>
<td class="org-left">create a full citation as a footnote</td>
</tr>


<tr>
<td class="org-left">notecite</td>
<td class="org-left">print prenote and postnote, but no citation</td>
</tr>


<tr>
<td class="org-left">Notecite</td>
<td class="org-left">print prenote and postnote, but no citation with capitalization</td>
</tr>


<tr>
<td class="org-left">pnotecite</td>
<td class="org-left">similar to notecite with parentheses</td>
</tr>


<tr>
<td class="org-left">Pnotecite</td>
<td class="org-left">similar to Notecite with parentheses</td>
</tr>


<tr>
<td class="org-left">fnotecite</td>
<td class="org-left">similar to notecite in a footnote</td>
</tr>
</tbody>
</table>

<table>
<caption class="t-above"><span class="table-number">Table 10:</span> <code>org-ref-biblatex-multitypes</code></caption>

<colgroup>
<col  class="org-left">

<col  class="org-left">
</colgroup>
<tbody>
<tr>
<td class="org-left">cites</td>
<td class="org-left">multicite version of cite</td>
</tr>


<tr>
<td class="org-left">Cites</td>
<td class="org-left">multicite version of Cite</td>
</tr>


<tr>
<td class="org-left">parencites</td>
<td class="org-left">multicite version of parencite</td>
</tr>


<tr>
<td class="org-left">Parencites</td>
<td class="org-left">multicite version of Parencite</td>
</tr>


<tr>
<td class="org-left">footcites</td>
<td class="org-left">multicite version of footcite</td>
</tr>


<tr>
<td class="org-left">footcitetexts</td>
<td class="org-left">multicite version of footcitetext</td>
</tr>


<tr>
<td class="org-left">smartcites</td>
<td class="org-left">multicite version of smartcite</td>
</tr>


<tr>
<td class="org-left">Smartcites</td>
<td class="org-left">multicite version of Smartcite</td>
</tr>


<tr>
<td class="org-left">textcites</td>
<td class="org-left">multicite version of textcite</td>
</tr>


<tr>
<td class="org-left">Textcites</td>
<td class="org-left">multicite version of Textcite</td>
</tr>


<tr>
<td class="org-left">supercites</td>
<td class="org-left">multicite version of supercite</td>
</tr>


<tr>
<td class="org-left">autocites</td>
<td class="org-left">multicite version of autocite</td>
</tr>


<tr>
<td class="org-left">Autocites</td>
<td class="org-left">multicite version of Autocite</td>
</tr>
</tbody>
</table>

Example: See reference \cite{manual} (will be [1]) or \cite{article,book} (will be [2,3]) and \cite{article,book,manual} (will
be [1-3]).


<a id="orgf649abc"></a>

# LaTeX

Current setup uses the lualatex compiler.

packages

-   general
    -   fontenc
    -   hyperref
    -   kpfonts
    -   luainputenc
    -   xurl
-   text and glyphs
    -   eurosym
    -   menukeys
    -   xcolor
-   math
    -   faktor
    -   madthds
    -   mathtools
    -   MnSymbol
    -   nicefrac
    -   SIunits
    -   xfrac
-   lists
    -   enumitem
-   tables, figures and listings
    -   float
    -   caption
-   tables
    -   booktabs
    -   longtable
    -   numprint
    -   array
-   figures
    -   svg
    -   tikz
    -   gnuplot-lua-tikz
    -   pgfplots
-   listings
    -   listingsutf8
-   glossaries
-   pdf
    -   pdfpages
    -   pdflscape


<a id="org7f3208b"></a>

# Examples


<a id="org4b4a7d1"></a>

## Org table to data file

<table id="org8392bb3">


<colgroup>
<col  class="org-right">

<col  class="org-right">

<col  class="org-right">
</colgroup>
<tbody>
<tr>
<td class="org-right">0</td>
<td class="org-right">1</td>
<td class="org-right">1</td>
</tr>


<tr>
<td class="org-right">1</td>
<td class="org-right">2</td>
<td class="org-right">4</td>
</tr>


<tr>
<td class="org-right">2</td>
<td class="org-right">3</td>
<td class="org-right">5</td>
</tr>


<tr>
<td class="org-right">3</td>
<td class="org-right">4</td>
<td class="org-right">9</td>
</tr>
</tbody>
</table>

    with open("data.dat", "w") as f:
      f.write("\n".join([" ".join(list(map(str, i))) for i in data]))


<a id="org88bd729"></a>

## Data file to Org table

    with open("data.dat", "r") as f:
      data = f.read()
    return data

<table>


<colgroup>
<col  class="org-right">

<col  class="org-right">

<col  class="org-right">
</colgroup>
<tbody>
<tr>
<td class="org-right">0</td>
<td class="org-right">1</td>
<td class="org-right">1</td>
</tr>


<tr>
<td class="org-right">1</td>
<td class="org-right">2</td>
<td class="org-right">4</td>
</tr>


<tr>
<td class="org-right">2</td>
<td class="org-right">3</td>
<td class="org-right">5</td>
</tr>


<tr>
<td class="org-right">3</td>
<td class="org-right">4</td>
<td class="org-right">9</td>
</tr>
</tbody>
</table>

