@Role
public interface FormulaRenderer
Modifier and Type | Interface and Description |
---|---|
static class |
FormulaRenderer.FontSize
Encloses the supported LaTeX font sizes used for displaying a mathematical formula.
|
static class |
FormulaRenderer.Type
Encloses the supported formats for rendered mathematical formulae.
|
Modifier and Type | Method and Description |
---|---|
ImageData |
getImage(String imageID)
Retrieve the image data from the storage.
|
String |
process(String formula,
boolean inline,
FormulaRenderer.FontSize size,
FormulaRenderer.Type type)
Generates the image (if not already generated), stores it, and returns a key which can be used for retrieving it
in a subsequent request.
|
String process(String formula, boolean inline, FormulaRenderer.FontSize size, FormulaRenderer.Type type) throws IllegalArgumentException, IOException
formula
- the mathematical formula to render, in LaTeX format, without the surrounding math-mode
commands ($, begin{math}, etc.)inline
- whether the formula appears inline inside the text, or as a standalone blocksize
- the font size to use for the texttype
- The type of image to generate. See the FormulaRenderer.Type
enum for supported types. Not all renderers
support all types.storage
IllegalArgumentException
- if the LaTeX syntax of the formula is incorrect and the error is unrecoverableIOException
- in case of a renderer execution errorImageData getImage(String imageID)
imageID
- the identifier for the image, returned by process(String, boolean, FontSize, Type)
ImageData
, or null
if no image exists with this identifierCopyright © 2004–2021 XWiki. All rights reserved.