Basic Selectors
Literal Selectors
The most basic selector is a literal selector.
It matches a segment of your formula. A literal selector is a valid LaTeX math
expression surrounded by a pair of dollar signs ($
).
Wildcards
To select similar elements from your formula, you can use wildcards.
There are two types of wildcards similar to Unix glob.
?
matches any single token (e.g., character, number, command, etc.)
and *
matches any sequence of zero or more tokens. Note that
*
does not escape group ({…}
) boundaries.
?
or *
in the original markup,
you can escape it with a backslash (i.e. \?
and \*
).
Built-In Classes
FFL offers several built-in classes for your convenience, such as .superscript
,
.subscript
, .numerator
, .denominator
, etc.
They all are preceded by a dot (.
), similar to CSS classes.
CSS Classes
By default, FFL only apply styles to your formulas. However, you can mix in CSS classes in the selector by prepending an asterisk (*
) to the class name to apply to the rest of the document.
While currently support for CSS selectors is limited, the grammar of FFL does allow the opportunity to extend the language to support more complex selectors in the future. This might also allow support for more integration with other tooling.
Note that for now, there needs to be at least some formula in the rendered passage for the CSS styles to be applied. You cannot write only CSS in FFL.