Scrivener to Word Visual Basic Formatter – Converting Scrivener to Word with Style

So I have said previously that one of the issues I have had with using Scrivener to write with is also one of its strengths:  Scrivener doesn’t do formatting. It separates the formatting of the word from the writing of the word. The idea is, you write your Great Australian Novel in Scrivener, and then when it is all done and dusted you compile and format it in Word.  But when you format, you want styles and you want them now.  In Word, styles allow the Table of Contents to be generated (Scrivener has one, but, yeah).  

It is a real pain with Scrivener trying to maintain a master manuscript but working with others who want to see your work in Word.  Particularly when you format the document up in Word, and then move sub-section 1.1 to become 1.3, that can wreck your whole weekend.  You will want to make the change in your master, and in the formatted version of the document.

Wouldn’t it be nice to be able to generate formats up quickly? Take your Scrivener document and publish it to Word, and then format it quickly to enable styles and such, in about 30 seconds?

Well I had seen where people suggested you use use a specific font size in your Scrivener document for headings and then search and replace using styles in Word.  If you do that, your headings will quickly be able to be moved to become styles.  But it’s still tedious.

So where’s all this going?  Today I wrote a Word visual basic macro that converts an RTF version of the document to a Word version with styles.  Now, it’s still rough.  It’s not polished, and no doubt it’s buggy – so although I am sharing it in this post, please don’t use it with the only copy of your thesis!!! 

So here’s what I’ve done:

  • It’s a single document (download scrivener-formatter.docm using this finely crafted link) that should run in Word for Mac 2011 (presumably, Word 2007 or later – but if you’re on Windows, I don’t know that you’d be likely to be on Scrivener – but maybe you are).
  • There are five styles in this document (Heading 1, 2, 3 & 4, as well as Header).  They are fairly standard thesis-style formats at the moment – but if you download this document, and modify the styles, those styles will stick with the document.  So modifying Heading 1 to be Arial rather than Times New Roman is done the same as it always has been – and when you save this document it will be the new style it applies for Heading 1.
  • To use, compile your Scrivener document to RTF and open it up in Word (if you are using EndNote, format the paper to add the citations in).  
  • Open up the scrivener-formatter document in Word, and copy -and-paste (I know, but I did you tell you it’s still rough) your compiled RTF into the scrivener-formatter document.
  • When you open up the scrivener-formatter document it should warn you that has a macro in it – well that’s fine; check out the macro (source code is included) to be sure if you like.  I attach the macro to a button on the toolbar.  You may wish to do the same.
  • The macro assumes your core text will not be any larger than 12 point font.  Any font that is font size 13, 14, 16 or 18 will be mapped to the four styles according to the below:
    • Font Size 18:  This will assign style Header to the paragraph.  In the Table of Contents by default, anything assigned a style of Header will appear as if it were Heading 1.  The main difference in the document between Header and Heading 1 is that Heading 1 has a list numbering effect (currently, Heading 1 is “Chapter X:”; you can change this by modifying the style).  I created Header as I don’t use the Chapter numbering for the References heading, and I still want the References heading appearing in the Table of Contents (the same will apply for Appendix headers etc).  If you don’t want this, don’t use 18 point font.
    • Font size 16:  This is Heading 1 (I label this Heading in my Scrivener document).  Heading 1 style (currently preceded with “Chapter X:”) is TOC Level 1. Gets a section number in the current format style.
    • Font size 14:  This is Heading 2 (Scrivener:  Section Heading).  TOC 2. Gets a section number in the current format style.
    • Font size 13 (without italics):  This is Heading 3 (Scrivener:  Sub-heading).  TOC 3.  Gets a section number in the current format style.
    • Font size 13 with italics:  This is Heading 4 (Scrivener:  I label this Para Heading).  This does not appear in the TOC by default, and does not get a section number:  it’s merely a paragraph heading in italics without numbering.  
  • The macro also deletes any in-line comments in the document.  I use comments extensively, but I don’t want them in the final formatted version.  So they’re gone ski.
  • I use a placeholder for the reference list of [ENDNOTE:DELETE] to ensure formatting is properly assigned to the references generated by EndNote.  This placeholder is deleted by the macro.  If you wish, ignore this – so long as you don’t have that placeholder in your document you will be fine.
  • Finally, a Table of Contents is generated at the beginning of the document to give you a visual map and a ToC.

That’s it, all takes a very short time to run even on my current 50 page draft.  

Now although I don’t anticipate any problems, this is not extensively tested.  It seems to work fine for me, but I haven’t put it through its paces yet. Nevertheless it promises a bit of time saving. I am also toying with the idea of using placeholders for tables and having the macro look for those tables and inserting them at designated placeholders – we will have to see if I get that far.

Feedback welcome!  I hope this VB macro is of use to someone using Scrivener.   Remember you can change the fonts to suit, and it makes the document into a heading of some sort if it is font size 18, 16, 14, or 13.  

Download the Scrivener formatting Word macro document here.

Happy automatic formatting in Scrivener with Word Styes.  Please leave feedback in the comments below or by email on micheal@michealaxelsen.com if this is useful or could be improved (not that I can guarantee I’ll do it!)

Mac OSX, Scrivener and Word for Academic writing

Well, about 18 months ago I bought a new Macbook Pro.  I had sworn that Mr Gates’ hegemony had to deliver on Windows 7, and, although it was OK, it was not quite to the standard I wanted.  So I thought that, as I am currently doing my phd full time, it would be a good idea to try out this Mac thing full time. On account of how my need for my computers to play well with others on a corporate network is less.

And, speaking as a Windows user of long standing,  generally it’s been a Good Thing.  Sure, the Macbook was expensive compared to the Windows equivalents, but then the software is generally cheaper and OSX just feels more bulletproof.  Of course, software development is a bit harder to get into (but then AppleScript is very good), but at least when Office 2011 came out they brought back VBA for Mac Office.  Thank goodness!

And there are two items of software on the Mac that I have coveted and used a lot since converting to the Mac side. Devonthink Pro is one that I have just not managed to find an equivalent for – which should be the subject of a future post – and Scrivener is the other.  In fact, I made a video on YouTube and a post here on my blog, and since it’s consistently my most popular blog post and video by a mile, there’s a lot of love for it.

So, I have adopted Scrivener for writing.  And it’s a great all-round writing package.  The structure, the mechanism behind it, and the ability to compile to many formats (including ebook) and slice-and-dice your writing is wonderful.  I of course also have Office 2011 for ‘other writing’ and for final formatting.

The default for most phd candidates is of course Word, and on the Mac that’s periodically been a beast competent at short writing but not so good at long writing.  However, I have recently been using it to write a large report for a client (55 pages, 20,000 words)  and in the space of 24 hours it lost me 6 hours’ (yes, even with auto recovery files being saved every 10 minutes).  I would be editing and moving text around in Microsoft Word and then I’d get the spinning wheel of death (see – I have turned into a Mac user). Word would just end up not responding.  And when you’re consulting for a client that is paying hourly, losing that many hours is not much fun for your hip pocket. Nothing like the market’s invisible hand to make you think about your software choice.

Turns out there is a bug with the ‘Smart Cut-and-Paste’ function – go to /Word /Preferences /Editing Options and turn off Smart Cut-and-Paste and that problem with Word in Office 2011 crashing should go away.  After I found that tip I proceed to write for a week without a single crash.  I had been blaming it for EndNote incompatibility but this document wasn’t using that and I’d disabled that functionality.

So.  Word on the Mac can be made to work.  Although you can still lose work, and it is dependent upon you regularly saving your document if you want to avoid wholesale problems (and saving is slow on Word).

And so to Scrivener.  I love Scrivener.  Mostly.  The structured approach is good and the ability to move your text around is fantastic.

However – there are several issues for academic writing.  Graphics were a problem for a while but I worked out you need to draw your diagram in another package (e.g. Powerpoint), save to PNG, import the image, and then scale the image to consistently be the width of the page (411 pixels, incidentally).

Firstly – and insurmountably – you do have to play with the world of others if you are a co-author with people.  If you are the primary author, then you can compile, send it to your co-authors, and have them mark it up with changes for you replicate in your document.  But it’s a bear if your supervisor says, ‘Just give me the electronic copy and I’ll finish the report for you’.  Particularly since styles and text tags (such as the <$n:table:demographics> table you have on page 6) don’t translate to tags in Word – when they are expecting these things.

Secondly – and I suspect uniquely to academic writing – Scrivener’s tables, well, there’s no better phrase to describe it:  Scrivener’s tables suck.  Mostly because if it’s anything other than a straight vanilla table with no merged cells and so on, aligning tables is pedantic.  And I know that that’s because it’s really OSX’s tables.  And I know that Microsoft Word’s tables are proprietary and thus evil.  But, the tables just cannot be made to work.  I had gotten to the stage where I would do the tables up specifically in Word, and then import the RTF document (putting all the tables in their own sub-directory, with the same name as the $n:table reference in Scrivener) into Scrivener.  And that sort of worked when it was compiled out.  But sort of not.

Thirdly, a lot of academic papers come with arbitrary word limits and requiring submission in Word.  I have just had a paper accepted at AMCIS that was ‘5000 words including tables and references’.  Great – so I have to compile with EndNote every time I want to know how many words this thing is (noting, I suppose, this is really a function of EndNote’s sulkiness and thus you have to do this with Word too).  But you end up compiling from Scrivener to RTF, formatting EndNote tokens, saving to DocX and then reviewing the final output and changing a word on page 4 – and now you have two copies of your paper.  Sigh.  So you track change that paper, and then re-input your changes back to Scrivener later… which is every bit as painful as it sounds.  And if you then edit the paper in Scrivener, you’ll have to re-do all that formatting again.

Finally – it is in the nature of the academic to procrastinate.  If a paper is due at 5pm, then at 4:55pm you will be madly checking the format.  One of the great things Scrivener does is separate the writing from the formatting.  But the formatting is integral – presentation is communication.  Formatting the paper can take Quite a While.  And as Styles in Scrivener don’t work as they do in Word, a decision to make your section headings 18 points instead of 16 points can really wreck your day.  This is a problem when you are up against a tight deadline.

So… I am conflicted with Scrivener.  I think that for writing the Great Australian Novel it is the perfect tool.  And being able to compile different versions of the same document is excellent as well.  However, there are a few issues that I am trying to get my head around to make it work for academic writing. I just may have to accept that I do not have the time to do that and thus may need to ‘stick with Word’ for my PhD.  As a bit of a ‘new tool’ buff, and being able to see the advantages of Scrivener, that hurts, but more procrastination just isn’t an option when you are past the journey to knowledge and wanting to graduate.

[Footnote:  Since writing this post, I have gone back to using Scrivener as Word crashes far too often on the Mac.  Word is fine for two page letters on the Mac but that’s as far as I’d trust it.  I have written an automatic style formatter in Word (very rough, very basic, and very ugly) that converts fonts of a certain size to a Heading 1, 2, 3 and 4 style in Word – see this post here:  Scrivener to Word Visual Basic Fromatter].

Scrivener – Draft academic template for academic writing

At the urging of Twitter user beautyiswhatudo, I have posted up here my academic template for writing journals and publications according to a somewhat generally accepted approach.  The reader can download the Scrivener 2.0.4 template here.

I do have some notes for someone intending to use this template; these notes are included in the Academic template.

To the user:

This Scrivener 2.04 template provides an overall structure of how to proceed with writing an academic paper in Scrivener.  Much of this generated table of contents etc is based on research in the social sciences (Information Systems discipline).  Other advice has been sourced from the University of Queensland RHD Handbook (included as part of the research materials at the bottom), and from the publication Turabian, K. L. (2003). Identify key terms expressing concepts that unite the report and distinguish its parts:  Chicago Style for Students and Researchers (7th Edition ed.). Chicago and London: The University of Chicago Press.

This template will need to be customised for someone seeking to write papers (note:  this is a paper for journal or conference publication, not a thesis.  A thesis will have more and varied sections.

Note that to use this document, you should note that text within []’s needs to be searched for and replaced. And before you ask, [lorem ipsum] is generally considered to be Latin for ‘Insert Text Here’.

Released as is without warranty express or implied.  As the author, you will need to make changes to this template for your use.  Nonetheless, if you like it or  have an improvement to suggest, please feel free to email me at micheal@michealaxelsen.com with recommendations or feedback.

Thanks:  Micheal Axelsen
21/02/2011.

Here is a PDF so you can see what the template looks like; there is considerable metadata inside the Scrivener template with instructions for completing the paper.  You can only access that material, though with a copy of Scrivener.

View more documents from Micheal Axelsen.

Hope that you find this of some use.  I may update this from time to time.  As always, feel free to email me on micheal@michealaxelsen.com with feedback, or leave comments below.

[PS:  You might be interested in this other post on my blog, where you can see how I use Scrivener, EndNote and Evernote for academic writing:  Using Scrivener and EndNote together on Mac OSX]

 

Using Scrivener and EndNote together on Mac OSX

And so, some time ago I bought a Macbook.  And then I found the killer apps that I needed to write my thesis.  Scrivener, hands down, is the best writing tool on PC or Mac.  There is now a PC version, at least in beta, and although it’s not as mature as the Mac OSX version I believe it is getting there.

There’s so much more that I’d like to write about Scrivener and how it is helping with writing the thesis.  However, it’s not as easy as all that – so I did a video instead.  Voila, one video ‘Scrivener and EndNote’:

 

You can buy Scrivener from www.literatureandlatte.com, and EndNote from www.endnote.com.  Scrivener is not very dear at all (say, $A47.19 at the non-educational price).  So you can’t complain.  Endnote is usually available through a university licence – that software cost me zero to run under the UQ licence (so long as it is for research etc etc).

Anyway I highly commend these two applications to you (although apparently www.sente.com is coming up well from behind as well as an alternative to EndNote).  All worth the price of admission.

[PS:  You might be interested in this other post on my blog, where you can download my Scrivener template for academic papers/writing:  Scrivener – draft academic template for academic writing]

[PPS:  Since writing this post, I have written an automatic style formatter in Word (very rough, very basic, and very ugly) that converts fonts of a certain size to a Heading 1, 2, 3 and 4 style in Word – see this post here:  Scrivener to Word Visual Basic Fromatter].