tex-graphics

A web application for TeX graphics(Metapost, TikZ, Graphviz) that works in all browsers

$ opm get sjnam/tex-graphics

TeX graphics in all browsers

A web application for TeX graphics(Metapost, TikZ, Graphviz) that works in all browsers.

No more setup for readers. It just works.

Sample page

Synopsis

``html <html> <body>

<h3>Metapost</h3> <mplibcode width="300"> beginfig(1) pair A,B,C; u:=3cm; A=udir(-30); B=udir(90); C=u*dir(210); transform T; A transformed T = 1/6[A,B]; B transformed T = 1/6[B,C]; C transformed T = 1/6[C,A]; path p; p = A--B--C--cycle; for i=0 upto 20: draw p; p:= p transformed T; endfor; endfig </mplibcode> <mplibcode src="http://ktug.org/~sjnam/source/tree.mp" cache="no"></mplibcode>

<h3>Graphviz</h3> <graphviz src="http://ktug.org/~sjnam/source/fsm.gv" cmd="dot"></graphviz> <graphviz src="https://graphviz.gitlab.io/_pages/Gallery/undirected/philo.gv.txt" cmd="neato"></graphviz>

<h3>TikZ</h3> <tikzpicture src="http://ktug.org/~sjnam/source/sine.tex"></tikzpicture> <tikzpicture src="http://ktug.org/~sjnam/source/func.tex"></tikzpicture>

</body> </html> ``

Installation

  • Prerequisites

  • TeX Live, An easy way to get up and running with the TeX document production system

  • lua-gumbo, A HTML5 parser and DOM library for Lua

    $ git clone https://github.com/sjnam/tex-graphics.git
    $ cd tex-graphics
    $ mkdir -p html/images logs
    $ ./ngxctl start

Examples

  • http://localhost:8080/sample/sunflower.html

  • http://localhost:8080/sample/all.html

  • http://localhost:8080/preview.html

Author

Soojin Nam, jsunam@gmail.com

License

Public Domain

Authors

Soojin Nam

License

public

Dependencies

tokers/lua-resty-requests, openresty >= 1.15.8.1

Versions

  • A web application for TeX graphics(Metapost, TikZ, Graphviz) that works in all browsers 2019-03-16 22:43:12