Skip to content

Latest commit

 

History

History
executable file
·
556 lines (315 loc) · 12.8 KB

File metadata and controls

executable file
·
556 lines (315 loc) · 12.8 KB

Note This repository is automatically generated from the main parser monorepo. Please submit any issues or pull requests there.

texast-util-to-latex

Convert a texast syntax tree to LaTeX.

Contents

What is this?

When should I use this?

Install

This package is ESM only. In Node.js (version 12.20+, 14.14+, 16.0+, 18.0+), install as

pnpm add texast-util-to-latex
# or with yarn
# yarn add texast-util-to-latex
# or with npm
# npm install texast-util-to-latex

Use

API


default()

Signature

default(node: Node, options: Options = {}): string;

Parameters

Name Type
node Node
options Options

Returns

string

Defined in: lib/texast-util-to-latex.ts:35


toLatex()

Signature

toLatex(node: Node | Node[], options: Options = {}): string;

Parameters

Name Type
node Node
options Options

Returns

string

Defined in: lib/texast-util-to-latex.ts:28


Context

Properties

align

boolean

Defined in: lib/types.ts:30

enter

Enter

Defined in: lib/types.ts:23

handle

Handle

Defined in: lib/types.ts:27

handlers

Handlers

Defined in: lib/types.ts:28

indexStack

number[]

Defined in: lib/types.ts:22

join

Join[]

Defined in: lib/types.ts:26

math

boolean

Defined in: lib/types.ts:29

options

Options

Defined in: lib/types.ts:24

stack

string[]

Defined in: lib/types.ts:21

unsafe

Unsafe[]

Defined in: lib/types.ts:25


Options

Properties

displayMathDelimiters?

"$$" | "[]"

Defined in: lib/types.ts:71

emph?

"textit" | "emph"

Defined in: lib/types.ts:69

extensions?

Options[]

Defined in: lib/types.ts:73

handlers?

Handlers

Defined in: lib/types.ts:72

inlineMathDelimiters?

"$" | "()"

Defined in: lib/types.ts:70

join?

Join[]

Defined in: lib/types.ts:74

parbreak?

"par" | "newline"

Defined in: lib/types.ts:68

unsafe?

Unsafe[]

Defined in: lib/types.ts:75

wrapDocument?

boolean

Defined in: lib/types.ts:67


SafeFields

Properties

after

string

Defined in: lib/types.ts:13

before

string

Defined in: lib/types.ts:12


TrackFields

Properties

lineShift

number

Defined in: lib/types.ts:8

now

Point

Defined in: lib/types.ts:7


Unsafe

Properties

\_compiled?

RegExp

Defined in: lib/types.ts:64

after?

string

Defined in: lib/types.ts:61

atBreak?

boolean

Defined in: lib/types.ts:63

before?

string

Defined in: lib/types.ts:62

character

string

Defined in: lib/types.ts:58

inConstruct?

string | string[]

Defined in: lib/types.ts:59

notInConstruct?

string | string[]

Defined in: lib/types.ts:60


BasicContext

object

{
    align: boolean;
    math: boolean;
    options: Options;
}

Type declaration

Member Type
align boolean
math boolean
options Options

Defined in: lib/types.ts:33


BasicHandle

Function

Type declaration

Signature
(node: any, options?: Options): string;
Parameters
Name Type
node any
options? Options
Returns

string

Defined in: lib/types.ts:39


Enter

Function

Type declaration

Signature
(type: string): Exit;
Parameters
Name Type
type string
Returns

Exit

Defined in: lib/types.ts:18


Exit

Function

Type declaration

Signature
(): void;
Returns

void

Defined in: lib/types.ts:19


Handle

Function

Type declaration

Signature
(
  node: any, 
  parent: Parent | null | undefined, 
  context: Context, 
  safeOptions: SafeOptions): string;
Parameters
Name Type
node any
parent Parent
context Context
safeOptions SafeOptions
Returns

string

Defined in: lib/types.ts:41


Handlers

Record<string, Handle>

Defined in: lib/types.ts:48


Join

Function

Type declaration

Signature
(
  left: Node, 
  right: Node, 
  parent: Parent, 
  context: Context): boolean | null | void | number;
Parameters
Name Type
left Node
right Node
parent Parent
context Context
Returns

boolean | null | void | number

Defined in: lib/types.ts:50


Node

Root | Content

Defined in: lib/types.ts:3


Parent

Extract<Node, UnistParent>

Defined in: lib/types.ts:4


SafeOptions

TrackFields | SafeFields

Defined in: lib/types.ts:16

Syntax tree

Types

Compatibility

Security

Related

Contribute

License

GPL-3.0-or-later © Thomas F. K. Jorna