# 📚 Documentation

### `ttuile`

Entry point of the package. Should be called at the beginning of your document, as described in [README.md > Usage](https://github.com/vitto4/ttuile/blob/main/README.md#-usage). You'll also find a table listing the arguments there.

### `annexe`

"Annexe" is the french word for "appendix".

Function used to create an `annexe` object, for future use with function `afficher-annexes` (see [afficher-annexe](#afficher-annexes)).

| Argument | Default value | Type | Description |
|:--------:|:-------------:|:----:|:------------|
| `titre` | `none` | `content?` | Title of your appendix. |
| `reference` | `none` | `label` | Label that you'll be using in the body to refer to this appendix. |

A single positional argument is accepted, being the appendix's body.


**Example :**

```typ
#let Appendix-1 = annexe(
  titre: [Title of the appendix],
  reference: <label-to-use>,
)[
  Body of the appendix, just write as usual.
]
```

The `reference` (label) can then be used in the body of the report : `@label-to-use`.

**Note :**
- Because the titles of the appendices are really just custom-styled level 1 headings, it is, as of now, not possible to make and use a `= Level 1 heading` inside an appendix. Level 2 and lower work just fine though.

### `afficher-annexes`

This translates to "display-appendices" and accepts an array of `dictionary` generated by `annexe` (see [annexe](#annexe)).
It will take care of actually displaying the appendices.

| Argument | Default value | Type | Description |
|:--------:|:-------------:|:----:|:------------|
| `annexes` | `none` | `array<dictionary>` | An array of dictionaries generated with the function `annexe`. |
| `table` | `true` | `bool` | If set to `true`, a table of appendices will be displayed. |
| `saut-page-apres-table` | `false` | `bool` | Translates to "page-break-after-table". |

**Example :**

```typ
#afficher-annexes(
  annexes: (Appendix-1, Appendix-2,),
  table: true,
  saut-page-apres-table: false,
)
```

### `equation-anonyme`

Means "anonymous-equation". Simple shortcut for

```typ
math.equation(
  block: true,
  numbering: none,
  ...
)
```

Use it when you don't want your equation to be labelled.

**Example :**

```typ
#equation-anonyme(
  $
  "An equation"
  $
)
```

### `figure-emboitee`

French for "boxed-figure". Makes sure the caption's width doesn't exceed that of the figure.

```typ
figure-emboitee(
  figure(
    image("img.png"),
    caption: [A figure.]
  )
  reference: <label-to-use>,
)
```