FxEditor
User guideQuickstartDeploymentAPIDesignFxTeX
APIExamplesRight-click menuAccessibility
FxTeX Server
OverviewAPIAccess and keysSelf-hostingPlugins
OverviewCKEditor 5TinyMCE 6 and 7BloggerAngularFroalaTiptapWordPressMoodleGoogle Docs and SlidesCanvas, Blackboard and LTITiddlyWikiWriting your ownLicensing
How licensing worksThe right-click menu
Every equation fxTeX renders has a menu of its own. Right-click one and your reader can copy it in the form they need, open it
in the equation editor, or turn it into a working graph and calculator. It is part of
fxtex.min.js and always on: there is nothing to install and nothing to configure.
Try it. Right-click any equation in the box below:
Try Graph on either equation, then Edit values.
What is on it
| Copy | |
|---|---|
| LaTeX | The equation's LaTeX source, to paste into a document, a message or an editor. |
| MathML | The equation as a standalone <math> element, with its namespace and without fxTeX's own attributes — ready to paste into Word, another web page, or any application that reads MathML. |
| SVG image | A vector image of the equation, as it appears on the page (inline or display). |
| PNG image | A bitmap image, pasted straight into documents, slides and chat. |
| Open | |
| Graph | A live graph of the equation, with a calculator beneath it. See below. |
| LaTeX Editor | Opens the equation in the online fxEditor, in a new tab, ready to change. |
Copying LaTeX and MathML happens entirely in the browser. The two images are fetched from fxTeX Server when the item is chosen — fxTeX itself converts to MathML and draws no images. Those requests come from your page like any other equation image, so they count towards your domain's fxTeX Server allowance. They are made only when a reader asks, never while the page renders.
For an image file, rather than an image on the clipboard, link to fxTeX Server's
download format — svg.download, png.download or
pdf.download. See the API.
The menu works from the keyboard: the arrow keys move between items, Enter chooses, and Escape closes it. It appears only on equations fxTeX has rendered; other MathML on the page keeps the browser's own menu.
Graph and calculator
Graph turns an equation into something a reader can use. The equation is compiled to WebAssembly by the CodeCogs fxCode service, then run in the reader's own browser, so the graph redraws instantly as values change.
The graph. One variable goes on the x-axis —
x, t or n if the equation has one, otherwise its first
parameter — and the result is plotted against it. An equation with nothing to vary simply
shows its value.
The calculator. Edit values reveals every parameter as an input. Change one and the graph follows. Any parameter can be moved to the x-axis with its x-axis button.
Comparing. + Add line plots the equation again with different values, each line in its own colour, with a table of values beneath the graph.
Animating. The ⏱ button beside a parameter sweeps it over time; beside the x-axis it pans the window.
And a logarithmic y-axis, when every value is positive, and Download PNG to save the graph.
The graph widget is a separate file, fxgraph.esm.js, fetched from beside
fxtex.min.js the first time a reader chooses Graph, so it costs nothing on pages where
nobody does. If you host fxtex.min.js yourself, host the two together, or say where
the widget is with the graphScript option below.
Opening your own instead
Before opening its graph, fxTeX raises a cancelable fxtex:graph event on the
equation. Call preventDefault() and it opens nothing, leaving the item to you:
document.addEventListener('fxtex:graph', function (e) {
e.preventDefault();
openMyCalculator(e.detail.latex); // e.detail = { latex, math }
});
Configuration
The menu needs no setup. Three addresses can be changed — for a
self-hosted fxTeX Server, say — either as
the contextMenu option to render() or at any time with
configureContextMenu():
fxTeX.configureContextMenu({
server: 'https://equations.example.com/', // where Copy as SVG / PNG fetch images
graphServer: 'https://fxcode.example.com', // where Graph compiles the equation
graphScript: '/static/fxgraph.esm.js' // where the graph widget is loaded from
});
| Option | Default |
|---|---|
server | https://fxtex.codecogs.com/ |
graphServer | https://fxcode.codecogs.com |
graphScript | fxgraph.esm.js beside fxtex.min.js |
More
fxTeX API — installing fxTeX and controlling how it scans a page.
Examples — more equations to try the menu on.
fxTeX Server API — the service the image items fetch from.
CodeCogs®