npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

reoff-unified-latex

v0.3.0

Published

Plugin for `reoff` that takes an `ooxast` tree and turns it into a `unified-latex` tree, allowing for .docx to .tex conversion

Downloads

16

Readme

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

reoff-unified-latex

npm version npm downloads

Plugin for reoff that takes an ooxast tree and turns it into a unified-latex tree, allowing for .docx to .tex conversion

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 reoff-unified-latex
# or with yarn
# yarn add reoff-unified-latex
# or with npm
# npm install reoff-unified-latex

Use

API


default()

Plugin to bridge or mutate to unified-latex

If a destination is given, runs the destination with the new jast tree (bridge-mode). Without destination, returns the jast tree: further plugins run on that tree (mutate-mode).

This is done so that you can use this plugin as either the plugin before the stringify plugin, or the plugin before another mutate plugin

Signature

default(this: Processor<void, Root, void, void>, ...settings: [Processor, Options?]): void | Transformer<Root, Root>;

Parameters

| Name | Type | | :------ | :------ | | this | Processor<void, Root, void, void> | | ...settings | [Processor, Options?] |

Returns

void | Transformer<Root, Root>

Defined in: node_modules/.pnpm/[email protected]/node_modules/unified/index.d.ts:531

Plugin to bridge or mutate to unified-latex

If a destination is given, runs the destination with the new jast tree (bridge-mode). Without destination, returns the jast tree: further plugins run on that tree (mutate-mode).

This is done so that you can use this plugin as either the plugin before the stringify plugin, or the plugin before another mutate plugin

Signature

default(this: Processor<void, Root, void, void>, ...settings: [Options?] | void[]): void | Transformer<Root, Root>;

Parameters

| Name | Type | | :------ | :------ | | this | Processor<void, Root, void, void> | | ...settings | [Options?] | void[] |

Returns

void | Transformer<Root, Root>

Defined in: node_modules/.pnpm/[email protected]/node_modules/unified/index.d.ts:531


Options

Properties

bibliography?

string | Data[]

A bibliography you can add manually

Needs to be in CSL format, which will be converted to BibTeX, or in BibTeX format

Defined in: libs/ooxast/ooxast-util-to-unified-latex/src/lib/types.ts:146

bibname?

string

Name of the bibliography file

Default

'bibliography.bib'

Defined in: libs/ooxast/ooxast-util-to-unified-latex/src/lib/types.ts:47

citationType?

"endnote" | "mendeley" | "word" | "citavi" | "zotero"

What type of citation is used?

Default

'zotero'

Defined in: libs/ooxast/ooxast-util-to-unified-latex/src/lib/types.ts:70

collectCitation?

Function

Type declaration

Signature`

(citation: any, index: string | number): any;

Parameters`

| Name | Type | | :------ | :------ | | citation | any | | index | string | number |

Returns`

any

Defined in: libs/ooxast/ooxast-util-to-unified-latex/src/lib/types.ts:72

columnSeparator?

boolean

Should a column separator be added to tables? i.e. should | be added to the beginning and end of each row?

Default

false

Defined in: libs/ooxast/ooxast-util-to-unified-latex/src/lib/types.ts:52

defaultCol?

string

What column should be used as the default column?

e.g l for left, r for right, c for center

Default

'l'

Defined in: libs/ooxast/ooxast-util-to-unified-latex/src/lib/types.ts:127

displayMath?

"align" | "equation" | "equation*" | "align*" | "$$" | "[]"

What type of display math should be used?

-$$: $$ ... $$

-[]: [ ... \]

-equation | equation* | align | align*: \begin{...} ... \end{...}

Default

'equation'

Defined in: libs/ooxast/ooxast-util-to-unified-latex/src/lib/types.ts:86

document?

boolean

Defined in: libs/ooxast/ooxast-util-to-unified-latex/src/lib/types.ts:27

documentClass?

object

{
    name: string;
    options?: string[];
}

Options for the document class

Default
Type declaration

| Member | Type | Description | | :------ | :------ | :------ | | name | string | Name of the document class Default 'article' | | options? | string[] | Options for the document class Default undefined |

Defined in: libs/ooxast/ooxast-util-to-unified-latex/src/lib/types.ts:56

handlers?

object

Handlers for specific node types

Index signature
Type declaration

Defined in: libs/ooxast/ooxast-util-to-unified-latex/src/lib/types.ts:26

inlineMath?

"$" | "()"

What type of inline math should be used? -$: $ ... $ -() : \(...\)

Default

'$'

Defined in: libs/ooxast/ooxast-util-to-unified-latex/src/lib/types.ts:102

italics?

"emph" | "textit"

Should italics be rendered as \textit or \emph?

Default

'emph'

Defined in: libs/ooxast/ooxast-util-to-unified-latex/src/lib/types.ts:43

newLines?

boolean

Defined in: libs/ooxast/ooxast-util-to-unified-latex/src/lib/types.ts:28

packages?

(string | { name: string; options: string[]; })[]

A list of packages to add to the preamble

by default, the following packages are added:

  • xcolor (if xcolor is enabled)
  • hyperref
  • graphicx
  • caption
  • tabularx (if tabularx is enabled)

Defined in: libs/ooxast/ooxast-util-to-unified-latex/src/lib/types.ts:158

parseCitation?

Function

Type declaration

Signature`

(citation: any): any;

Parameters`

| Name | Type | | :------ | :------ | | citation | any |

Returns`

any

Defined in: libs/ooxast/ooxast-util-to-unified-latex/src/lib/types.ts:71

preamble?

string | Node[]

A list of commands and other stuff to add to the preamble

You are responsible for making sure that the commands are valid LaTeX and that they can be used in the preamble.

You need to directly use the unified-latex types here, or you can just put it in raw

Default

'\title{}'

Example
import { m, args } from '@unified-latex/unified-latex-types'

const options = {
 preamble: [
  // \author{Leeroy Jenkins}
  m('author', 'Leeroy Jenkins'),
  // \title{The Adventures of Leeroy Jenkins}
  m('title', 'The Adventures of Leeroy Jenkins'),
  // \somemacrowithoptions[optional1][optional2]{firstArg}{secondArg}
  m(
     'somemacrowithoptions',
     args(
        ['optional1', 'optional2', 'firstArg', 'secondArg'],
       { braces: '[][]{}{}'}
      )
   ),
  ]
}

Defined in: libs/ooxast/ooxast-util-to-unified-latex/src/lib/types.ts:192

quotes?

string[]

Defined in: libs/ooxast/ooxast-util-to-unified-latex/src/lib/types.ts:29

relations?

object

Index signature
Type declaration

Defined in: libs/ooxast/ooxast-util-to-unified-latex/src/lib/types.ts:74

strikethrough?

"st" | "sout" | "s"

Defined in: libs/ooxast/ooxast-util-to-unified-latex/src/lib/types.ts:103

tabularx?

boolean | { width?: string; }

Should tabularx be used instead of tabular?

Default

false

Defined in: libs/ooxast/ooxast-util-to-unified-latex/src/lib/types.ts:132

title?

string

The title of the document

If this is not set, the title will be taken from the heading with the "Title" style.

Default

undefined

Defined in: libs/ooxast/ooxast-util-to-unified-latex/src/lib/types.ts:119

topSection?

number

What the top section should be -1 = part 0 = chapter 1 = section 2 = subsection 3 = subsubsection 4 = paragraph 5 = subparagraph

Defined in: libs/ooxast/ooxast-util-to-unified-latex/src/lib/types.ts:39

xcolor?

boolean

Are you using xcolor?

Disabling this will remove the xcolor package from the preamble and remove color related commands from the output.

Default

true

Defined in: libs/ooxast/ooxast-util-to-unified-latex/src/lib/types.ts:111

Syntax tree

Types

Compatibility

Security

Related

Contribute

License

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