Skip to content
An openresty web application for TeX graphics that works in all browsers
Branch: master
Clone or download
Latest commit 92002f0 May 17, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
conf remove needless Apr 14, 2019
html ... Mar 25, 2019
lua preview.lua Mar 24, 2019
util remove auxs May 10, 2019
ngxctl do not remove img files in reload Feb 22, 2019

TeX graphics in all browsers

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

No more setup for readers. It just works.




<mplibcode width="300">
  pair A,B,C; u:=3cm;
  A=u*dir(-30); B=u*dir(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;

<mplibcode src="" cache="no"></mplibcode>


digraph G {
    main -> parse -> execute;
    main -> init;
    main -> cleanup;
    execute -> make_string;
    execute -> printf
    init -> make_string;
    main -> printf;
    execute -> compare;

<graphviz src=""


  \draw[step=.5cm, gray, very thin] (-1.2,-1.2) grid (1.2,1.2); 
  \filldraw[fill=green!20,draw=green!50!black] (0,0) -- (3mm,0mm) arc (0:30:3mm) -- cycle; 
  \draw[->] (-1.25,0) -- (1.25,0) coordinate (x axis);
  \draw[->] (0,-1.25) -- (0,1.25) coordinate (y axis);
  \draw (0,0) circle (1cm);
  \draw[very thick,red] (30:1cm) -- node[left,fill=white] {$\sin \alpha$} (30:1cm |- x axis);
  \draw[very thick,blue] (30:1cm |- x axis) -- node[below=2pt,fill=white] {$\cos \alpha$} (0,0);
  \draw (0,0) -- (30:1cm);
  \foreach \x/\xtext in {-1, -0.5/-\frac{1}{2}, 1} 
    \draw (\x cm,1pt) -- (\x cm,-1pt) node[anchor=north,fill=white] {$\xtext$};
  \foreach \y/\ytext in {-1, -0.5/-\frac{1}{2}, 0.5/\frac{1}{2}, 1} 
    \draw (1pt,\y cm) -- (-1pt,\y cm) node[anchor=east,fill=white] {$\ytext$};

<tikzpicture src=""></tikzpicture>



  • Prerequisites

$ git clone
$ cd tex-graphics
$ mkdir -p html/images logs
$ ./ngxctl start



Soojin Nam,


Public Domain

You can’t perform that action at this time.