## Equation Editor

One of the most important objectives for the development of Cassiopeia was to provide a text processing solution with a highly integrated equation editor with the following properties:- keystroke based editing of equations (highly efficient)
- nice presentation on screen for on-screen thinking
- LaTeX export for publishing in book printing quality
- MathML content markup based internal representation
- built-in 2D graph module for immediate plotting of functions
- built-in symbolic algebra system for equation simplification

Nice presentation means that equations are rendered beautifully already on screen thus inviting scientists and engineers to use Cassiopeia not only as a word processor for preparing stunning publications but also and already as a think tank tool in the creation process. Other solutions focussing on symbolic algebra tend to have a rather ugly interface nobody really wants to work with all day.

LaTeX export is an absolute must for a scientific wordprocessing solution. However, LaTeX is a typesetting language developed for the printing industry to improve the quality of printed publications. It was never really meant to be used by authors in the content creation phase. Scientists should be able to concentrate on scientific problems instead of spending valuable time on tinkering with typesetting tags. That's why Cassiopeia hides the LaTeX generation and compilation process as much as possible. Cassiopeia users can influence the LaTeX generation process - e.g. by providing an alternative preamble or inserting pure LaTeX code into the document - but they usually don't have to. Cassiopeia generates stunning output with its default settings and predefined LaTeX preambles.

LaTeX is a description language with focus on presentation. That's fine if the only goal of the authoring process is to get a PDF in book printing quality. However, if functions are to be plotted, if equations are to be processed by a symblic algebra system another internal representation is needed that precisely describes the mathematical meaning of an equation. That's what MathML content markup was developed for.

There are a bunch of graph applications available on the market that can be used to generate a plot for a given function. The exported image files can then easily be imported into any textprocessing system. This might be a viable approach for simple functions but is not practicle for more complex ones with lots of terms and coefficients. Uninterrupted scientific thinking means to simply shift-doubleclick on an entered or automatically derived function in the textprocessing system and get a plot immediately inserted into the text stream.

Standard symblic algebra systems usually have a rather ugly user interface. Copying (reentering) equations from the text system to the algebra application and vice versa takes a lot of time. The integrated symbolic algebra system of Cassiopeia allows to process equations directly in the text stream and thus more efficiently supports the scientific process of the author.

A reference of all key strokes used in this tutorial can be found in Equation Editor Quick Reference. A palette allowing to easily look up key strokes or directly insert parts and symbols from the palette into the document (via doubleclick on a palette entry) was introduced in version 1.3.5. **Command-Shift-P** opens the following palette.

While it is possible to create equations by exclusive use of the

**doubleclick on a palette entry**method we recommend to use the palette as a key stroke lookup tool only and memorize the key sequences of at least frequently used parts and symbols. This boosts the document writing efficiency significantly and with some training allows to enter equations with hand-writing speed.

## Natural editing of equations

Open any Cassiopeia document press Enter once or twice to place the cursor on a new line and then press Command-y to create a new equation.

An empty equation is represented by a small gray rectangle. Note that the equation is horizontally centered automatically. Do not insert tabs or spaces in front of or behind an equation. Cassiopeia takes care of the alignment automatically. The blinking black cursor is gone indicating that we are in formula mode now. Type the letters "y" and "=".

Cassiopeia automatically takes care of spacing within equations as well so don't enter spaces or tabs here either. Note the small red cursor. It moves while you type and indicates the current insertion point within the equation. The equation editor is MathML content markup based. This means that Cassiopeia tries to make sense of what you type. The two characters we have typed make no sense so far. Cassiopeia recognizes the equal sign as a binary operator requiring a left and a right operand. We have a left operand but the right operand is not yet specified. That's why the equal sign appears with a green background indicating an unsatisfied operator.

Enter two more charaters: "3", "x". The green background vanishes. Cassiopaia is satisfied now. Hit Return or Esc to leave formula mode.

Note the autospacing to the left and right of the equal operator. Also note the autospacing between the 3 and the x. Never try to alter this behaviour by inserting spaces and or TABs. LaTeX will take care of presentation issues following its own set of rules anyway when it comes to printing. This allows us to concentrate on content alone.

Now press the left cursor key until the cursor is located directly behind the equation. Then press the left cursor key once again.

This gets us back into formula mode. We have entered the equation from the right. Press the cursor down key and use the left and right cursor keys to navigate through the equation. Place the insertion marker between the equal sign and the 3

and type "5" "x" "+".

Press Enter to leave formuala mode. Equations can be entered from left or right using the cursor keys as described above. You can alternatively singleclick with the mouse on any location within an equation to enter formula mode and place the red insertion marker. Click between the equal sign and the 5.

Now hold down the shift key and press the right cursor key twice. The elements within the equation can be selected like letters in normal text mode.

Press Command-x to cut out the 5x. Then press the cursor left key twice to move to the left of the equation sign and press Command-v to paste.

This still looks like a mess and the green color indicates that something makes no sense yet mathematical-wise. You the cusor left key to place the insertion marker behind the

**y**and insert a

**-**. Then press the cursor right key to navigate to the other side of the equation and remove the

**+**sign.

The green flags are gone indicating that the entered characters could be converted into a valid MathML content markup expression.

## Working with functions

We have shown how to enter and edit equations in the preceeding section. We now want to introduce functions and demonstrate the use of the integrated symbolic algebra system and the integrated plotting engine. Create a new equation with Command-y and type: U, (, t, ), =, U, Ctrl-l, 0, s, i, n, Ctrl-g, w, t <Enter>

In this example we have used Ctrl-l (l = low) to create the suffix for the peak voltage identifier and we have used Ctrl-g to select the greek alphabet and then w to get an omega (see palette for related key strokes). Note that the parantheses around omega t were inserted automatically. And we could very naturally type in the U(t) on the left of the equation without doing anything special. The given sequence of characters was sufficient for Cassiopeia to guess what we mean. Doubleclick on the equation to duplicate it.

Now singleclick into the copy, place the cursor behind the peak voltage, press backspace to remove it and then type Q, Ctrl-l, 0.

Remove everything on the left side of the equation and type Q, (, t, ) there.

Now Command-Shift-Doubleclick on the last equation to raise the equation inspector.

**Differentiate**.

The derivative is generated automatically. Doubleclick on the last equation to create a duplicate. Then in the copy do the following replacements by natural typing and by making use of Ctrl-l to create the suffix.

We have

and therefore

This allows us to write the two equations for voltage and current like so.

Now choose SDM - FunctionGraph2D from the Cassiopeia menu. An empty graph appears at the current insertion point.

Moreover the graph inspector is raised.

Note the textview on left and in the middle of this inspector (below the two Auto checkboxes). Drag the equation for the voltage from your document to this textview.

Do the same with the current expression. Set a range from 0 .. 40ms and specify reasonable values for the coefficients in the tableview in the lower right corner of the inspector.

Select blue on the color panel and drag that onto the row with the voltage expression. Check **Fine** to get a better rendering resolution.

You might want to set a scaling factor of 2.0 for the current expression.

Click back into your document - this populates the graph - and save your changes to the database (Command-s).

Command-Shift-Doubleclick on the graph to open the graph inspector and enter a caption for the gragh, e.g.

**Ideal capacitor in an AC circuit**.

Press Command-p to generate LaTeX for your document.

A quick reference of many symbols and parts can be found in Equation Editor Quick Reference and is also available via the palette (Command-Shift-P).

## News

21.01.2015 | Cassiopeia 1.4.0 released |

14.05.2013 | LaTeX and HTML Generation |

08.05.2013 | Example Paper released |

26.04.2013 | Co-editing in a workgroup |

26.04.2013 | Troubleshooting |

16.04.2013 | Equation Editor Quick Reference |

12.04.2013 | Equation Editor |

04.04.2013 | Links and Bibliography |

01.04.2013 | Books |

30.03.2013 | Documents |

28.03.2013 | Simulations |

16.03.2013 | 2D Graphs |

10.03.2013 | Symbolic Algebra |

08.03.2013 | Getting Started |

07.03.2013 | Installation and Setup |

## Youtube

19.06.2013 | Magnetic Field |

14.06.2013 | Creating Documents |

10.06.2013 | Vector Algebra |

30.05.2013 | Installation and Setup |

30.05.2013 | Blackboard Replacement |

30.05.2013 | Differential Simulations |

29.05.2013 | Installation and Setup |

## Contact

Smartsoft GmbH Advanced Science Subdiv.Sales: sales@advanced-science.com

Support: support@advanced-science.com