Structure Editor: customizing the Editor
Customizing the Toolbar
The editor toolbar (in Design view only) 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, select it from the Toolbar menu. To use a custom toolbar, add it to the toolbar menu where it can be selected.
To save a separate copy of the Standard toolbar, save a new copy of it: Toolbar > Tabbed Toolbar > Save Current Toolbar As.
To add a custom toolbar (tabbed or palettes)
First you'll need to define and save the custom toolbar.
Select "Manage custom toolbar…" from the Toolbar menu.
Click "New".
Fill in a name for your toolbar and browse to a file that contains the toolbar definition.
Finally, click "Apply" to add the new toolbar to the Toolbar menu.
To remove a custom toolbar
Select "Manage custom toolbar…" from the Toolbar menu.
Select the toolbar to remove from the "Custom Toolbar:" drop-down list.
Click "Remove".
To update a custom toolbar
Select "Manage custom toolbar…" from the Toolbar menu.
Select the toolbar to update from the "Custom Toolbar:" dropdown list.
If you have modified the existing file, just click "Apply". Otherwise, browse to the new toolbar configuration file and click "Apply".
To customize a tabbed toolbar
To add an expression to the toolbar, select it and drag it to an empty button on the toolbar.
To delete an expression from a button, right-click and choose Delete (or edit the custom toolbar file).
There are 7 pre-defined tabs and 2 undefined tabs, all of which can be customized:
Algebra
Derivs
Statistics
Matrices
Sets
Trig
Geometry
Tab8
Tab9
To change the tab names, first save the toolbar, then edit the toolbar configuration file.
In order to save customizations (added or deleted buttons), save the toolbar: Toolbar > Tabbed Toolbar > Save Current Toolbar As.
To return to default settings
Choose Toolbar > Tabbed Toolbar > Standard.
Customizing editing behavior
The General Editing Preferences dialog allows you to customize a variety of editing behaviors.
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.
Show Ruler
Check this box to show a ruler above the text area. The drop-down menu to the right of this option allows you to choose the units displayed in the ruler.
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. See a more detailed description of Recognize common functions below for details.
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 ⅉ.
Non-MathML Elements
For an explanation of non-MathML elements and safe mode, see Non-MathML Elements.
The following options for safe mode are explained below:
Enable None
This indicates none of the non-MathML elements should be shown, and no warnings will be issued upon deletion of non-MathML elements. Checking this will automatically uncheck the Enable all, Processing instructions, Comments, and Non-MathML tags checkboxes.
Enable All
This indicates all of the non-MathML elements should be shown, and warnings will be issued upon deletion of all types of non-MathML elements. Checking this will automatically uncheck the Enable none checkbox and enable the Processing instructions, Comments, and Non-MathML tags checkboxes.
Processing instructions
If checked, processing instructions will be displayed in the user interface in Design View, and attempts to delete a processing instruction may be blocked or a warning will occur when these elements are deleted. If not checked, processing instructions will not be displayed, and no errors will occur upon deletion of them.
Comments
If checked, comments will be displayed in the user interface in Design View, and attempts to delete a comment may be blocked or a warning will occur when these elements are deleted. If not checked, comments will not be displayed, and no errors will occur upon deletion of them.
Non-MathML tags
If checked, non-MathML tags and data will be displayed in the user interface in Design View, and attempts to delete non-MathML tags and data may be blocked or a warning will occur when these elements are deleted. If not checked, non-MathML tags and data will not be displayed, and no errors will occur upon deletion of them.
Note the "Enable all" option is automatically checked if all three of the non-MathML type boxes are enabled, and the "Enable none" option is automatically checked if none of the type boxes are enabled. This is done to keep the user interface consistent.
Display non-MathML element warning
This checkbox indicates if a warning dialog should appear when an equation contains non-MathML elements. If these elements are present and this option is enabled, the dialog will appear when the user switches from Source View to Design View, when the user pastes an equation containing non-MathML elements, or when the equation editor window opens an equation with non-MathML elements.
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:
Customizing 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. The MathFlow Editor also allows you to create and manage custom, user-defined styles. At the markup level, both MathML and custom styles are represented by attributes. 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, styles can be applied 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 or double-click the element on the MathML ancestry. Select a style by using the radio buttons to activate either the predefined MathML styles drop-down or the custom styles drop-down, and pick your style from the drop-down list.
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").
As noted above, only the style names are stored in the MathML markup. The associations with particular fonts and properties are maintained separately by the system. See the Programmer documentation section later for more details on this and related topics.
Manage custom font styles
To create and manage these styles, use the "Manage custom font styles" dialog, which you can reach from the mini-toolbar button alongside the drop-down list of styles:
There are 2 other means by which to access the "Manage Custom Font Styles" dialog:
From the Custom Styles dropdown in the Font Properties dialog, or
From the Manage Font Styles command in the Preferences menu.
To add a custom style
Click "New".
Assign a name to your style.
Select values for font, weight or slant.
Finally, click "Save" to add the new style.
To remove a custom style
Select the style to remove from the "Custom font style:" drop-down list.
Click "Remove".
To update a custom style
Select the style to update from the "Custom font style:" drop-down list.
Make your changes to the font, weight or slant.
Click "Save".
To apply a custom style to an equation
Select an equation or part of an equation you wish to apply the style to.
From the Properties menu, open the Font Properties dialog.
Select "Custom Styles" and the style you want to apply. Click "Apply" to apply the new style without closing the dialog or "Done" to apply and close the dialog.
Alternatively, you may click the drop-down list from the mini-toolbar, scroll to the custom style section (beneath the dotted line) and select the style that you would like to apply.