Server
render_latex_snippet(latex_snippet, template=DEFAULT_TEMPLATE)
async
Render latex_snippet to a png and return it.
See
documentation for tex2image.latex_to_png
for more information on the template parameter.
Source code in src/tex2image/server.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | |
run_server(host, port)
Serve the tex2image server using uvicorn and FastAPI on host:port.
Navigate to [host]:[port]/docs to view automatic interactive API documentation (provided by Swagger UI).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
host
|
str
|
The host to listen on. |
required |
port
|
int
|
The port to listen on. |
required |
Example:
run_server("127.0.0.1", 8000)
Source code in src/tex2image/server.py
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | |