# Formatting

Zensical provides support for several HTML elements that can be used to highlight sections of a document or apply specific formatting.

## Configuration

This configuration enables support for keyboard keys, defining sub- and superscript and highlighting text. Add the following lines to your configuration:

```toml
[project.markdown_extensions]
pymdownx.caret = {}
pymdownx.keys = {}
pymdownx.mark = {}
pymdownx.tilde = {}
```

```yaml
markdown_extensions:
  - pymdownx.caret
  - pymdownx.keys
  - pymdownx.mark
  - pymdownx.tilde
```

See additional configuration options:

- [Caret, Mark &amp; Tilde](<https://zensical.org/docs/compatibility/markdown/python-markdown-extensions/#caret-mark-tilde>)
- [Keys](<https://zensical.org/docs/compatibility/markdown/python-markdown-extensions/#keys>)

## Usage

### Highlight text

When [Caret, Mark &amp; Tilde](<https://zensical.org/docs/compatibility/markdown/python-markdown-extensions/#caret-mark-tilde>) are enabled, text can be highlighted with a simple syntax, which is more convenient that directly using the corresponding [`mark`](<https://developer.mozilla.org/en-US/docs/Web/HTML/Element/mark>), [`ins`](<https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ins>) and [`del`](<https://developer.mozilla.org/en-US/docs/Web/HTML/Element/del>) HTML tags:

Text with highlighting

```text
- ==This was marked (highlight)==
- ^^This was inserted (underline)^^
- ~~This was deleted (strikethrough)~~
```

- <mark>This was marked (highlight)</mark>
- This was inserted (underline)
- ~~This was deleted (strikethrough)~~

### Sub- and superscripts

When [Caret &amp; Tilde](<https://zensical.org/docs/compatibility/markdown/python-markdown-extensions/#caret-mark-tilde>) are enabled, text can be sub- and superscripted with a simple syntax, which is more convenient than directly using the corresponding [`sub`](<https://developer.mozilla.org/en-US/docs/Web/HTML/Element/sub>) and [`sup`](<https://developer.mozilla.org/en-US/docs/Web/HTML/Element/sup>) HTML tags:

Text with sub- and superscripts

```markdown
- H~2~O
- A^T^A
```

- H<sub>2</sub>O
- A<sup>T</sup>A

### Add keyboard keys

When [Keys](<https://zensical.org/docs/compatibility/markdown/python-markdown-extensions/#keys>) is enabled, keyboard keys can be rendered with a simple syntax. Consult the [Python Markdown Extensions](<https://facelessuser.github.io/pymdown-extensions/extensions/keys/#extendingmodifying-key-map-index>) documentation to learn about all available shortcodes:

Keyboard keys

```markdown
++ctrl+alt+del++
```

<kbd class="key-control">Ctrl</kbd>\+<kbd class="key-alt">Alt</kbd>\+<kbd class="key-delete">Del</kbd>

---
