Style Editor: customizing the Editor
Customizing editing behavior
The General Editing Preferences dialog allows you to customize a variety of editing behaviors.
Customizing the toolbar
The Editor toolbar can be customized. The MathFlow Editor comes with a standard toolbar as well as other predefined toolbars. You can also define your own custom toolbar configurations. In fact, the default toolbar is a customized one, containing most of the symbols from the pre-defined palettes and most templates.
To use an alternative toolbar, you must first have defined a Config file for the custom toolbar (see documentation on the Toolbar definition language). If you've done that, select Custom from the Toolbar section of the General Editing Preferences dialog, and browse to its Config file:
To change from one custom toolbar to another, switch to a standard toolbar and switch back to custom, choosing the new config file. Alternatively, choose the new config file, then close and reopen the MathFlow Editor.
To update a custom toolbar, you'll need to manually edit its toolbar configuration file (config file) first. Then either switch to a standard toolbar and switch back to custom, or close and reopen the MathFlow Editor.
To return to default settings
Choose the Standard toolbar from the toolbar list.
Pressing spacebar will insert
You can choose what gets inserted when pressing the spacebar, modifying the default behavior. Your choices are to insert
an Invisible times after an operand, space otherwise,
an Invisible times always,
a Space always, or
Nothing
The most convenient spacebar behavior depends on whether accurately encoding the underlying mathematical meaning of an expression is important in a particular context.
In many situations, the underlying mathematical meaning is not as important as the visual appearance of an expression. In these contexts, most users prefer the spacebar simply insert space characters, as on a typewriter. However, MathML rendering engines employ standard mathematical typesetting rules to automatically add space around operators and other constructs. Inserting additional space characters in markup generally produces worse-looking results unless there is a specific reason. Regardless, touch-typists often find themselves hitting the spacebar out of habit. As a result, users may want to turn the spacebar off entirely.
In contexts, the mathematical meaning of an expression is important, such as material intended for symbolic computation, automatic answer checking, etc. In these situations, extraneous space characters may cause trouble. Moreover, in these contexts, adding invisible "hint characters" to resolve ambiguous situations is important. The most common situation where ambiguity arises is determining whether adjacent constructs should be multiplied or whether they represent a function application (e.g., does m(x + y) mean "m times x plus y" or "m of x plus y"?). The convention in MathML is to resolve the ambiguity by marking the multiplications with an Invisible Times character. Thus, users creating semantically meaningful MathML generally prefer to have the space bar insert the Invisible Times character. The option to have the spacebar insert an Invisible Times character only after an operand is a convenient compromise allowing one to space normally within text tokens without modifying the overall editing behavior.
Make "fence" characters non-stretchy by default
Check this box to make inserted parentheses and other "fence" characters not stretch by default. In MathML, fence characters marked as non-stretchy will remain their default size (i.e., not growing automatically to cover the height of other content within the same parent element). In order for fences to grow to the expected height in many contexts, the conscious insertion of additional expression groups to collect fences and surrounding content is required. While this is good practice and results in semantically meaningful markup, many users prefer to instead turn off automatic stretching for fences.
Make single characters italic by default
Single characters will be inserted in italic if this box is checked, and as upright text if not. Since single character identifiers are traditionally typeset in italics in mathematics, this option is primarily useful when entering chemical equations where single character identifiers are traditionally typeset in an upright style.
Make uppercase Greek letters normal by default
Uppercase Greek letters will be inserted as normal if checked (i.e., upright, not italicized) or italic if not checked.
Recognize common functions
Check this box to turn on automatic recognition of functions. When this option is not selected, you must manually control how characters are wrapped in MathML token elements. For more detail, see Recognize common functions in the next section.
Render differential d in double struck
Differential ⅆ will appear as a double struck character to differentiate it from a regular character d. This also affects the exponential ⅇ, imaginary ⅈ, and imaginary ⅉ.
Recognize common functions
Within the General Editing Preferences dialog, you may customize the way MathFlow Editor groups successive characters into MathML elements. Character placement within MathML "token" elements affects several things. Most obviously, it affects how characters are typeset:
By default, tokens containing single alphabetic characters are assumed to be variables, typeset in italics.
Tokens containing multiple alphabetic characters are assumed to be function names and are typeset in an upright font.
Similarly, digits are normally typeset in an upright font.
Finally, symbol characters require special handling, including special spacing considerations.
The MathFlow Editor can generally detect numeric and symbol characters, thereby automatically tagging them appropriately. However, alphabetic characters are more ambiguous. When a user types s i n for example, does the user intend the sine function, or is it three variables being multiplied together? The MathFlow "Recognize Common Functions" preference gives users a choice between two basic models for dealing with this issue.
When recognition of common functions is enabled,
MathFlow Editor scans successive runs of characters and compares them to a list of common functions.
When a match is detected, the MathFlow Editor groups those characters together in a single token element and adds an invisible semantic hint character (following the token) to indicate function application.
If no match is detected, each typed character is assumed to be a variable and is placed in a token element by itself.
In most situations, users find this editing model most convenient. For mathematics up to college level, it generally produces high-quality, semantically-meaningful MathML.
When function recognition is not enabled, the user must manually divide alphabetic characters into tokens. Alphabetic characters entered in adjacent positions are always added to a single token element. To break the token element apart, the user must enter a non-alphabetic character. Note in this mode, it is necessary to enter an Invisible Times semantic hint character between two variables (e.g. "xy"), since they would otherwise be grouped together and typeset in an upright font. Consequently, when recognition of common functions is not enabled, it is best to set the spacebar to insert the Invisible Times character. See Customizing editing behavior for more information.
By clicking the Customize button next to the Recognize Common Functions checkbox in the General Preferences dialog, users may define their own functions to be recognized by the application:
When a set of characters is entered into the "New function:" box and "Add" is selected, the editor will recognize those individual characters as a function. You may also remove previously defined functions by selecting them and clicking the "Remove" button.
Linebreaking preferences
MathFlow has two styles of automatic linebreaking, both of which are controlled with the Line Breaking Preferences dialog.
Enable automatic linebreaking | Lines are filled based on an algorithm that balances filling the line with keeping mathematical sub-expressions such as ax + b together on a line. |
Enable | MathML operators that have |
See also:
Applying font styles
MathFlow allows you to control the font face, weight and slant of individual characters or entire subexpressions. This is accomplished by applying named styles. MathML defines 12 generic named styles you can use. Only the style names appear in the markup, not the literal font, weight and slant information. Thus, style information can easily be reprocessed via the use of XSLT transformations to produce style commands appropriate for a specific composition engine.
To quickly apply a style to an expression, select the expression and use the mini-toolbar drop-down list of styles to select the desired style. (Note: Custom toolbar shown in this screen shot.)
This will wrap the chosen expression with an mstyle
element, making the style sticky, as explained in the Working with math properties section. The working font style (i.e., the current default), can be quickly determined by looking at the drop-down list of font styles in the minitoolbar.
Alternatively, you can apply styles to characters and expressions from the Font Properties dialog. To apply a style, select the expression to be styled and open the Font Properties dialog from the Properties menu. Select a style from the drop-down list in the Logical Font section.
At the bottom of the Font Properties dialog are two checkboxes to determine whether the property settings will be sticky or not.
If you choose "Apply to each token element in the selection", MathFlow will set the style on each individual character within the selection, and the style will "stick" with them if you cut part of the expression and paste it elsewhere.
By contrast, if you choose "Set as default for selected expression", MathFlow will insert a style change template as needed, and set the style once for the entire selection. In this case, the style is associated with the entire expression and not the individual characters within it. Consequently, new characters added inside the expression will inherit that style, and characters cut from the expression and pasted elsewhere will lose the style. Hence, this is referred to as being "not sticky" (or "non-sticky").