Frequently Asked Questions

FAQ logo

Meta-Information

  1. What version of the FAQ is this?
  2. Who maintains this FAQ?
  3. Where can I find the newest version of this FAQ?
  4. Who made this FAQ?

The Dia interface

  1. How can I do anything but creating and moving objects?
  2. I try to change diagram properties, but nothing happens.
  3. I don't have a middle mouse button, what can I do?
  4. How can I set or change an accelerator key for a function in the menu?
  5. How can I set or change an accelerator key for one of the icons in the main window?
  6. What are the five radio-buttons in the Select menu for?

Making diagrams with Dia

  1. How do I add bends to a zig-zag line?
  2. How do I make a zig-zag line go horizontally?
  3. Why can't I resize classes etc.?
  4. Why do elements have a fixed number of connection points?
  5. Why can't Dia rotate arbitrarily?
  6. Why can't I add more connection points to objects?
  7. Why don't the fonts work right?

Saving and Printing

  1. What format is the .dia file?
  2. How can I scale the diagram to fit a page?
  3. How do I use a exported TeX/PSTricks file in my TeX document?
  4. I wish I had nice zigzags and coils as in PSTricks. How could I get them?
  5. How do I put (La)TeX formulas on my diagram?
  6. Why is printing broken?

Compiling

  1. Why can't I compile Dia?
  2. How can I convert the tar file to an rpm?
  3. Why does my copy of Dia for Windows die when I try to load it?
  4. When printing I get many pages of text starting with: %!PS-Adobe-2.0. What to do?

Extending Dia

  1. How do I add new shapes/sheets?

Compatibility

  1. Can Dia open Visio .vsd files ?

Meta-Information

  1. Q: What version of the FAQ is this?
    A: This is version 1.2, modified 6 Feb 2001.

  2. Q: Who maintains this FAQ?
    A: Lars Clausen <lrclause@cs.uiuc.edu> is the main maintainer, but anyone with write access to the dia-web CVS project can update it.

  3. Q: Where can I find the newest version of this FAQ?
    A: The newest version should always be available from the Dia home page at http://www.lysator.liu.se/~alla/dia/.

  4. Q: Who made this FAQ?
    A: This FAQ was put together by Lars Clausen <lrclause@cs.uiuc.edu>. Most of the material came out of the Dia mailing list. The following people contributed more advice: Kerry <needles@industrialmusic.com>, James Henstridge <james@daa.com.au>, Simon Josefsson <simon@josefsson.org>, Jacek Pliszka <Jacek.Pliszka@fuw.edu.pl>, Steffen Macke <sdteffen@yahoo.com>, Robert Campbell <rob.campbell@visto.com>>, and Hubert Figuiere <hfiguiere@teaser.fr>.

The Dia interface

  1. Q: How can I do anything but creating and moving objects?
    A: Like The Gimp, Dia depends heavily on a menu on the right mouse button inside the diagram. That menu contains all the diagram-specific actions and a few other things, so you almost never have to find the menu on the toolbox. A snapshot shows an example of the menu.

  2. Q: I try to change diagram properties, but nothing happens.
    A: The preferences dialog only affects diagrams that are created thereafter. To change grid lines etc., go to the View menu and select settings there. The settings will be saved with the diagram.

  3. Q: I don't have a middle mouse button, what can I do?
    A: Unix (XFree86): If EmulateThirdButton is enabled (which it should be if you have a two-button mouse), you can make a middle-button click by pressing both buttons simultaneously (an action also known as chording). Windows: If you don't have a middle mouse button, hold down the Ctrl key and use the right mouse button.

  4. Q: How can I set or change an accelerator key for a function in the menu?
    A: Highlight the menu item then press the desired key or key-combination. To remove an assigned accelerator key, highlight the menu item then press the delete key. If you wish to reassign an accelerator key, it is not necessary to delete the current assignment first. Simply highlight the new menu item and press the key or key-combination.

  5. Q: How can I set or change an accelerator key for one of the icons in the main window?
    A: These functions correspond to the items in the Tools menu. Set or change their accelerator keys there.

  6. Q: What are the five radio-buttons in the Select menu for?
    A: They determine what happens when you drag-select objects. Normally, only the objects included in the drag area end up selected. By selecting other choices in the Select radio menu, you can change that behavior:
    Union:
    Both the drag-selected objects and the previously selected objects end up selected.
    Intersect:
    The only objects that end up selected are those that were already selected and were drag-selected.
    Remove:
    Those previously selected objects that are in the drag area become unselected.
    Invert:
    The objects in the drag area change selectedness: Unselected objects become selected, selected objects become unselected. The objects outside the drag area are not affected.
    These operations correspond to set operations between the previously selected objects and the drag-selected objects.

Making diagrams with Dia

  1. Q: How do I add bends to a zig-zag line?
    A: The middle mouse button gives an object-specific menu. For zig-zag lines, poly lines and bezier lines, that menu allows you to add and remove bends.

  2. Q: How do I make a zig-zag line go horizontally?
    A: Using the object-specific menu on the middle mouse button, add a segment in the middle, then remove the end segments.

  3. Q: Why can't I resize classes etc.?
    A: The size of classes is decided by their contents, especially the text. Note that you can scale the entire diagram when you print, see the question about page fitting.

  4. Q: Why do elements have a fixed number of connection points?
    A: We've been thinking about how to allow more connection points. Point is, there are several different ways it could be done that all make sense, and we'd like to get the most usable of them, while maintaining backwards compatibility. Note that the standard Line object allows you to add more connection points to it by the middle mouse menu. You can in a pinch place a line along the edge of an object and use the lines connection points:)

  5. Q: Why can't Dia rotate arbitrarily?
    A: Neither X nor GTK has built-in support for rotating arbitrary shapes (text, ellipses etc). Work is being done on a Display Postscript interface that will allow arbitrary rotation. Work is also in progress on FreeType support, which would allow for rotation.

  6. Q: Why can't I add more connection points to objects?
    A:

  7. Q: Why don't the fonts work right?
    A: Font support is not very standard in X, especially when you want to make images, print, and send the files to other people. Until we get something better, you can improve things by installing the urw-aliases package. After installing the package, you will need to do a simple edit of a config file. Edit /etc/X11/fs/config and move the line /usr/share/fonts/default/urw-aliases to just below the ...:unscaled lines (make sure the commas are in the correct places after making the change). Then run killall -USR1 xfs to get the font server to reread its config file. The URW fonts should be used in place of the adobe ones they are clones of when an unscaled bitmap version can't be found.

    Work is in progress to make Dia use the FreeType library to provide better font support.

Saving and Printing

  1. Q: What format is the .dia file?
    A: The native Dia file format (extension .dia) is XML compressed with GZip. You can select not to compress the files in the Preferences.

  2. Q: How can I scale the diagram to fit a page?
    A: In the Page Setup dialog (selected from File/Page Setup), select Fit to:, and the blue lines will continuously self-adjust to fit to a page (or several pages).

  3. Q: How do I use a exported TeX/PSTricks file in my TeX document?
    A: First add \usepackage{pstricks} to the preamble of your TeX document. Then include your image as
    \begin{figure}
    \centering
    \input{filename.tex}
    \caption{A caption}
    \label{figure:alabel}
    \end{figure}
    

    in your document.

    Note: Up to and including version 0.86, Dia doesn't deal correctly with some functions that PSTricks doesn't implement. You may have to change the start of the generated file to look like this: Then uncomment the three commands in the generated TeX file (unless you have a PSTricks with this functionality implemented), so it looks like:

    % PSTricks TeX macro
    % Title: x500name.dia
    % Creator: Dia v0.86
    % CreationDate: Thu Oct  5 11:25:54 2000
    % For: a user
    % \usepackage{pstricks}
    \providecommand{\setlinejoinmode}[1]{}
    \providecommand{\setlinecaps}[1]{}
    \providecommand{\setfont}[2]{}
    ...
    

    Note: PSTricks in the tetex-1.0.6-11 RPM (used in Red Hat Linux 6.2) is buggy. Easiest fix is to get pstricks.tex from CTAN and put it in /usr/share/texmf/tex/generic/pstricks/.

  4. Q: I wish I had nice zigzags and coils as in PSTricks. How could I get them?
    A: Draw them as standard lines in dia. Then in the .tex file replace \psline by \pccoil or \pczigzag. For more information on their arguments look into your PSTricks documentation included in your PSTricks package or at PSTricks home page. Careful! Lines with more then one segment have to be split into separate segments when pccoil and pczigzag are used.

  5. Q: How do I put (La)TeX formulas on my diagram?
    A: Put them as you would put them in TeX, e.g.: $\delta^{\dagger}_2$. At the moment of writing this FAQ it is not yet displayed correctly in dia but TeX code produced should be fine. The bounding-box of the formula will not be calculated correctly.

  6. Q: Why is printing broken?
    A: Dia has several ways to print: Dia print, Gnome print and Export as Postscript. A given compilation of Dia uses either Dia print or Gnome print. Dia's support for Gnome print is currently buggy and disabled by default, but some distributions (Red Hat for one) compile it in anyway. If you have such a version of Dia installed, you can Export as Postscript instead of printing, and then print the resulting file.

Compiling

  1. Q: Why can't I compile Dia?
    A:

    In most cases, it is because you have an old version of a support library. The libraries needed to compile Dia as of version 0.86 are:

    Optional libraries that add extra features:

    Note that if you use some package system (dpkg or RPM), you will need to download the development packages (-dev or -devel).

    Some systems, notably Red Hat and derivatives, don't have /usr/local/lib in /etc/ld.so.conf. GNU applications by default install into /usr/local when compiled. To make Dia work there, either add /usr/local/lib to /etc/ld.so.conf and run ldconfig as root, or configure with --prefix=/usr to put everything in /usr.

  2. Q: How can I convert the tar file to an rpm?
    A: rpm -ta dia-XXX.tar.gz

  3. Q: Why does my copy of Dia for Windows die when I try to load it?
    A: Because the HOME environment variable is not set. Add a line like this to your autoexec.bat file:
          set HOME=c:\home
    then restart your computer and make sure c:\home exists. The path should not contain any spaces and is case-sensitive (c:\Home is not the same as c:\home).

    As of Dia 0.88.1, this problem should no longer happen.

  4. Q: When printing I get many pages of text starting with: %!PS-Adobe-2.0. What to do?
    A: Buy a postscript printer or implement GDI printing ... :-) The other option is to install Ghostscript along with its print redirector so you can have a Windows printer that filters things through gs.

Extending Dia

  1. Q: How do I add new shapes/sheets?
    A: An explanation is given in doc/custom-shapes in the source distribution on how the shape format works.

    However, Dia now also has the capability of exporting a diagram as a shape. Each collection of shapes (called a sheet) should be kept together in a subdirectory of ~/.dia/shapes, e.g, ~/.dia/shapes/Engines. To make a shape, first design it in Dia. Then export it into your subdirectory. Two files will be generated, a .shape file and a .png file (the icon). Next update the corresponding sheet file in ~/.dia/sheets, in this case called Engines.sheet. Example contents of a sheet file is:

    <?xml version="1.0" encoding="iso-8859-1"?> <!-- -*- xml -*- -->
    
    <sheet xmlns="http://www.lysator.liu.se/~alla/dia/dia-sheet-ns">
      <name>Engines</name>
      <description>Mechanical Engines</description>
      <contents>
        <object name="Engines - Gas">
          <description>A gas engine</description>
        </object>
      </contents>
    </sheet>
    
    Each new object should be added to the sheet by adding an object section. Next time you restart Dia, the new objects should show up in the list of sheets.

Compatibility

  1. Q: Can Dia open Visio .vsd files ?
    A: No, it can't. Visio file format is a completely proprietary and undocumented file format. So it is really difficult to write code to read it. By seeing the bounty available at The Free Software Bazaar for a reverse engineering of the file, we suspect it is not an easy task. We really would like to be able to do so.

    An easier alternative would be to make a Visio plug-in that will allow conversion. Other programs have already done this for their proprietary formats. If somebody were to make such a script, we could set up a public server to do conversions.