<!-- DO NOT MODIFY -->
<!-- This file was autogenerated by build-docs.ts -->
<!-- Edit the docstring in index.ts and regenerate -->
<!-- rather than editing this file directly. -->
# unified-latex-util-ligatures

## What is this?

Functions to find and replace ligatures in a `unified-latex` Abstract Syntax Tree (AST) with their Unicode equivalents.

## When should I use this?

If you are converting LaTeX to plain text or HTML.

## Install

```bash
npm install @unified-latex/unified-latex-util-ligatures
```

This package contains both esm and commonjs exports. To explicitly access the esm export,
import the `.js` file. To explicitly access the commonjs export, import the `.cjs` file.

# Functions

## `createMatchers()`



```typescript
function createMatchers(): { isMacro: (node: any) => node is Ast.Macro; isWhitespace: (node: any) => node is Ast.Whitespace; isRecognized: (nodes: Ast.Node[], whitespaceAllowed?: boolean) => Ast.String; isSplitable: (node: Ast.Node) => boolean; split: (node: Ast.String) => { ...; }[]; }
```

## `expandUnicodeLigatures(tree)`

Turn all ligatures into their unicode equivalent. For example,
`---` -> an em-dash and `\^o` to `ô`. This only applies in non-math mode,
since programs like katex will process math ligatures.

```typescript
function expandUnicodeLigatures(tree: Ast.Ast): void;
```

**Parameters**

| Param | Type      |
| :---- | :-------- |
| tree  | `Ast.Ast` |

## `parseLigatures(ast)`

Parse for recognized ligatures like `---` and `\:o`, etc. These are
replaced with string nodes with the appropriate unicode character subbed in.

```typescript
function parseLigatures(ast: Ast.Node[]): Ast.Node[];
```

**Parameters**

| Param | Type         |
| :---- | :----------- |
| ast   | `Ast.Node[]` |
