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 ($).

y = mx+b

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.

y_{\text{target}} = \beta_0 + \beta_1 x_1 + \beta_2 x_2 + \dots + \beta_M x_M
To match a literal ? 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.

y_0=\frac{a}{b}x^2

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.

This is a passage with some $\LaTeX$ formulas

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.