<< Chapter < Page | Chapter >> Page > |
Step 7 : Press “Assign” button and then “Close” button. Macro recording has started. A pair of buttons are displayed on the margin of the document as shown in the figure below. One of the button is “Stop” button, while the other is “Pause” button for macro recording.
Now, looking at the code lines written in step 3, type exactly the same after one or two lines. Do not bother for key and cursor movements. It is advisable that we maintain the required indenting say between “mfrac” tag and “mi” tag. When the code lines have been reproduced, press “Stop” button to stop the recording.
Step 8 : You are now ready to use the macro. Hold “Alt” key and simulataneously press “F” key. The code lines as recorded are reproduced instantly as shown here :
<m:mfrac>
<m:mi> x </m:mi>
<m:mi> y </m:mi>
</m:mfrac>
Macro recording is a powerful tool to reproduce a set of code lines. However, this facility is available in the normal document mode and not in the plane text mode. As such, codes are required to be first written in a document file, say “test.doc”. Once coding is complete in a major way, we need to save the file in plane text with Unicode character format (UTF -8) for renderer to display the content. It is implied here that a repository of macros corresponding to the basic forms of element encoding be prepared in advance in order to use the same, when required.
In the following section, we shall illustrate the use of macros and few improvisations to encode “Cauchy-Schwarz” inequality.
Understanding of the underlying presentation framework of MathML is just one aspect of learning process. Equally important aspect is to develop the ability to convert presentation requirement in terms of codes. There is no universal set of algorithms that would help to successfully translate visual presentation requirement into MathML code lines in a mechanical manner - unless aided by specialized program or software. Unaided, this may be achieved by developing ability to visualize the presentation requirements in some logical modular work pieces like :
“Cauchy-Schwarz” inequality is shown here :
A visual inspection of the formula suggests that this inequality is built of three large blocks of similar composition. The first block is raised to apower of “2”. This can be implemented with “msup” element. Thus, we start with using macro for “msup” element :
<m:msup>
<m:mi> x </m:mi>
<m:mi> y </m:mi>
</m:msup>
The superscript is changed to “2” as required. A code line for element “mo” is written using macro for “mo” element and its content is changed to parenthesis :
<m:math display="block">
<m:mo> ( </m:mo>
<m:msup>
<m:mi> x </m:mi>
<m:mn> 2 </m:mn>
</m:msup>
</m:math>
Notification Switch
Would you like to follow the 'A primer in mathml' conversation and receive update notifications?