FxEditor
User guideQuickstartDeploymentAPIDesignFxTeX
APIExamplesRight-click menuAccessibilityFxTeX Server
OverviewAPIAccess and keysSelf-hostingPlugins
OverviewCKEditor 5TinyMCE 6 and 7BloggerAngularFroalaTiptapWordPressMoodleGoogle Docs and SlidesCanvas, Blackboard and LTITiddlyWikiWriting your ownLicensing
How licensing worksSelf-hosting fxTeX Server
Most people never need to. The hosted service at https://fxtex.codecogs.com is free for
light use and licensed beyond it. You run your own when:
The equations cannot leave your network. Student work, unpublished research, clinical or commercial material: a URL to a public service puts the equation in somebody else's logs.
You need it to be there. A deployment of your own fails when your infrastructure fails, and not otherwise.
The volume is beyond any hosted allowance.
Self-hosting is part of the Enterprise (Self-hosted) licence, which comes with access to the private Docker image. See licence options, or talk to us.
Replacing a self-hosted LaTeXRender? fxTeX Server answers the same
/type.format?LaTeX URLs, so pages and plugins pointed at your LaTeXRender deployment
work unchanged when pointed at this one. It is also far lighter: one small image, no TeX
installation, no equation cache and no clean-up service. The differences in output are listed
under Coming from
LaTeXRender.
Running it
One image, listening on port 80, with nothing to persist. A converter with no cache and no database has no state to lose, so a replica can be stopped at any moment and scaling is simply a matter of adding replicas.
docker login
docker run -d -p 8080:80 -e FXTEX_SITE=https://equations.example.com willzyba/fxtexserver:version
curl "http://localhost:8080/svg.image?x%5E2"
On Docker Swarm, the registry credential has to travel with the deploy — that is what
--with-registry-auth does; without it no node can pull the image and the tasks never
start:
docker stack deploy --with-registry-auth --compose-file docker-fxtex.yml fxtex
version: "3.9"
services:
fxtex:
image: willzyba/fxtexserver:version
deploy:
mode: replicated
replicas: 4
placement:
max_replicas_per_node: 2
update_config:
parallelism: 2
delay: 10s
restart_policy:
condition: any
delay: 5s
max_attempts: 5
window: 120s
volumes:
- /etc/fxtex:/etc/fxtex:ro # the domain and key lists, if you use them
environment:
- FXTEX_SITE=https://equations.example.com
- FXTEX_DOMAINS_FILE=/etc/fxtex/domains
- FXTEX_API_KEYS_FILE=/etc/fxtex/keys
ports:
- 8080:80
healthcheck:
test: wget -qO - http://127.0.0.1/health || exit 1
interval: 30s
timeout: 5s
retries: 3
start_period: 15s
Each replica serves one request at a time and conversion takes a fraction of a millisecond, so
throughput comes from the number of replicas. max_replicas_per_node keeps one node's
failure from taking the whole service with it. Updating is the same deploy with a new tag; Swarm
rolls the replicas two at a time and the service stays up throughout.
/health answers OK on its first line, followed by counters: requests
by type, errors, and whether access control is on.
Who may use it
With no domains and no keys configured, the service is open to anyone who can
reach it — the usual arrangement inside a private network. Configure either and it
enforces them, with the same rules as the hosted service: a request is accepted if its
Referer is a listed domain or it carries a listed key. See
Access and keys.
Both lists are plain text, one entry per line, # for comments:
# /etc/fxtex/domains - the domain, then its allowance
example.com enterprise # example.com and every subdomain, unlimited
*.partner.org 100 1000 # subdomains of partner.org (not partner.org itself):
# 100 a second, bursts of 1000
# /etc/fxtex/keys - the key, a label the logs use in its place, then its allowance
sk_internal_8f2a reporting-service enterprise
The allowance is either a tier name — demo, essential,
pro or enterprise, the last meaning no limit — or a rate and a
burst given as numbers. An entry with neither gets demo, the lightest, so on a
private deployment you will usually want enterprise.
The files are watched: an edit takes effect within about five seconds, with no restart and no dropped request. If a file cannot be read, the list already loaded stays in force. Under Swarm the files must be present, and identical, on every node that can run a replica.
Configuration
| Variable | Meaning |
|---|---|
FXTEX_SITE | The public address the service answers on, as a browser reaches it. |
FXTEX_DOMAINS / FXTEX_DOMAINS_FILE | Allowed domains, as a comma-separated list or a file. |
FXTEX_API_KEYS / FXTEX_API_KEYS_FILE | Allowed keys, as a comma-separated list or a file. |
FXTEX_TRUSTED_HOPS | How many proxies of your own sit in front of the service, so the client address is read from the right place in X-Forwarded-For. Default 1. |
FXTEX_ACCESS_LOG | 1 writes one line per request to the container log. Off by default. |
FXTEX_LOG_IP | How client addresses are logged: anon (default, last part removed), full or off. |
FXTEX_SVG_EMBED | 0 makes svg behave as svgtext throughout, leaving characters as text. |
FXTEX_MATH_FONT | The maths font, as Family Name=/path/to/font.otf. Latin Modern Math by default; STIX Two Math and Cambria Math are also supported. |
FXTEX_RASTER_SCALE | Default resolution of png and gif, as a multiple of CSS pixels, when an equation gives no \dpi. |
Everything else — logs included — goes to standard error, which in a container is the log, collected and rotated by whatever collects the rest of yours.
Pointing the editor and plugins at it
Anything that renders through fxTeX Server can be pointed at your own. For
the plugins, set their render URL option —
renderUrl, eqneditor_render_url and so on — to your
FXTEX_SITE. For fxTeX's right-click
menu, use fxTeX.configureContextMenu({ server: 'https://equations.example.com/' }).
More
API — the URL interface your deployment answers.
Access and keys — how domains and keys are matched.
Contact us — about an Enterprise licence.
CodeCogs®