Saturday, February 28, 2015

A few tips for working with Word 2013

Over the past few weeks, I've been bunkering down to write up a big chunk of work I've been doing for my thesis studies. To make it a bit easier for dealing with some of the journals that this will eventually get published in, I've been doing this work in Word again, having previous stuck to Latex for 3-4 years (with brief stints with LibreOffice).

While I do still prefer to do large docs in Latex (large docs being more manageable when you can just split them up into a collection of small files which can be accessed quite easily, not to mention the nicer reference management, and safe in the knowledge that your images won't disappear or become randomly detached from their captions after a single keypress), and waver between liking LibreOffice and then dropping it again a few weeks later after running into yet more clunkiness/incompatibilities,  it has to be said that there are some nice things about Word.

This post will cover a few things that you may/may not know about working with Word. Some of these I only really figured out recently, and found that they do improve things quite a bit.


Drawing Figures using the Shapes + Canvas
Tip 1) Ctrl Up/Down/Left/Right is your friend
I don't know how I never picked up on this until I saw/heard of it at some point from my colleagues in the HCI lab.

Basically, as anyone who's ever tried wrangling those shapes in the UI to get them to behave will know, there will come a time WHEN THE BLASTED THING WON'T LET YOU PLACE THE SHAPE EXACTLY WHERE YOU WANT IT! Instead, it insists on either having an awkwardly large gap, or smooshing the objects together. Even holding down Ctrl while a dragging motion is underway already (IIRC, this is the the one for finer precision) still doesn't often do the trick.

With this trick, I've found that you can in fact get it to finally behave. Usually it takes only about 2 taps to get it where you need it, with each tap moving it by 1-2 pixels (or perhaps it is in mm or something else instead...) I'm not sure what grid scale it uses when you use this, but I do know that this lets you position anything with great ease.

Tip 2) Holding Shift while dragging and object or a line's endpoint will snap the transform along the axis it was previously

Tip 3) Holding Ctrl when starting to drag an object a short distance will duplicate it
With a single object or multiple objects selected, if you hold down Ctrl and then start to drag these a short distance, exact copies of these will be created and will start to follow your mouse. This is very useful, given that using Copy and Paste will FLUFF UP the text formatting (for some reason I haven't figured out yet! It certainly didn't do this in the older versions!).

Be warned though that sometimes if you drag too far (or do something else I haven't figured out), it will instead infer that you intended to merely try moving the original object with greater precision than before, making a mess of things.

Tip 4) Set the margins for all textboxes to L=0.05cm, R=0.05cm, T=0.03cm, B=0.03cm
I don't know what planet the designers were living on, but the defaults of 0.25cm, 0.25cm, 0.13cm, 0.13cm are almost always too bloody large for use with almost any shapes. There's always just a stinking amount of whitespace around each block of text inside a shape, forcing you to have to expand the shapes right up like bloated whales with a pea-sized brain.

Unfortunately, they do not include any way to permanently set this for all text boxes on all shapes. Sure, you can set these things on a textbox once, and set that as the default text box. But doing that still doesn't solve the textboxes created inside shapes (especially ellipses and those diamond things - those ones are an absolute pain as the irregular shape + the margins means you can only get like 2-5 characters in, but only half visible vertically-speaking). If anyone has a fullproof way of forcing this to be adopted permanently, I'd like to hear from you!

(On a side note: WHO THE HELL PUTS BORDERS ON ALL THEIR TEXT BOXES?! If I create a text box, I do not want it to have borders. If I want it inside a border, I'll create a rectangle first, and then add the text inside that. Gah!)

(Second side note: If you're creating square-shaped box, containing just a single letter/number, and about ~1.5 ruler units wide/high, setting the top margin to 0.3cm - all other things left at their braindead defaults - will get the text nicely centered)

Tip 5) Turn on the main gridlines (View Tab -> Gridlines) if you're having trouble aligning stuff

Tip 6) Use the colour palette colours, and the preset styles as the basis for the look you ultimately achieve. 
While only using these exactly as prescribed might make things look a bit nasty, not using them at all just wastes your time. Save time, and use these to create your base effect, then 


Tip 7) To get high quality exports of your diagrams...Sometimes publishers demand that you give them your figures as high quality separate files. One way to do this if you're using shapes is to:
  i) Click on an empty area of the canvas, then Ctrl-C to copy it.
  ii) Then, open up Paint.Net, and Paste. Let it paste this as a new image, and to expand the canvas as needed to fit it.
  iii) Save this as a png. Now you've got a relatively high resolution raster image of that diagram

Unfortunately, the method above DOES NOT WORK if you're just using the built-in Paint. That will instead give you a nasty scaled down version, complete with aliasing artifacts.... Nasty!

If you want a vector graphics representation, I'm not aware of any built-in way or tools/plugins to do this. However, since this is in theory an "open standard" doc format it should be possible. To be more specific: The docx format is really a Zip archive containing a bunch of XML files. All the content you want to access exists in the "Word/document.xml" file inside that archive. If you extract that file, and manage to cleanly extract the relevant XML, then pass it through some XSLT or similar transform to get it into an SVG (you'll probably need some custom logic to get the desired shapes though for some of the more complex ones), you can probably start to match the output quite nicely. I'd be surprised that no one has done this work already though!

Tip 8) Turn on the Format Shape/Shape Properties Pane ASAP when editing diagrams
Presumably as part of MS's push to get Office working on tablets and other touch devices, they've finally overhauled the UI to get rid of the old dialogs in most cases. This is one of those cases where the old Format Shapes property sheet is now a pane docked on the RHS of the screen.

Besides using the RMB quick access menus, opening this pane is one of the most productivity-enhancing things you can do when creating diagrams here

General Editing
Tip 1) If saving docx files is slow, you need to disable/clear the change tracking (again)
To do this, go to the Review tab, Changes panel, bring up the Accept dropdown menu, and click on the Accept All Changes and Stop Tracking.

---

One of things I've been noticing as the document length starts to build up (in page count), while the file size is still quite modest/reasonable is that it seems to be taking increasingly long for it to save the file. This sucks quite a bit, as I now have a bit of a twitchy finger impulse to save - sometimes I will be patching up something, and will save once after making the first change, then twice in quick succession after making another related change, and maybe once more after making another in a nearby area. Manually saving your work is good practice man, as is including semicolons at the end of each line of code, or using punctuation when writing prose!

While it's not quite bad as some of the cases I read about when digging up fixes for this (there were reports of 30-40 second freezes, where any form of interaction with the program would become nearly impossible), the 10-15 second wait times (and yes, things were starting to stutter a little bit) were starting to become a bit of a pain.

Then, one day I noticed that it was mentioning something about autosaved versions or something. That got me thinking: hang on, this thing has "track changes", which seems to include an entry every bloody time you save (or at a similarly ridiculously close interval). Maybe they were in fact building up inside the file, meaning that they were making it take longer and longer to save. Indeed, flushing this clear from time to time seems to do the trick!


Tip 2) Learn about what styles are, and use them
Seriously. In particular for headings and code snippets. It saves time, and behaves better in the long run.

Tip 3) Turn on the Navigator and/or Bookmarks Panes, and Use Them
When navigating long documents, these features do help you get around a lot better than just trying to scroll your way out of that hole. It's what I'd do when editing code, or a document in Latex, so I'm glad they have this now.

(Bonus Note: Word 2013 now has a feature where it puts up a popup telling you where you were working during the previous session, allowing you to jump right back in. Short of it just saving the damned state and putting you right back there again when you load up the doc again, this is probably the best we'll get)

Tip 4) This applies to ALL WYSIWYG editors out there
(Embarrassingly, this probably took over a decade of repeatedly stubbing my toes on this the hard way to learn...)

When working with any WYSIWYG rich text editor, you should only apply formatting to text AFTER you have typed it. That is, you should type out the entire stretch of text which you want formatted a particular way, then insert an extra bit more text (or perhaps just a little placeholder, like "...") immediately after it following a space , and then, only then do you go back in, select the text, and apply the relevant formatting operations/settings to it.

Why is this? Well, it seems that the algorithms for implementing these, which most people copied and pasted from the first snippet they found back in '95 (and the descendents of that for each subsequent generation) teaching them how to do this have quite a few quirks. One of these is that if you start extending the text on the edge of a manually formatted region, depending on how you placed your cursor there (and any number of other additional factors), you may end up extending out some of the "closing tags" for that formatting, which have incidentally been overlaid with some other closing/opening tags from way back - all of which have all accumulated and stewed together silently. Then, all it takes is one misplaced backspace, and boom! Somehow that breaks the chain of hide and seek, and suddenly some long lost formatting from page 2 suddenly appears on page 279.

Thus, this practice of inserting a dummy placeholder (...) forward a little stretch (and between empty section headings), then inserting all the text plainly, and applying the formatting to just the snippets of text it should affect keeps all these troubles at bay. Plus, if applying the formatting only implies clicking on the relevant custom style to apply it to all those


Tip 5) Ctrl-Left/Right does the jump forward back a word
This works in any text box really on windows, but it's not always something you'll notice/seek to look for if you haven't come across programmers ranting and raving about how their "vimacs" editor does this.


Tip 6) Use the highlighting tool to mark any loose ends or dangling references you need to check up on.
Not doing this will mean you'll likely miss one of your own placeholders in the future, just before handing off the "final version" to "somewhere important". At least this way, you stand a better chance of picking up on the error.

Tip 7) Typing "Alt, 0, 2, 1, 5" (without the commas or spaces) generates the multiplication sign

No comments:

Post a Comment