Go to TogaWare.com Home Page. GNU/Linux Desktop Survival Guide
by Graham Williams
Duck Duck Go

The File Menu


The File menu provides the usual New diagram, Open..., Save, and Save As operations. Once again F3 (open) is the keyboard shortcut to open a diagram from a file and Ctl+S (save) is the shortcut to save a diagram to a file.

Image dia-menu-file

With the Preferences... menu item you set the various options allowed by dia (this is the same as selecting File-->Preferences from the main dia window. These options affect new diagrams only, not currently open diagrams. To change options like Snap To Grid for a currently open diagram, use the right mouse button View menu.

The three categories of preferences for new dia diagrams are shown in Figure 24.6.

Figure 24.6: Setting preferences.
Image dia-preferences-interface Image dia-preferences-view Image dia-preferences-grid

Under the User Interface the first option indicates whether the tools in the main window are reset to their defaults after creating a new canvas. The native dia save format uses XML which can be quite verbose. As with many Gnome applications it is common to compress the saved document (using the gzip format) and you can control this behaviour here. dia supports only a limited number of undo levels which can also be set here. Finally, reverse dragging, when enabled here, allows you to drag-select from the right to the left (unlike normal dragging which usually goes left to right) to have a different effect. It selects all objects that intersects the dragged rectangle rather than just those that are fully contained in the dragged rectangle.

View Defaults controls the size and initial magnification of the new window when you create a new canvas. You can also control whether the connection points (the blue crosses) are visible.

Grid Lines can be turned on and off. Objects can be made to snap to the grid (i.e., when you place or move objects they will move automatically to the nearest grid when placed). The size of the grid (both along the x and y axes) can be changed as can the colour and style of the grid lines. Page borders can be displayed on the grid using different colours and line styles.

Export... is used to generate output suitable for other applications with a variety of formats supported. The format is either specified using the option menu or else determined by the filename extension:

cgm Computer Graphics Metafile
dia Native Dia Diagram
dxf Drawing Interchange File: This format is used by other vector graphics applications such as the computer aided design packages like AutoCAD and QCad.
eps Encapsulated PostScript
hpgl Hewlett-Packard Graphics Language
png Portable Network Graphics: This is the standard free graphic format for the Internet.
svg Scalable Vector Graphics
tex TeX PSTricks macros: Diagrams in this format can be used directly in TEX and LATEX documents.
wpg WordPerfect Graphics

Export to the common gif format is not supported because of licensing restrictions placed on users of applications that produce gif images. The use of gif images is not encouraged in the free software community because of this restriction. The png format is a superior replacement.

Export to TeX PStricks

TEX is a sophisticated document typesetting system. The PSTricks TEX packages provide considerable support for PostScript within TeX. This export filter generates a tex file for processing by TEX (although usually LATEX, an easier to use macro package written in TEX, is used). To include the diagram in your LATEX document you will need to import the pstricks package for LATEX and input the actual diagram (as saved in diagram.tex for example:


Depending on the version of LATEX and PStricks you are using, you may need to uncomment some macro definitions in the diagram file. If LATEX gives you the error something like:

! Undefined control sequence. 
<recently read> \setfont

You will need to remove the initial percent sign (LATEX's comment command) from the definitions in diagram.tex and it is best to rename the newcommand to providecommand in all three cases (to avoid problems when including more than a single diagram in the one LATEX document:


All should then work.

When dia is compiled it will be compiled with either internal print support or support through the Gnome printing library. An alternative to printing is to export the diagram as PostScript which can then be printed.

You can scale the diagram to fit the page when printing through the use of the File-->Page Setup... menu. Here you can also set up the size of the page, orientation, and the page margins.

Image dia-page-setup

The usual Close and Exit items are part of the File menu with their common keyboard shortcuts of Ctl+W (close) and Ctl+Q (quit) respectively. Close will close the current document while Exit will exit from dia completely.

Copyright © 1995-2018 Togaware Pty Ltd
Support further development through the purchase of the PDF version of the book.
Brought to you by Togaware and the author of the open source software Rattle and wajig.
Also the author of Data Mining with Rattle and Essentials of Data Science.