Giter Club home page Giter Club logo

pulldown-latex's Introduction

pulldown-latex

A pull parser for $\LaTeX$ parsing and mathml rendering.

This project is inspired Katex, Temml, MathJax, etc. It is in its very early stages of development, and works for a small subset of what Katex and the likes support. It is not production ready and is mostly untested.

Goals

Follow modern LaTeX principles: Ideally, this library should be mostly compatible with latex2e and amsmath. The term mostly is used here to refer to the mathematical commands exposed by these packages; typesetting prose is out of scope for this crate. Another consequence of this goal is that some plain-TeX commands that are deprecated (e.g., \atop, \over, etc.) are not supported by this crate.

Closely resembling conventional LaTeX: It is a goal for this crate to make efforts in generating aesthetic equations. This means that the mathml output may be tweaked to make it resemble what pdflatex, Katex or MathJax outputs.

Miscellaneous References & Tools

Sources used during the development of this crate. Any reference in code comments refer to these links specifically.

To Test

  • All the things temml and katex test
  • Cargo Mutants
  • Errors

Unsupported Plain-TeX & LaTeX behavior

  • Changing catcodes of characters
  • \if* macros
  • ^^_ & ^^[0-9a-f][0-9a-f] as a way of specifying characters
  • Redefining active characters This library currently only supports default active characters, and hence does not allow for the definition of active characters.
  • Implicit characters as whitespace tokens As in the TeXbook p. 265, Knuth specifies that a space token stands for an explicit or implicit space. This library does not currently support implicit space tokens when a space token is required.
  • Use of internal values and parameters, such as registers, and things like \tolerance (See TeXbook p. 267 for a complete definition)
  • \magnification parameter & true sizes
  • Case insensitive keywords matching. According to TeXbook p. 265, keywords such as pt, em, true, etc. are matched case insensitively (e.g., pT would match pt). This library does not support this behavior, as keywords must match exactly (i.e., em, true, pt, etc.).
  • fil units TeX allows the use of fil(ll...) units, this library does not.
  • \outer specifier on definitions
  • \csname & \endcsname
  • \begingroup and {, and \endgroup and } behave the same way; that is to say, \begingroup and \endgroup do not have the property of "keeping the same mode" (TeXbook p. 275).
  • All vertical list manipulation commands. Things like \vskip, \vfil, \moveleft etc.
  • \hfil, \hfill
  • \eqno, \leqno, and equation numbers in general.
  • \over, \atop, and all deprecated "fraction like" control sequences.

Things that should work but don't currently

Splitting groupings within user defined macros. E.g.,

\def\abc{\left(}
\abc 4 \right)

This currently does not work.

Unsupported Katex/Temml Options

  • Macros preamble
  • Wrap
  • Left equation numbers
  • colorIsTextColor
  • ThrowOnError
  • maxSize
  • trust
  • \toggle groups

pulldown-latex's People

Contributors

carloskiki avatar

Watchers

 avatar

pulldown-latex's Issues

Road Map for Versions 0.2 - 0.3 - 0.4

Here is what is planned for future releases:

Version 0.2:
Support for basic math environments, such as array, matrix, and align.

Version 0.3:
Operator Event Rework:
The Operator event should follow what The TeXBook says, rather than the weird conventions of MathML.

Version 0.4:
Macro expansion and other quirky commands such as \mathord, \sideset, etc.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.