tex-graphics
一个适用于所有浏览器的 TeX 图形(Metapost、TikZ、Graphviz)Web 应用程序
$ opm get sjnam/tex-graphics
在所有浏览器中显示 TeX 图形
一个适用于所有浏览器的 TeX 图形(Metapost、TikZ、Graphviz)Web 应用程序。
读者无需任何设置,即可直接使用。
概要
``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> ``
安装
先决条件
TeX Live,轻松上手 TeX 文档制作系统
OpenResty 1.15.8.1,基于 NGINX 和 LuaJIT 的动态 Web 平台
lua-gumbo,Lua 的 HTML5 解析器和 DOM 库
lua-resty-requests,OpenResty 的另一个 HTTP 库
$ git clone https://github.com/sjnam/tex-graphics.git
$ cd tex-graphics
$ mkdir -p html/images logs
$ ./ngxctl start
示例
http://localhost:8080/sample/sunflower.html
http://localhost:8080/sample/all.html
http://localhost:8080/preview.html
作者
Nam Soojin,jsunam@gmail.com
许可证
公有领域
作者
Nam Soojin
许可证
公开
依赖项
tokers/lua-resty-requests,openresty >= 1.15.8.1
版本
-
sjnam/tex-graphics 0.9.4一个适用于所有浏览器的 TeX 图形(Metapost、TikZ、Graphviz)Web 应用程序 2019-03-16 22:43:12