This month I’m going to rattle through a handful of smaller improvements in Inkscape 1.3 that don’t really warrant an in-depth exploration, but which are worth calling out nevertheless. XML Editor This is the dialog we all love to hate. Ideally there would never be a need to edit a file’s XML data directly. Practically, however, there are some more advanced tricks that can be done only this way, and for anyone creating SVG files to be manipulated by JavaScript on a web page, this can be an invaluable tool. The most immediately obvious change in 1.3 is the addition of syntax highlighting to the DOM tree in the left-hand pane. This makes it much quicker and easier to visually distinguish the elements, attributes and values – assuming you’re familiar enough with XML to know what those terms mean. The toggle to switch between horizontal and vertical layout has been moved into a drop-down at the top-right of the dialog. It’s gained an ‘Automatic layout’ option, too… though that doesn’t seem to work terribly well, as it’s based solely on the dialog’s width rather than its aspect ratio. If you really want a vertical layout for this dialog, better to select it explicitly. The rather useless option to hide the attributes pane has also been removed.
The editing pop-ups have been improved with this release. Selecting a ‘style’ attribute’s value now shows the properties as a vertical list, much like you would use when writing a CSS file by hand. There’s no syntax highlighting in here though, unfortunately. When editing the ‘d’ attribute of a path element of some sort (a list that includes things like stars and spirals, as well as the more obvious Béziers and pencil lines), there’s a small button and pop-up at the bottom of the editor. Clicking the button will round the path values to the number of digits selected in the pop-up, as shown in this before and after image. This is something that can be achieved across a whole document when exporting as an ‘Optimized SVG’, or more generally by adjusting the ‘Numeric precision’ value in the ‘SVG Output’ pane of the Inkscape Preferences dialog (Edit > Preferences), but it’s quite nice to be able to do this on a more ad-hoc basis here. I imagine this might be of use to people creating small icons, for example, who want to ensure that their path coordinates all correspond to whole pixel values.
Touch selection of path nodes ‘Touch selection’ is a long-standing option in Inkscape that is often missed by new users, as it’s not triggered by any obvious button or toggle in the UI. It’s a feature of the Selector tool (F1) whereby holding down the ALT key allows you to draw a thin red line on your page: any element touched by that line will be selected when you release the mouse button. This option has now been made available in the Node tool (F2) as well. ‘Touching’ nodes with the red line isn’t quite as easy as touching entire objects, so this is best used by roughly drawing a line around the nodes you wish to select. Inkscape does a pretty good job of working out which ones you intended to include, and which your line is just passing by, so you don’t have to be terribly accurate, nor do you have to form completely closed loops around the nodes. There’s one big caveat with this feature for Linux users though. It’s something I’ve discussed several times in the past, but it bears repeating: most Linux window managers use the ALT key for window operations. Typically, holding the ALT key and dragging the mouse (with the button pressed) will move the window, rather than activate Inkscape’s touch mode. There are three solutions to this that I’m aware of: • Change the settings for the ALT key in your window manager • Hold the SUPER key at the same time as ALT • Change the keyboard shortcut in Inkscape’s Preferences dialog
I don’t like the first of these, as I don’t believe you should be forced to make a global change to your environment just to support a feature in a single application. But if you find you’re frequently triggering window movements through ALT-dragging in other applications as well, this might be something to consider. Option 2 is not guaranteed to work with all window managers – though it’s done the job with all the ones I’ve used over the years, and is my preferred solution to this problem. Simply hold the SUPER key (the ‘Windows’ key on most PC keyboards) at the same time as ALT for any Inkscape functions that need the ALT key. This seems to be enough to not trigger the window manager’s default actions, but Inkscape usually ignores the distinction and carries on as expected. This typically works well for features that have a long-standing history in Inkscape, but not for newer additions, as we’ll see later. The third option is to change the Inkscape keyboard bindings so that this mode is triggered by a key other than ALT. I’m not a fan of this approach, as it takes you off on a non-standard path to using Inkscape that might lead to confusion when trying to follow instructions, YouTube videos, or even future instalments of this series. But you may prefer it to option 1 if the second approach doesn’t work. The location of this setting is buried within the Preferences dialog (Interface > Keyboard > Modifiers tab > Selection), so you might want to follow the image below as a guide.
Selector tool improvements There’s now an option to enable selecting transparent objects. In the Preferences dialog, expand the ‘Behaviour’ section and click on the ‘Selecting’ entry. The new option is the second one in the pane, labelled as ‘Select transparent objects, strokes and fills’ on my system. Enabling this may avoid a few trips to the Display Mode menu if you have to work with transparent objects frequently. There’s now a way to save and restore the current selection, though it’s not the easiest thing to use. You can access it by pressing the ‘?’ key to open the ‘Commands bar’, then search for ‘selection backup’ to find the commands to set, restore, and empty the saved selection. It works for selected objects or nodes, but you can save only one selection at a time, which somewhat limits its usefulness. I’ve always found Inkscape’s implementation of a command palette to be a bit clunky, so if you do want to use this feature, I’d recommend setting keyboard shortcuts for the set/restore commands, at least.
There’s a keyboard shortcut to reapply the last transform. For example, if you rotate an object by 15°, then press CTRL-ALT-T, it will be rotated by another 15°. Based on what you’ve read so far, Linux users might expect to use SUPER-CTRL-ALT-T to achieve the same result, but unfortunately this is one case where Inkscape doesn’t treat it as the same command. You can reassign this feature to that shortcut (or any other) via the Preferences dialog – search for ‘Reapply Transforms’ in the Interface > Keyboard pane. It might not be immediately obvious to you why you would want to use this shortcut. Surely you could just rotate by 30° in the first place? In theory this could be useful for applying the same transform to multiple objects, one by one. In practice the reapplied transform is based on the same rotation origin as the original object, which makes this less useful for rotating, skewing, and scaling. In the rotation example, using this feature on a second object won’t rotate it in place, but rather may send it shooting off to another part of the canvas entirely, if it’s located some way from the first object’s center of rotation.
A related feature that might prove more useful, though, is ‘Duplicate and Transform’. By default, this is bound to CTRL-ALT-D, but Linux users will probably also have to re-bind this in the Preferences dialog, as adding the SUPER key to the mix doesn’t work by default. With this shortcut, the selected object is duplicated and has the previous transformation applied to it as well. For example you might use these steps to create several objects that are equally spaced: • Select an object. • CTRL-D to duplicate it. • Drag or otherwise move the duplicate to a new location. • With the duplicate still selected, press CTRL-ALT-D (or the keyboard shortcut you’ve set) to create another duplicate spaced apart by the same amount. • Repeat the keyboard shortcut to create a series of duplicates with equal spacing. Unfortunately there isn’t an equivalent of this for creating clones rather than duplicates, which is a slightly odd omission given the next addition to the Selector tool…
You may be familiar with the ability to drag an object around the canvas and hit the Spacebar to ‘stamp’ a copy. With 1.3, you can do the same but pressing ‘C’ instead of the Spacebar, resulting in a clone being created each time rather than a copy. The next feature isn’t exactly part of the Selector tool, but selections play their part. The rulers have been improved to provide a little more information, including some about the current selection. They now have a different colored background to indicate the page boundaries, and a thin blue line, with circles at either end, to indicate the size and position of the current selection. I’m not sure how useful it is to be able to see the size of the selection at all times, but it doesn’t hurt either. More beneficial is the fact that you can now right-click on a ruler to set the document units, rather than having to do so via the Document Properties dialog. As this is a global setting for the document, it also affects the units used for number fields elsewhere in the application. If you have to switch between multiple units in the same document this will certainly be faster than opening a dialog.
Pasting options The options for pasting in Inkscape have increased over the years. As well as the most common case of pasting objects that have been copied to the clipboard, additional capabilities have been added to allow just pasting the width or height, for example, which lets you easily set one object on the canvas to the same dimensions as another. With this increase in options, the Edit menu was starting to get a little long, so all the ‘special’ pasting modes have been moved to a separate sub-menu, simply called ‘Paste…’. This should not be confused with the normal ‘Paste’ menu entry just above it (which has no ellipsis after the name), which is the one to use for simply pasting an object onto the canvas. The new menu contains these options: ‘In Place’ will paste the object back at exactly the same coordinates from which it was copied. While this may seem the same as simply creating a duplicate, the difference is that you have the opportunity to change layers, enter/exit a group, or even switch to a completely different document before pasting. I often use this to remove individual objects from within a group, but put them back at the same location so that the drawing looks the same, even if the structure has changed a little.
‘On Page’ is new with version 1.3, and is similar to ‘In Place’ except that it is relative to the current page in a multi-page document. This can be used to copy an object from one page to exactly the same place on another (e.g. a common header or border). Before using this, the destination page has to be made ‘active’ by selecting an object on it, selecting the page itself using the Page tool, or by changing the current page using the pop-up menu in the status bar (which is only visible if the document contains multiple pages). The next three size-related entries are pretty simple. Copy an object to the clipboard, then select another object on the canvas. Select Edit > Paste… > Width to change the width of the selected object to match that of the copied object. ‘Height’ behaves similarly, and ‘Size’ sets both the width and height at once. If, before choosing these paste options, you select multiple objects rather than just one, the behaviour may not be quite what you expected. The width/height/size is applied to the entire selection, rather than each individual object. If you want that behaviour, then the last set of options will provide you with the desired result. If you have only one object selected, then either set of options will give the same effect.