# The Interface

## First Steps

From the user viewpoint, Euler looks like a command shell in a text window. Commands can be entered and executed, and the output will appear below the command. Moreover, each command can have a comment section above the command.

There is a second window, the graphics window, for the graphical output of Euler. The current graphics in the graphics window can be inserted into the text window at the current line. The graphics window can optionally be hidden (Ctrl-G). Then the graphics will be displayed in the text window on request.

All commands in the text window can be edited and executed in any order. It is also possible to add comments using a special comment editor. We refer to the content of the text window as a notebook. Notebooks can be exported to HTML pages.

The following are two commands (in red) and their output (in black).

>1+1
2
>exp(-0.5)*sin(3/2*pi)
-0.6065306597126 

If you make a mistake, go to the error with the mouse or the cursor keys, and correct the input. Press return anywhere in the line to start the computation. You cannot edit the output of a command.

For a next step, I suggest opening the introduction notebooks in the program. Use the help menu to find the introductions. They should be contained in the Euler installation. After reading a few of these introduction notebooks, you should have a very good idea of Euler.

## The Interface

The interface of EMT is relatively simple with its text window and its graphics window. The text window has the usual menu, the notebook area and a status line. The graphics window has no menu. Both windows can be sized and positioned. EMT will remember this depending on the current screen size to take care of varying displays. On small screens, EMT will fit the windows into the visible area. Try pressing F11 arrange the window to fill the screen. The font in the notebook can be enlarged with Ctrl-F11 for presentations. Of course, the font can also be changed permanently in the menu.

There is a special mode, where the graphics do not use a separate window to save screen space (set with Ctrl-G). Then the graphics can be viewed by pressing the TAB key. Moreover, the graphics can be inserted into the notebook easily with a colon : at the end of the command line.

The advantage of such a simple interface is that it is not complicated to learn. The disadvantage is that it does not offer graphical icons listing all the available commands. These restrictions are necessary since it is impossible to squeeze all commands or options of Euler and Maxima into menus or icons. However, there is a reference and extensive help is available. Press F1 to open the help window for a start.

The graphics window contains the current graphics. It can be resized. By default, all graphics are square. To get a non-square aspect ratio, there is a menu item to release the square aspect ratio premanently or to set a specific aspect ratio. Alternatively, you can use the aspect() function of EMT. There are examples for this command in the tutorials.

The contents of the graphics window and the notebook can be exported in various formats. Among these is a HTML output for web pages.

A second window for EMT can be opened with Ctrl-Shift-O. This window has not graphics window and will not save any settings.

## The Command Line

All commands are entered into the text window in the current command line. The commands are in dark red and start with the prompt >. The user cannot delete the prompt >. Furthermore, the text window may contain comment sections in green color, and function definitions in blue color.

The following items can be joined to a command line

• a comment section (edit with F5),
• output of the command (generatedby EMT),
• an image (usually inserted with a colon : at the end of the line after a plot command).

Enter commands just like in any other program, which uses a command shell. Use the arrow keys or the mouse to move the cursor. The Ctrl key together with the cursor moves the cursor word by word. Have a look into the edit menu for more options. Press the enter key anywhere in a line to execute the command.

The commands have a history. To replace the current command with a command in the history, press Ctrl-Up. Of course, you can also cut and paste commands.

The command line can contain more than one command. Separate the commands with a

• comma , plus a blank (prints the result of the previous command),
• a semicolon ; plus a blank (prevents printing).

A comma at the end of the command line can be omitted and prints the result.

Command lines can be broken into several lines using "...". These lines execute together as one line no matter where the cursor is inside any of the lines. We refer to this as a multi-line command.

>plot3d("x^2+y^2",a=0,b=2,c=0,d=2, ...
niveau=0:0.5:8,zlabel="x^2+y^2",angle=-60°)

To split a command line at the current position, use Ctrl-Return, or press F9 to call the command line editor, and break the lines there. To join command lines, press Ctrl-Back at the start of the second line.

Here is a list of key, which can be used in the command line.

 F1 open the help browser. left, right moves the cursor one character ctrl-left, -right move the cursor one word home, end moves to the line ends up, down to the previous and next command page up, down position the text in the notebook ctrl-end, -start go to the last or first command ctrl -up, -down tecall previous command, or next command return dtart the command escape dtop the current computation or output of a long matrix ctrl-return dplit the line into a multi-line command or edit function tab dhow the graphics screen shift + arrow keys mark text ctrl-c ctrl-x ctrl-v vopy text or an image and paste text or commands. ctrl-alt-f vopy the notebook commands formatted ctrl-alt-c vopy the commands only ctrl-alt-v paste the clipboard lines as commands ctrl-backspace rmpty the current line insert auto complete the current string F5 edit the comment F9 start the internal editor F10 start the external editor F12 spell check the notebook alt-Backspace delete the line. alt-u insert all deleted lines alt-Ins insert a new line. F7 insert the degree symbol F8 insert the +- symbol shift Fx insert a macro text ("setkey(n,text)") ctrl-n restart Euler ctrl-o open a notebook ctrl-s save the current notebook shift-ctrl-s save the notebook under a different name ctrl-e save the notebook, and export the notebook to HTML alt-F4 exit Euler ctrl-z Restore the current line ctrl-r Run all commands from here, update comments shift-return run all commands in the current section ctrl-f search text in the notebook F3 Search the next occurrence

To add a comment to a command line, start the comment editor with F5. The command editor is a simple text editor, which simply uses lines of text. The lines are then broken into lines of length 80 by default for the Euler notebook. To make paragraphs, use an empty line.

Comments can be checked for correct spelling in the English or German language with F12. The word list for this is "english.words" in the installation directory, resp. "german.words" for German spelling. Words, that are correct, but are not in the dictionary can be added to a user dictionary "user.words" located in the Euler subdirectory of the home directory of the user. Euler will add all unknown words from a notebook to this dictionary.

Comments can contain headings, subheadings, images and images derived from Latex formulas. Here are some examples for the syntax of tags.

* This is a Heading

This becomes a formula:

latex: \sum_{k=0}^n x^k = \frac{1-x^{n+1}}{1-x}

- This is a list of things.
- It will be exported as an unorderded  list in HTML.

This is a geometric construction done with C.a.R., and the
screen dump was saved as PNG.

image: geometrie.png


The green parts are comments, as they appear in the comment editor. Here is an example as it appears in the notebook window.

You need to have a valid Latex system installed to generate Latex formulas. For more information see the installation guide.

latex: \integrate(x^2,x) = \frac{x^3}{3} + c
maxima: 'integrate(x^2,x) = integrate(x^2,2)+c

The second line runs the result through Maxima and uses the output of the tex command in Maxima to get the formula, which is then run through Latex. You can also use it to format the content of a symbolic variable in Latex in a comment.

---

It is also possible to set links for the HTML output in comments. The following two types of links refer page.html in the current directory, and to an internet link.

See: page
See: page | display text
http://www.link.com

Simple comments can be appended to the command line using //.

>sum(1:1000) // computes the sum from 1 to 1000
500500 

If an expression is too long for one command line, or does not look well in one single line, it can be continued into the next line with ..

>a:=1;
>b:=(1+a+a^2+a^3)* ..
>  (1+2a+3a^2)
24
>plot2d("x^y",a=0,b=3,c=0,d=3, ...
niveau=-10:0.1:10, ...
title="x^y");

If lines end with three dots ..., Euler will execute the complete command at once (see above in the section about multi-line commands). This will work, even if the cursor is in the second line of the multi-line command. An internal editor (started with F9) can be used to edit such lines in one step.

Text in the text window can be marked by dragging the mouse over it. Marked text can be copied to the clipboard. The copied text can then be inserted into the current command line, if it is less than one line, or in front of the current command line, if it contains several lines. This is also a quick way to send Euler commands by mail.

There are special menu entries to copy commands only, or to copy a formatted version of the notebook. Copying commands only is designed to generate an Euler file from the marked commands. It will not contain any output. Formatted copying is good for generating documentation files for Euler. The output can still be pasted back to Euler.

## Notebooks

The content of the text window is called a notebook. Notebooks can be saved in a simple text format, or exported to HTML for web pages or printing. Notebooks can contain commands, Euler output, comments, and images. If a notebook containing images is saved, the images are saved in separate files in the PNG format.

Saved notebooks must have the extension *.en. These files are ordinary text files. However, it is not recommended to edit notebooks with an external text editor. The character encoding of the notebooks is the current encoding of the system the notebook was saved with. Notebooks with comments in foreign languages may not look well in wrong encodings.

You can save notebooks in Unicode, if you like. Then the notebook will be translated into the encoding of the user, when it loads. Some characters may be distorted or missing.

Images will be saved in separate files in PNG (portable network graphics) format, and are referred from the notebook file by file name.

By default, Euler performs a fresh restart when a notebook is loaded. This can be disabled with a switch in the options menu. A restart affects Maxima too. The Maxima process ends, and by default starts again. In case Euler crashes (hopefully never), you may want to kill the pending Maxima process.

## Euler Files

If you want to develop longer and more complicated programs, it becomes useful to put all function definitions and all commands into external Euler files. These files should have the extension *.e, and can be loaded into Euler with the load command.

Files in the current directory will be found by their name. The current directory is the directory, where the current notebook is loaded from or saved to. Otherwise, use the full path the file, or include the directory of the file into the Euler path.

>load dof
>help "dof.e"

Euler file C:\euler\\docs\Programs\Examples\dof.e found.
File contains the following definitions:

function enddof (d, f, cf, a, c=0.00002)
## Far limit of DOF

function startdof (d, f, cf, a, c=0.00002)
## Near limit of DOF

function dof (d:real vector, f:real vector,
## DOF interval

function hyperfocal (f, cf, a, c=0.00002)
## Hyperfocal distance

function coc (od, d, f, cf, a)
## Circle of Confusion

Some Euler files start with comments, which are printed in the text window. This can be switched off with ;.

>load dof;

For more information about the functions in an Euler file, use the help command with the file name.

Comments in the Euler file must be written between comment and endcomment. There also are other ways to comment an Euler file. Here is an example of an Euler file.

comment
This text is shown when the file loads.
endcomment

/*
Multi-line comment
Some variables:
*/

g:=9.81; // earth gravitational acceleration
t:=2.5; // time
s:=1/2*g*t^2; // height

// Output of s:
s, 

Save this file into a file named test.e, and load it with the load command as follows

>load test
This text is shown when the file loads.
30.65625 

All output of the load command will be printed at the current command line. The commands in the Euler file are not inserted into the current notebook, when the file is loaded.

Euler files can be edited with the internal or an external editor. To call the internal editor, use the menu item, or press F9. A dialog will open. If the editor is called in a line which starts with a load command, it uses this file.

The editor edits the file EulerTemp.e in the user directory, if it is started in an empty line. However, other files can be loaded into the editor, or the editor file can be saved to some other file.

The external editor works with the load command too. But it cannot edit function definitions, or command lines. The default external editor is JE, a Java based editor, which is installed with Euler. However, you can configure any other editor of your choice. Euler does not wait for the external editor to finish. You can leave the editor open, switch to Euler, and run the load command there. Do not forget to save any changes in the external editor.

The external editor will find the file in the current directory, i.e., the directory of the current notebook. For other files, use the full path in the load command, and press F10.