Compound Documents
Contents
What is a compound document?
Working with compound documents
Editing compound documents
Compound documents and e-mail
Printing compound documents and Doodles
Reading in text files
What is a compound document ? [top]
A compound document contains various types of information (formatted text, tables, formulae, plots, graphs etc) displayed in a single window and stored in a single file. The tools needed to create and manipulate these information types are always available, so there is no need to continuously move between different programs. The WinBUGS software has been designed so that it produces output directly to a compound document and can get its input directly from a compound document. To see an example of a compound document click here . WinBUGS is written in Component Pascal using the BlackBox development framework: see http://www.oberon.ch.
In WinBUGS a document is a description of a statistical analysis, the user interface to the software, and the resulting output.
Compound documents are stored with the .odc extension.
Working with compound documents [top]
A compound document is like a word-processor document that contains special rectangular embedded regions or elements, each of which can be manipulated by standard word-processing tools -- each rectangle behaves like a single large character, and can be focused, selected, moved, copied, deleted etc. If an element is focused the tools to manipulate its interior become available.
The WinBUGS software works with many different types of elements, the most interesting of which are Doodles, which allow statistical models to be described in terms of graphs. DoodleBUGS is a specialised graphics editor and is described fully in DoodleBUGS: The Doodle Editor . Other elements are rather simpler and are used to display plots of an analysis.
Editing compound documents [top]
WinBUGS contains a built-in word processor, which can be used to manipulate any output produced by the software. If a more powerful editing tool is needed WinBUGS documents or parts of them can be pasted into a standard OLE enabled word processor.
Text is selected by holding down the left mouse button while dragging the mouse over a region of text. Warning: if text is selected and a key pressed the selection will be replaced by the character typed . The selection can be removed by pressing the "Esc" key or clicking the mouse.
A single element can be selected by clicking once into it with the left mouse button. A selected element is distinguished by a thin bounding rectangle. If this bounding rectangle contains small solid squares at the corners and mid sides it can be resized by dragging these with the mouse. An element can be focused by clicking twice into it with the left mouse button. A focused element is distinguished by a hairy grey bounding rectangle.
A selection can be moved to a new position by dragging it with the mouse. To copy the selection hold down the "control" key while releasing the mouse button.
These operations work across windows and across applications, and so the problem specification and the output can both be pasted into a single document, which can then be copied into another word-processor or presentation package.
The style, size, font and colour of selected text can be changed using the Attributes menu. The vertical offset of the selection can be changed using the Text menu.
The formatting of text can be altered by embedding special elements. The most common format control is the ruler: pick option Show Marks in menu Text to see what rulers look like. The small black up-pointing triangles are tab stops, which can be moved by dragging them with the mouse and removed by dragging them outside the left or right borders of the ruler. The icons above the scale control, for example, centering and page breaks.
Vertical lines within tables can be curtailed by inserting a ruler and removing the lines by selecting each tab-stop and then ctrl -left-mouse-click. (Warning: removing the left-most line requires care: there is a tab-stop hidden behind the upper left-most one that can cause a crash if deleted in the usual way - it seems to require a ctrl - right -mouse-click!).
Compound documents and e-mail [top]
WinBUGS compound documents contain non-ascii characters, but the Tools menu contains a command Encode Document which produces an ascii representation of the focus document. The original document can be recovered from this encoded form by using the Decode command of the Tools menu. This allows, for example, Doodles to be sent by e-mail.
Printing compound documents and Doodles [top]
These can be printed directly from the File menu. If postscript versions of Doodles or whole documents are wanted, you could install a driver for a postscript printer (say Apple LaserWriter), but set it up to print to file (checking the paper size is appropriate). Alternatively Doodles or documents could be copied to a presentation or word-processing package and printed from there.
Reading in text files [top]
Open these from the File menu as text files. They can be copied into documents, or stored as documents.