Jérôme Belleman
Home  •  Tools  •  Posts  •  Talks  •  Travels  •  Graphics  •  About Me

The Point in Inkscape Symbols

12 Jan 2020

Inkscape supports symbol libraries, offering easy access to commonly-used objects. This post describes what they are, how to use them and create custom ones.

1 What Symbols Are

They're but objects which are accessible from the Object menu → Symbols dialogue ( Shift Ctrl Y ). In your SVG file, they're stored in the defs XML element. In practice, they're in many ways similar to clones, and in effect, you can Edit → Clone → Unlink Clone a symbol ( Shift Alt D ), just like you would a clone. This will result in a group of one object which you may then edit normally.

2 Working with Symbols

You might be wondering what good they are then, in comparison to actual clones. Indeed, if you need to use the same object many times, why not simply make clones of one which is randomly sitting on the canvas? Probably because an object randomly sitting on the canvas isn't as immediate to find as an object neatly organised in the Symbols dialogue. Then again, you could have the discipline to dedicate a layer to your symbols and use that in lieu of the symbol library.

To add the selected object to your document's symbol library, open the Symbols dialogue ( Shift Ctrl Y ) and hit the button. Note how the object which remains on the canvas then becomes of type Symbol.

You can't directly edit a symbol, and unlinking one on the canvas with the intention of editing is not the way to go – try it, and you'll see that other instances of that symbol won't change. What you need to do is, counter-intuitively enough, to remove it from the document symbol library by hitting the button in the Symbols dialogue. In addition to effectively removing it from the symbol library, this will have the effect of adding the corresponding group of one object to the canvas, which you can then edit. Even more interestingly, it will also have the consequence of turning all other instances of that symbol into clones referring to that group of one object, such that editing it will cause them to change as well. Once you're done editing your object, select it and hit the button again. The group of one object becomes a symbol anew, as do all the clones which referred to it.

You can – and probably want to – give names to your symbols, which is done the same way as with any other objects. The difference is only that you select a symbol from the Symbols dialogue, rather than an object on the canvas. Then, Object menu → Object Properties… ( Shift Ctrl O ). Much like working with clones, changing the ID is ill-advised, because that's what's used to refer to the original object. But it's very useful to give a symbol a Title, which will be displayed in a tooltip if you hover your cursor over it in the Symbols dialogue. This is useful if the thumbnail isn't visible enough.

3 How to Create Symbol Libraries

Symbol libraries are nothing more than SVG files located in your ~/.config/inkscape/symbols/ or the /usr/share/inkscape/symbols/ directory. Unsurprisingly, the latter already keeps the standard symbol libraries which are accessible from the Symbol set menu in the Symbols dialogue.

Units are important when creating symbol libraries. In practice this merely means you want to create your library from the default px template. Simply open File → New from Template… to locate it. If you were to use the default template, symbols which you use from other files wouldn't have the correct dimensions.

Draw the objects on the canvas as you normally do and click on the button for the ones you want to make available as symbols. It's not important what you do with the ones you leave on the canvas, they won't be visible when working from other files. You can give a name to your library which will be the one displayed in the Symbol set menu. Open the File menu → Document Properties… → Metadata tab → and set the Title.

Does changing a symbol in a library cause all the symbols referring to it from other documents to change as well? No, because when you use a symbol from another symbol library in a document, it gets copied to this document, in its defs XML element.

4 References