en·vÅos EQUATIONS
2
4
1
EQUATIONS
1
4
By: Tad Hogg (Hogg.pa@Xerox.com)
DESCRIPTION
This module provides interactive editing of mathematical equations within TEdit. An equation consists of a number of pieces of text and possibly one or more special symbols. For many purposes, such as deletion and copy selection, equations behave as a single (large) character in TEdit. Operations on their pieces are described below.
To load:
The equation editor and a standard set of equation types is obtained by loading EQUATIONS.LCOM.
To use:
This section describes the procedures by which equations can be inserted into documents and their pieces modified.
Adding an equation to a TEdit document:
To add an equation, first move the caret to the desired insertion point and then select "Equation" from the main TEdit menu (obtained by holding down the middle button in the window's title bar). This will display a menu of known equation types. Selecting one of these will insert the corresponding equation into the document at the current location of the caret. To abort the insertion, click outside the menu. Once the equation is inserted, a subeditor will be created for each of the equation pieces, one at a time. This can be used to fill in the various pieces of the equation and its use is described below. Some equation types will prompt for additional information before inserting the new equation (e.g. inserting a matrix will prompt for the desired number of rows and columns).
Editing a currently existing equation:
In order to modify a piece of an existing equation (e.g. the numerator of a fraction), the piece must be selected with the mouse in one of two ways. First, you can point at the piece in the displayed equation and press the left mouse button. Alternatively, pointing at the equation and pressing the middle button will display a menu from which the desired piece can be selected. This is useful for selecting pieces that are too small to conveniently point at with the mouse. In either case, if a piece is selected, a subeditor will start on that piece. In addition, some equation types may also allow changes to global properties when no specific piece is selected (e.g. changing the number of rows in a matrix).
Using the equation piece subeditor:
The subeditor is attached to the bottom of the main edit window and allows individual pieces of the equation to be modified with normal TEdit operations. While a subeditor is active, the corresponding piece of the equation in the main window is inverted. Since the text in equation pieces must be on a single line, the subeditor will not accept control characters such as carriage returns. Instead the edit window will flash when such characters are typed.
In the subeditor, the TEdit menu is modified to provide a limited set of TEdit commands as well as additional commands relevant to equations. The menu appears as
iPÿÿÿÿÿÿÿÿÿÿÿÿÿ€€€€À€€~À€€`€€`ß€€|Ù³€€`Ù³€€`Ù³€€`Ù³€€`ÙŸ€€€€€€€€€€€€À€€À€€<Ìx€€3fØÈ€€3fðà€€3fØ8€€3fÌ˜€€ž<Æð€€€€€€€€€€€€€à€€€00À€€†o}¾ÍóÀ€€ælÙ1˜ÌÆ`€€ölÜ1˜ÌÇà€€6lÇ1˜ÌÆ€€6lÓ1˜ÌÆ`€€ãïžŽ|sÀ€€€€€€€€€€€Ÿ0`€±°`€±¾8ùÃÏž|f<€°3Øff3l³ld€°3<Áæ?`³xp€±³lÃf0`³l€±³lÃff3`³fL€Ÿ3>ÁóÃž`Ïcx€€€€€€€€€€€€€€€À€€fqöyð€€3fÆÍ˜€€3fxÆÍ˜€€3fØÆÍ˜€€3fØÆÍ˜€€Ÿ>|vy˜€€€€€€€€€€ €€ð€€À(€€mð€€ãÌÀ*€€ŒÀ€€ŒÀ(€€ÌÀ€€ölp €€€€€€€ÿÿÿÿÿÿÿÿÿÿÿÿÿ€
Selecting Find, Looks, Substitute or Character Looks invokes the corresponding TEdit action. Selecting Equation acts as described above and allows equations to be embedded inside other equations. Exit ends the subedit of the equation piece, updates the equation in the main editor and, if this is a newly inserted equation, automatically starts editing the next piece.
The Exit item also has three possible subitems which are used to exit from the equation editor and specify a desired follow up action. Specifically, Next Piece ends the edit of the current equation piece and creates a new editor on the next piece. In this context, the pieces of the equation are considered to form a circular list so that successive uses of the Next Piece option will edit each piece of the equation in turn. The second subitem, Finish Eqn, ends the current equation edit and does not continue with any other pieces of the equation. Finally, Abort ends the current edit without changing the equation.
When a subeditor is terminated, any TEdit looks or formatting other than character fonts and sub/superscripting are ignored.
The subeditor can also be terminated by the key normally used to advance to the next fill-in slot in TEdit (i.e. text of the form ">>...<<"). Specifically, if there are no remaining slots in the subeditor, using this key is equivalent to selecting Exit from the command menu described above. By default, this key is the middle-blank key on Dolphins and Dorados and the OPEN key on DLions.
User Switches:
The global variable EquationFontSpecs is an array of font specifications in order of increasing size which is used to determine initial fonts for the equation pieces. This can be modified if additional or different default fonts are desired.
The global variable EQ.UseNSChars determines the kind of characters to use when displaying equations that use special symbols (e.g. sum or product) on the screen. Specifically, if non-NIL then symbols from the NS character set are used, otherwise the Sigma 20 font is used. It is initially set to NIL.
When NS characters are used (on the screen when EQ.UseNSChars is non-NIL, or for Interpress), the global variable EQ.NSChars determines the particular NS characters to use . It is a property list of the form (TYPE1 ITEM1 ...) where TYPE is the kind of equation (e.g. SUM, PRODUCT, etc) and ITEM gives the font and character number to use, e.g. ((MODERN 30) 61301) for an INTEGRAL. This variable compensates for the lack of large symbols in various Interpress fonts.
The file EQUATIONPROGRAM.TEDIT describes how to define new kinds of equations, as well as how to create equations in a program with function calls.
Examples:
Examples of equations are given in the file EQUATIONEXAMPLES.TEDIT. The equation module must be loaded before reading this file.
Limitations:
ÿÿïfÿ Equations that are larger than the available room in the current TEdit window will not be displayed.
ÿÿïfÿ The text of each piece of an equation must be on a single line.
ÿÿïfÿ All image objects inserted into equations, as well as the equations themselves, must not have any kerning, i.e. the XKERN field of all imagebox records must be zero.
Koto Incompatibility:
Due to a change in image object I/O, files containing equations written in Lyric/Medley may not be readable in Koto.
(LIST ((PAGE NIL (PAPERSIZE LETTER FOLIOINFO (ARABIC "" "") STARTINGPAGE# 74) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC "" "")) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))) (PAGE NIL (PAPERSIZE NIL . LETTER) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO NIL) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))) (PAGE NIL (PAPERSIZE NIL . LETTER) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO NIL) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))))) 2È,$È-ÈT3ÈÈT2ÈÈ,È,ŠŠ8,ŠŠ8HÈÈPAGEHEADINGRUNNINGHEAD CLASSICCLASSICCLASSICMODERN
HELVETICA
MODERN
MODERN
MODERNMODERN
HRULE.GETFNMODERN
HRULE.GETFNMODERN
HRULE.GETFNMODERN
HRULE.GETFNMODERNHRULE.GETFNMODERN"O `t('Ë$Ê¢BMOBJ.GETFN3 HELVETICA
lBMOBJ.GETFN3
2S¨‹
É
I
e5}÷‡Ì
0
5
W“
‚hCªuÌ–zº