• Stars
    star
    137
  • Rank 264,620 (Top 6 %)
  • Language
    C++
  • License
    MIT License
  • Created almost 9 years ago
  • Updated about 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A C++ LaTeX generator

latexpp

GitHub license

latexpp is a first-of-its kind C++ library for generating LaTeX equations via C++. It supports conversion of LaTeX equations to HTML as well as JPG, PNG and SVG image formats.

Usage

#include "latex.hpp"

int main(int argc, const char* argv[])
{
	// Single class
	Latex latex;

	const std::string equation = "\\sum_{i=1}^{n} i = \\frac{n(n + 1)}{2}";

	// Convert to PNG, store in 'equation.png'
	latex.to_png(equation, "equation.png");

	// Convert to HTML, returns a HTML snippet
	std::string html = latex.to_html(equation);
}

equation.png:

equation.png

Implementation Overview

latexpp uses KaTeX to render LaTeX to HTML. Because KaTeX is a JavaScript library, latexpp uses Google's V8 engine to write JavaScript from C++. Image output is enabled by the wkhtmltox C library.

To build this project, you will need:

  • The Google V8 engine to compile JavaScript.
  • The wkhtmltox library for image output.
  • Boost for some cross-platform directory operations (can be dropped as a dependency if platform-indpendence is not required, or when the C++ standard committee decides to roll out boost's filesystem library in the C++ standard library.)

KaTeX is not a dependency as it is entirely contained in the katex folder.

Documentation

You can build extensive documentation with doxygen. See the doxyfile in the docs/ folder. There are also some example programs in the examples folder.

LICENSE

This project is released under the MIT License. For more information, see the LICENSE file.

Authors

Peter Goldsborough + cat ❤️

More Repositories

1

ipc-bench

🐎 Benchmarks for Inter-Process-Communication Techniques
C
676
star
2

clang-expand

🐉 A clang tool for happy refactoring without source-code gymnastics
C++
247
star
3

lru-cache

💫 A feature complete LRU cache implementation in C++
C++
234
star
4

ig

🎆 Include graph visualization for C++
Python
198
star
5

Writer-Tutorial

PyQt text editor tutorial repository
Python
185
star
6

vector

A pure C vector implementation
C
138
star
7

microservice-rs

Tutorial codebase for writing a microservice in Rust
Rust
129
star
8

markdownpp

A C++ Markdown solution.
CSS
83
star
9

tssx

Transparently replace domain sockets with a fast shared memory channel
C
68
star
10

k-means

Code accompanying my blog post on k-means in Python, C++ and CUDA
Cuda
58
star
11

hashtable

A pure C hashtable implementation.
C
45
star
12

Writer

PyQt Text Editor
Python
41
star
13

AVR-DHT11

🪲 AVR code to interface with the DHT11 temperature and relative humidity sensors
C
27
star
14

psag.cc

A URL shortener for my blog, written in Rust
Rust
24
star
15

bitset

A pure C Bitset implementation.
C
17
star
16

pytorch-cpp-extension

PyTorch C++ Extension Example
Python
15
star
17

generate-shapes

⬛ 🔴 Generate shapes for object detection algorithms
Python
14
star
18

bloom-cpp

🔍 A header-only bloom filter implementation in C++14.
C++
13
star
19

cytogan

Repository for my research on generative modelling of cell images
Python
13
star
20

progress

A pluggable command line progress bar
Shell
12
star
21

algs4

Notes and Implementations for Princeton Algs4 course.
Java
12
star
22

dispy

A tiny Python bytecode disassembler
Python
10
star
23

router-trie

A Hash Array Mapped Trie for fast Routing Table lookups.
C
10
star
24

GoogleCloudVisionOCRExample

Using the Google Cloud Vision API for OCR in Swift
Swift
9
star
25

Mavrchester

Atmel AVR C code for Manchester Encoding.
C
8
star
26

atom-clang-expand

🐉 A clang tool for happy refactoring without source-code gymnastics (atom package)
JavaScript
6
star
27

your_app

Tutorial repository for "Creating and Distributing a Python Project".
Python
6
star
28

li

A license fetcher
Python
6
star
29

data-structures

Data structure implementations.
C++
5
star
30

algorithms

Algorithm implementations.
C++
5
star
31

Anthem

The to-be go-to open-source, community-driven synthesizer
C++
5
star
32

Parsley

C++ XML Parser
C++
4
star
33

real-fake

Tiny app for GAN image "turing tests"
HTML
3
star
34

lnk

Command-line URL shortening client.
Python
3
star
35

ecstasy

A command-line-tool beautifier
Python
2
star
36

euler

Project Euler Solutions.
Python
1
star
37

enum-class.js

Strongly typed enums in JavaScript
JavaScript
1
star