All Projects → tomtung → latex2unicode

tomtung / latex2unicode

Licence: Apache-2.0 License
Convert LaTeX markup to Unicode (in Scala and Java)

Programming Languages

scala
5932 projects

Projects that are alternatives of or similar to latex2unicode

3bmd
markdown processor in CL using esrap parser
Stars: ✭ 58 (+107.14%)
Mutual labels:  parsing, peg
Angourimath
Open-source symbolic algebra library for C# and F#. One of the most powerful in .NET
Stars: ✭ 266 (+850%)
Mutual labels:  latex, parsing
Pegtl
Parsing Expression Grammar Template Library
Stars: ✭ 1,295 (+4525%)
Mutual labels:  parsing, peg
Cpp Peglib
A single file C++ header-only PEG (Parsing Expression Grammars) library
Stars: ✭ 435 (+1453.57%)
Mutual labels:  parsing, peg
arborist
Arborist is a PEG parser that supports left-associative left recursion
Stars: ✭ 17 (-39.29%)
Mutual labels:  parsing, peg
Lug
Parsing expression grammar (PEG) embedded domain specific language and parsing machine for C++17
Stars: ✭ 44 (+57.14%)
Mutual labels:  parsing, peg
Ohm
A library and language for building parsers, interpreters, compilers, etc.
Stars: ✭ 3,938 (+13964.29%)
Mutual labels:  parsing, peg
Rust Peg
Parsing Expression Grammar (PEG) parser generator for Rust
Stars: ✭ 836 (+2885.71%)
Mutual labels:  parsing, peg
ParsecSharp
The faster monadic parser combinator library for C#
Stars: ✭ 23 (-17.86%)
Mutual labels:  parsing, peg
pyrser
A PEG Parsing Tool
Stars: ✭ 32 (+14.29%)
Mutual labels:  parsing, peg
Pom
PEG parser combinators using operator overloading without macros.
Stars: ✭ 310 (+1007.14%)
Mutual labels:  parsing, peg
cppcombinator
parser combinator and AST generator in c++17
Stars: ✭ 20 (-28.57%)
Mutual labels:  parsing, peg
Pest
The Elegant Parser
Stars: ✭ 2,783 (+9839.29%)
Mutual labels:  parsing, peg
parson
Yet another PEG parser combinator library and DSL
Stars: ✭ 52 (+85.71%)
Mutual labels:  parsing, peg
pe
Fastest general-purpose parsing library for Python with a familiar API
Stars: ✭ 21 (-25%)
Mutual labels:  parsing, peg
ohm-editor
An IDE for the Ohm language (JavaScript edition)
Stars: ✭ 78 (+178.57%)
Mutual labels:  parsing, peg
Bullwinkle
An on-the-fly parser for BNF grammars
Stars: ✭ 39 (+39.29%)
Mutual labels:  parsing
elte-ik-pti-bsc-zarovizsga
ELTE IK - Programtervező Informatikus BSc Záróvizsga tételek kidolgozása
Stars: ✭ 26 (-7.14%)
Mutual labels:  latex
letter-2-reviewers-LaTeX-template
A LaTeX template to write response letters for journal revisions
Stars: ✭ 32 (+14.29%)
Mutual labels:  latex
tikz favorites
collection of favorite TikZ graphics
Stars: ✭ 62 (+121.43%)
Mutual labels:  latex

LaTeX2Unicode Build Status

LaTeX2Unicode translates LaTeX markup to human readable Unicode when possible. Here's an online demo that can be conveniently used to type in special characters. (demo source)

Basic math notations are supported. For instance:

\because \t{AB} + \t{BC} \neq \t{AC}
\therefore \iint\sqrt[4]{\xi^{\theta+1}} - \frac 38 \le
\Sigma \zeta_i \\
\therefore \exists{x}\forall{y} x \in \^A

is converted to

∵ A͡B + B͡C ≠ A͡C ∴ ∬∜ξ̅ᶿ̅⁺̅¹̅ - ⅜ ≤ Σ ζᵢ

∴ ∃x∀y x ∈ Â

Hundreds of other symbols and special characters are supported, too. For example, \spadesuit, \aleph, \OE, \downdownarrows and \o are translated to , , Œ, , ø, respectively.

Some font styles are supported, too. For instance:

\textbb{Black Board Bold}, \textfrak{Fraktur},
{\bf Bold Face}, {\cal Calligraphic}, {\it Italic},
{\tt Monospace}

is translated to

𝔹𝕝𝕒𝕔𝕜 𝔹𝕠𝕒𝕣𝕕 𝔹𝕠𝕝𝕕, 𝔉𝔯𝔞𝔨𝔱𝔲𝔯, 𝐁𝐨𝐥𝐝 𝐅𝐚𝐜𝐞, 𝓒𝓪𝓵𝓵𝓲𝓰𝓻𝓪𝓹𝓱𝓲𝓬, 𝐼𝑡𝑎𝑙𝑖𝑐, 𝙼𝚘𝚗𝚘𝚜𝚙𝚊𝚌𝚎

Using as Scala / Java Library

LaTeX2Unicode is written in Scala, thus can serve as a 3rd party library in any JVM application that needs to extract information from LaTeX texts (e.g. BibTeX).

Simple Conversion

For simple conversion without configuration, which works fine in most cases, one call to a static method and you're done.

In Scala:

import com.github.tomtung.latex2unicode._

val latex = "\\ss^2 + \\alpha_3 \n \\div \\frac{1}{3} = \\sqrt[3]{123}"
val unicode = LaTeX2Unicode.convert(latex)
println(unicode)

In Java:

import com.github.tomtung.latex2unicode.LaTeX2Unicode;

String latex = "\\ss^2 + \\alpha_3 \n \\div \\frac{1}{3} = \\sqrt[3]{123}"
String unicode = LaTeX2Unicode.convert(latex)
System.out.println(unicode);

Maven / SBT Dependency

To add dependency on LaTeX2Unicode, insert the following to your pom.xml file if you use Apache Maven:

<dependency>
    <groupId>com.github.tomtung</groupId>
    <artifactId>latex2unicode_2.12</artifactId>
    <version>0.2.7</version>
</dependency>

or add the following to your build.sbt file if you use sbt 0.11+:

libraryDependencies += "com.github.tomtung" %% "latex2unicode" % "0.2.7"

Credits

LaTeX2Unicode is inspired by two similar projects, latex-to-unicode by ypsu (written in Python) and latex-to-unicode by vikhyat (written in Ruby).

LaTeX2Unicode is built on fastparse, an fast and elegant PEG parsing framework.

Licence

Apache License Version 2.0

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].