GUI and Menu Reference

This is a technical description of some aspects of EMT. For an introduction to the GUI, see

Editors

Internal Editor

The internal editor starts with F9. It can edit

depending on the content of the line, where the editor was started.

If the line contains a load command for an Euler file, such as

>load myfunctions

the internal editor will open that file. The editor and the load command assume that the default file extension is "*.e". The file will be in the same directory as the notebook. The editor is modal, i.e., Euler cannot be used, while the editor is active. To end the editor, press OK with the mouse, or the tabulator key and then the return key. To enter a tabulator position in the editor, use ctrl-tab.

If the line is empty, the editor will open a temporary file in the user directory. Once, the editing finishes, Euler will write a load command for the temporary file into the command line. Of course, this is only useful for tests of functions.

If the line starts a function definition, such as

>function test (x) ...
$  if x<0 then return x^2
$  else return x^3
$  endif
$endfunction

the editor will edit this function definition. To start a new function, type "function" into an empty line, and press F9. In case of multi-line functions, the editor will append "..." to the fist line. Thus the function can be compiled with a single stroke of the enter key. To format the function definition, you can use two spaces as indent.

If the line the editor is started in is the first line of a group of lines (multi-line command), the editor will edit the group at once. A group of lines is a sequence of lines ending with "..." (besides the last line). The group can be executed by pressing return in any of its lines.

If the line contains any other content, the editor can be used to edit this content. If the result contains more than one line, those lines will be inserted into the text window.

External Editor

The external editor can only be used to edit external files. It starts with the F10 key.

A good way to use this editor is to start it in a line containing a load command. In this case, the external editor will work like the internal editor (see above). The external editor is not modal, and Euler can be used, while the editor is running. To load the file, place the cursor into the line with the load command, and press return.

To start a new file, place a load command into a command line, and press F10. The editor will probably complain about a missing file. Save the file under the desired name.

The external editor starts in the current directory, and most probably will save the file there. The current directory is set by loading or saving a notebook.

The external editor can be any text editor. Office programs like Word cannot be used for Euler files. Euler comes with a Java editor written by the same author. This editor has a syntax highlighting mode for Euler, C and Python files. But it is possible to use any other editor. To configure the external editor, open the setup program from the Extras menu. You need to provide the path to the executable file of the editor and optional command line parameters. Use a full path to the executable, unless it is in a directory from the windows default path. An example would be "notepad.exe".

Status Line

The status line shows help for the current command. While you are typing the command name, it shows a list of all available commands. For Euler commands, this includes your functions. Press the insert key to  auto complete the name of the command. Press it several times to get other choices.

If the cursor is immediately behind the opening bracket of the command, the status line will display the help for the function. For Euler functions this is the first line of the help section (lines starting with ##). For built-in functions the line is derived from the file "help.txt". This text file is the one that it also available in the reference.

The Menus

File Menu

Restart Euler will delete the current notebook and the graphics, start with a new notebook, clear all variables and functions, load the pre-defined Euler functions, stop and start Maxima or Python, and reset all graphics settings to their default values. If Euler is in permanent Maxima mode, it will start in that mode. Do not delete the first line indicating that mode!

If you open a notebook, Euler does a restart by default. This can be switched off. Opening a notebook in the user home directory will redirect the file dialog to the sub-directory "Euler Files" of the user home directory. For portable Euler installations (see here), it will open in the sub-directory "Euler Files" of the Euler home directory.

If you save the Notebook under another file name, Euler offers to delete the previous notebook. This will delete all images belonging to the notebook too. Images embedded in the text window are either saved in PNG files along with the notebook, or in a sub-directory "images", depending on a setting in the Options menu.

You can create a ZIP archive with the following files: name.en, name*.e, name*.dat, name*.html, name*.png, images\name*.png. This is just a convenience to send the notebook with all files by mail. The archive cannot be opened by Euler. The command only updates the files, and does not delete any other files in the archive. The archive is generated in the notebook directory.

Loading an Euler file can be done with the "load" command. But there is also a menu entry for that, which will insert a load command into the notebook.

Graphics export was explained in more detail here. The clipboard can be used too. The clipboard can receive either a bitmap format, or a WMF (windows metafile) format. Both can be inserted into Word documents, e.g.

Exit the program with the menu entry, by closing the window, or with the command "quit". The quit command, however, will not ask for confirmation. The confirmation can be switched off completely in the Options menu.

To print a notebook, export the notebook to HTML, and print from a browser. The "Print" entry in the File menu prints only the graphics on one of the system printers. You can add a text below the graphics.

Recent Files

This menu contains the names of the recently opened notebooks. The directories of these notebooks are stored, but not displayed in this menu. The list is saved in the Windows registry, or, for portable installations, in the Euler home directory. There is an option to clear the list.

Edit

If a line has been modified, it can be restored. This works only for one previous state of the line. Euler does not have a complete undo at this time. However, you have access to the history of previous commands with ctrl-cursor up. Moreover, lines deleted with alt-backspace can be restored with alt-u (see below).

There is a option to run commands automatically. This will stop at each error, and at each empty line. With the second menu entry or with shift-return you can run the subsequent commands, and return to the current cursor line afterwards. This updates the rest of the Euler file for a change in one of its lines.

This menu contains some cut, copy and paste commands. To mark a portion of the Euler notebook, hold down the shift key and use the cursor keys. Then you can copy the content in three formats: ctrl-c is the internal format, shift-ctrl-f is a format for printing, and shift-ctrl-c copies the commands only. To insert from the internal format, use ctrl-v as usual. To insert the text as commands, use shift-control-v. This is useful, if you have an Euler file with commands, and want to insert them into a notebook. Note, that lines of a function definition must start with a $.

You can also copy images to the clipboard. Double click the image to mark it. Then press ctrl-c. Pasting images into Euler notebooks does not work. You can load images into comments with a like "image: filename", or into the command out with the loadimg(filename) command.

It is possible to search in an Euler notebook. Use the dialog for the first search, and F3 to search for more places. Note that the cursor is not moved to the search results. Use the mouse to position the cursor there. F3 will start over after the last occurrence.

Output of commands is removed automatically, if the command is executed anew. But it is possible to remove selected or all output.

There is a sub-menu for commands, which change the command line. A command line can be split into a group of two lines with ctrl-return. To insert a new empty command line use alt-insert, and to delete a command line use alt-backspace. Deleted command lines can be inserted back using alt-u at any other place. To clear a command line, use ctrl-backspace.

Another sub-menu contains commands for the command history. This history contains the recent commands. To recall a command use ctrl-up, to go the next command, use ctrl-down. To reset the history pointer to the current command, use escape.

Extras

Comments have been discussed here.

The internal or external editor can be started in this menu. These editors have been discussed in more detail here and here.

This menu contains some shortcuts to insert commands into the text window. Use it to insert a function definition, and start the internal editor immediately, as described here. There is an option to insert the insimg command, described here. The option to insert graphics from the clipboard works well with the snipping tool of windows. The file will be saved and a "loadimg" command will be inserted into the current notebook line.

There is a menu entry to convert an Euler file to HTML. This is mainly for documentation. The HTML file can be linked from a comment using a line "See: filename.e". The Euler file can provide comments. For examples, have a look a the Euler files in the util folder of the installation.

HTML Export: Euler notebooks can be exported to HTML. These exports can be viewed with any web browser.

Euler will use imbedded CSS styles for the export. However, it is also possible to use a pattern file. See this example for such a pattern file. The necessary CSS styles can be found here. The first line of comment is used as the header. Other lines in the comment can be made to sub-headers by starting them with a "* ...". For convenience, there is a menu entry, which saves the file and exports at the same time.

If you intend to print the HTML page, you should use a browser that does not break images across pages. Moreover, you may wish to switch on "Keep large images for HTML export" in the settings of the graphics. This takes a more space and a longer time for saving, but the graphics are nicer. For Latex formulas, there is a similar switch, which is on by default.

This menu contains everything necessary to export notebooks to HTML or PDF. The details are explained in the export documentation.

Options Menu

The first option here is to resize the graphics window, so that the 2D plots appear square, if the coordinate space is square. This will change the height of the graphics window.

The sub-menu with program settings contains switches for confirmations, for the automatic restart of Euler, when a notebook is loaded, and to use the status line or not.

Memory Sizes: Moreover, there is a settings dialog for the memory sizes, which Euler uses. Simply use the defaults. The memory is limited to 512 MB and the graphics memory to 128 MB, until a Windows 64 version of Euler is available. Higher values cause instability of Euler in Windows 32.

Browser Command: The browser command for the options menu can be set with this menu entry. The "Default" button clears this strings. In this case, Euler determines the default browser from the registry. If this does not work, or if you want to use another browser, you can set the path to the browser here.

You can also select your Euler documentation here, or use "http://www.euler-math-toolbox.de" to use the web sites of Euler. You need to point the browser to the documentation directory with the sub-directories reference, documentation etc.

The graphics sub-menu contains switches to scale the line thickness in large bitmap exports (see here), to prevent saving images of notebooks at all, to save the images in a sub-directory or in the notebook directory, and to save a bb-file along with PNG images. A bb (boundary box) file is a small file necessary for Latex and the graphics package, which describes the image size. If you do not know, what this means, you probably do not need a bb file.

The Euler text window should be fixed to 80 columns to provide compatibility between notebooks. However, this can be released. You need to restart Euler. Note that the HTML export of your notebooks will have the same format as your Euler text window. Usually, broad HTML pages will look bad, and be unreadable.

Colors: There is a sub-menu to set colors and fonts. You probably should not change the 16 default colors of Euler, since you can use any color in your drawings with the rgb command.

Fonts: You might want to change the font for the text and graphics window. See the installation for details.

The Maxima sub-menu contains a switch to start Euler in Maxima mode. If this switch is on, Euler will be set to Maxima mode, whenever it starts or is restarted. All commands are sent to Maxima, either directly or in compatibility mode. To send a command to Euler in this mode, start the command with "euler". Notebooks saved in this mode must contain a special text in the first line. So, do not delete this text. Otherwise the file will not load in Maxima mode. The switch to use the direct mode refers to this automatic Maxima mode, and also to the maximamode command without parameters.

Maxima inserts output labels. These labels do not make sense in a notebook environment, since they change, when the command is executed again. So they are removed by default.

Of course, Euler needs to find Maxima, to start this sub-system. If you want to use your own Maxima version, you have to adapt the Maxima command. This is only recommended for experts. You have to insert the full path to the maxima.exe file in your Maxima installation. The Maxima directory is the directory containing the info and share folders.

Maxima can either be started at each restart automatically, or if needed. Then, the first command for Maxima will take a bit longer. By default, the direct mode for Maxima is disabled, since I want to discourage starters to use this mode, and moreover, it introduces the chance of errors.

Yacas is disabled by default, since I consider it obsolete. Yacas can also be started automatically, or on demand.

The sub-menu with switches for the strict mode tries to balance downward compatibility with security. Euler used to be more flexible. But a more strict syntax is far better to keep the control. Some of these restrictions do not affect Euler commands inside functions, only in the command line, and others can be relaxed for all functions contained in an Euler file. Use the relax command for this. Change the following switches only, if you really need.

Maxima and Euler

These Menus contain commands that can be inserted into the command line at the cursor position. The commands contain placeholders, marked with a question mark. If the user starts typing at a placeholder, the placeholder will be removed. To go the next placeholder, press the cursor left key.

User

This menu works like the Maxima and Euler command menu. The commands "addmenu" and "submenu" add command items to this menu. Some Euler files in the example section contain a list of menu items to assist the user. Try "load geometry" for an example. Here is an example for Yacas:

submenu Yacas
addmenu yacasmode on
addmenu yacasmode off
addmenu D(?var) ?expression
addmenu Integrate(?var) ?expression
...

The menu is cleared at each restart of Euler.

Help

Here you can open the help window, or sections of help in the browser. You can also open the the search on the Euler home site.

There are some direct links to browser pages. You can find these pages also from the start of the help.

The version information has a button to open a browser, and go the web page of Euler. You will see the recent version changes. Compare the current version number with your version number, as printed in the version dialog.

Parameters for Euler

The command "euler.exe" can accept the following parameters.

Euler can be reset to the default values with a menu entry in the Options menu (or with the "-reset" flag in the command line). This may be necessary, if you experience problems with any advanced settings you did. Resetting will also clear the recent file list.

Euler can run scripted. For this, use the following command line.

euler -script eulerfile.e parameters ...

This will run the command in the file and exit Euler. The parameters can be read with the eulerarg() function, where eulerarg(1) is the first parameter.

In scripted form, Euler will start Maxima only on demand. Moreover, all Windows will be hidden. You cannot pipe to or from Euler. Output must go to files and be read from files. Note, that there are command to save images to files (savepng etc.) and to save the output to a file.

The following is an example of a script. The files output.txt and output.png can be found in the sub-directory Euler of the user home directory.

dump(eulerhome()+"output.txt");
expr&=diff(sin(x)*exp(x),x),
"Integral from 0 to pi = "+integrate(expr,0,1),
"Exact = "+(sin(1)*E),
plot2d(expr,0,1);
savepng(eulerhome()+"output.png");
dump;

File Formats

Euler tries to keep downward compatibility as much as possible. There have been some changes in the command syntax, but most of them are restrictions which can be released, if needed. The file syntax has also been extended over the years, but old files should read into recent Euler versions.

The following two Euler files could be interesting for users.

These formats are explained in the Format Reference.