Format Reference

The Notebook Format

Notebooks are simple text files. They use the an 8-bit character code as predefined on the system, where the Euler file was saved. Since the Euler core can be restricted to use 7-bit ASCII only, all commands can be exchanged between all systems. The exception to this are the degree character ° and the ± character, which might not be displayed correctly on some character sets. And, of course, comments can contain any character of the current set. In future versions, Euler might get a way to safe in UTF-8, or even use Unicode globally.

Notebook files consists of

Comments are formatted in paragraphs, when the user edits the comment. The paragraphs are broken into lines, depending on the width of the notebook window. However, when reading an Euler file, the layout as given in the file is used. Paragraphs can be separated by empty lines, but this needs not be the case. To indicate a new paragraph without an empty line, the comment line starts with %%. A header line is saved as "% * ..." just as in the comment editor.

Command lines are recognized by >. Lines of a function definition are recognized by the $.

Any other character starts an output line. If the user manages to print % or > as the first character in the output, a blank is inserted to mark the line as an output line.

Images are special output lines, starting with " %image% ". Following this start string the file name is expected. When loading, the images is searched in the directory of the notebook, or in a sub-directory "images". When saving, the position of the image is determined by the global setting to save images in a sub-directory or not. This settings also determines the first place to look for an image while loading the notebook. Note that images loaded with "loadimg" are saved additionally in the output size, the notebook has assigned to them.

CSS Styles for HTML Export

When exporting a notebook to HTML, Euler uses CSS styles for the various elements of the notebooks. The CSS styles are defined within the HTML page in its header section. If a pattern file is used (see below), the pattern page is responsible to define the proper CSS styles.

Currently, Euler uses the following style definition.

<style type="text/css">
pre.output { font-family : "Courier New", monospace; 
  font-size : 10pt; margin-left: 20px; }
pre.udf { font-family : "Courier New", monospace; 
  font-size : 10pt; color : #007; }
pre.prompt { font-family : "Courier New", monospace; 
  font-size : 10pt; color : #700; }
pre.comment { font-family : "Courier New", monospace; 
  font-size : 10pt; color : #060; margin-left: 20px; }
h1.title { font-family : arial, sans-serif; 
  font-size : 16pt; color : #000; }
h1.comment { font-family : arial, sans-serif; 
  font-size : 12pt; color : #000; }
img.euler { margin-left:20px; }
</style>

This styles are used in the notebook export.

Note that the first line of the first comment has been translated into the title line. Other header lines in comments (starting with "* ") are exported as h1 with class comment.

Pattern files

Pattern files for HTML export are simple HTML pages, containing a line with just the character "#". This line is replaced by the HTML export of the notebook. The export uses the CSS styles listed above. The pattern file is responsible for the definition of these styles.

Euler Files

Euler files are collections of Euler commands. They are loaded into the Euler system with the "load file" command. The files are simple text files, and can be edited with any text editor. Euler comes with a Java editor with syntax highlighting for Euler. Press F10 in the line containing the "load file" command to start the editor. Note, that Euler files will be found, if they are saved in the same directory as the notebook, or in a directory contained in the Euler path. This path can be set with the path command (see "help path").

Function definitions need not be preceded by "$" in each line, as in the Euler editor. They simply start with function, and end with endfunction (with the exception of one line functions).

Euler files can contain a comment section. It starts with a line "comment" and ends with a line "endcomment". Comments can be printed, when the file is loaded. To list the content of an Euler file, use "help file.e".

Euler load commands can be nested. So one Euler file can load anther. The file "euler.cfg" is loaded at each new start of Euler. It loads a lot of Euler files in the "util" directory.