You can use your favorite social network to register or link an existing account:
Or use your email address to register without a social network:
Sign in with these social networks:
Or enter your username and password
Forgot your password?
Yes, please link my existing account with for quick, secure access.
No, I would like to create a new account with my profile information.
A couple of weeks ago we posted on bibliographies and citation, and it quickly became the most commented post we've ever had. Looks like we left a lot of questions unanswered! As a result, I'm going to create a series of posts which will (hopefully) address some of the questionsaround how to create a custom bibliography style in Word 2007.
For starters, here are a few important directories to know about:
The bibliography sources you create are all listed in the following file: %APPDATA%\Microsoft\Bibliography\Sources.xml
NOTE: The \Bibliography\Sources.xml file won't exist until you create your first Bibliography source in Word 2007.
All the bibliography styles are stored in: C:\Program Files\Microsoft Office\Office12\Bibliography\Style
As a few of you have noted, yes, it is very difficult to the read the built-in XML style sheetsin our Styles directory. Many of the lines in the built-in bibliography styles are used internally by Word for specialized international cases (e.g. remembering that language X doesn't need a comma before the "and" before the last author name). Fortunately, a custom bibliography style doesn't need to be so complex. On that note, this post will walk through the steps (and XML code) needed to construct a simple custom style.
A few caveats:
I really do mean asimplecustom style. I'm not going to deal withcomplex scenarios like how to format your bibliography if someone doesn't enter a last name for the author. That sort of thing will be covered in a later post. Right now, I just want to provide a basic understanding of how bibliography styles work using a simple, easy-to-follow example.
Also, I'm not going to into the details of XML in this post. If you want to brush up on the subject, I'd suggest going herefor more information.
Let's begin creating our own bibliography style. To do so, we'll create an XML Style sheet, i.e., an .xsl file called MyBookStyle.xsl using your favorite XML editor (e.g. notepad). As the name suggests, our example is going to be a style for a book source type.At the top of the file, add the following code:
<?xml version="1.0" ?>
<!-- List of the external resources that we are referencing -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:b="http://schemas.openxmlformats.org/officeDocument/2006/bibliography">
<!-- When the bibliography or citation is in your document, it's just HTML -->
<xsl:output method="html" encoding="us-ascii"/>
<!-- Match the root element, and dispatch to its children -->
<xsl:apply-templates select="*" />
As the comments (text in green) indicate, Word uses HTML to represent a bibliography or citation within a document. So, if you have experience using HTML, you can get pretty fancy with your output (I haven't tried blinking text yet -- and wouldn't recommend it--but if you are so inclined…J).
Most of the XML code above, is just preparation for the more interesting parts of the style. For example, you can give your style a version number to help you keep track of changes you make:
<!--Set an optional version number for this style-->
Or, more importantly, you can give your style a name! Add a <xsl:template match="b:StyleName"> section that contains the name of your style. In the case of our example file, we want our custom bibliography style name, "Simple Book Style," to appear in the Style drop-down on the References tab. To do so, we'll need to add the following XML:
<!-- Defines the name of the style in the References dropdown -->
<xsl:text>Simple Book Style</xsl:text>
This will now let your style show up with its own name in the bibliography Style dropdown box in the application.
Now for the finer details of the style. Each source type in Word(e.g. book, film, article in a periodical, etc.) has a built-in list of fields that you can use for the bibliography. To see all the fields available for a given source type, you can go to the Create New Source dialog, and check the box next to Show All Bibliography Fields.
As you can see, for a book we have the following available fields:
NOTE: you can edit the list of available fields for a given source type, but we'll go over that in a later post.
In the code, you can specify the fields that are important for your bibliography style. These are the fields that will be shown when the Show All Bibliography Fields is unchecked and will have red asterisks next to them when the Show All Bibliography Fields is checked. For our simple book example, I want to make sure that the author, title, year, city, and publisherare entered, so I want a red asterisk to appear next to these fields to alert the user that these are recommended fields that should be filled out:
<!-- Specifies which fields should appear in the Create Source dialog when in a collapsed state (The Show All Bibliography Fieldscheckbox is cleared) -->
<xsl:template match="b:GetImportantFields[b:SourceType = 'Book']">
The text in the <xsl:text> tags are references to the Sources.xml file. These references pull out the data that will populate each of the fields. Feel free to take a peek at Sources.xml (%APPDATA%\Microsoft\Bibliography\Sources.xml) to get a better idea about how these references match up to what is in the xml file.
Whew! We finally get to figure out how we want our bibliographies and citations formatted within our document. As I said before, the output for bibliographies and citations is represented as HTML in a Word document, so to define how our custom bibliography and citation styles should look in Word, we'llhave to add some HTML to our style sheet.
Suppose I want each entry in my bibliography to be formatted as so:
Last Name, First Name. (Year).Title. City: Publisher.
The HTML required to do this would be embedded in my style sheet like this:
<!-- Defines the output format for a simple Book (in the Bibliography) with important fields defined -->
<xsl:template match="b:Source[b:SourceType = 'Book']">
<!--Label the paragraph as an Office Bibliography paragraph -->
Whenever I reference a book source in my Word document, Word will need to access this HTML so that it can display the source using the custom style, so we'll have to add a bit of code to our custom stylesheet to enable Word to do this:
<!-- Defines the output of the entire Bibliography -->
<xsl:apply-templates select ="b:Source[b:SourceType = 'Book']">
In a similar fashion, we'll need to do the same thing for the citation output. I want to follow the pattern(Author, Year)for a single citation in the document:
<!-- Defines the output of the Citation -->
<xsl:template match="b:Citation/b:Source[b:SourceType = 'Book']">
<!-- Defines the output format as (Author, Year)-->
Finally, close up the file with the following lines:
<xsl:template match="text()" />
All that's left is to save the file as MyBookStyle.XSL and drop it into the Styles directory (C:\Program Files\Microsoft Office\Office12\Bibliography\Style).
Now start up Word. You'll notice that your style is listed in the Styles dropdown on the References tab!
After selecting the new style, try creating a new source using the Source Manager. All of the UI and the previews now use the style that we just defined!
Finally, the fruits of your labor can be seen in the document by inserting a citation and a bibliography on to the surface:
Here is all the code that was used in the post:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:b="http://schemas.openxmlformats.org/officeDocument/2006/bibliography">
<!-- match the root element, and dispatch to its children -->
<!--set an optional version number for this style-->
<xsl:apply-templates select ="*">
Someone should show some heart and either program a piece of software with which one can create styles easily or convert from style definitions of other programs, like Endnote. And in fact, I think that someone should be MS, since with probably 0 serious uptake of the this feature there is most likely no real market for this right now for a third party.
I absolutely love this feature in 2007 - so easy to use and a truly fantastic addition for students! Thanks for the guide, we can now tailor our bibliography sections to fit in with "custom" guidelines!
code samples now left aligned...sorry about that. -Jonathan (MS)
As it was not addressed in SP1, I've come up with a fix* for the spaces before commas issue with APA bibliographies. I simply edited the APA.XSL file included with Office (comments denote the few changes.) I hope it's not outre to post it here! The updated APA.XSL is available at (save target to get source):
www.francispickering.com/APA.XSL *Seems to work for all my references, though it's possible that unwanted spaces will appear with unusual citations.
Surely this is a good improvement from the previous version. However, IMO, Zotero is much better for this purpose. It can works with MS Word, OpenOffice and Google Docs.
(For academic writing, the better choice would be using LaTeX + BidTeX and free reference management softwares).
Having now used this feature for creating a number of academic papers, I would like to see the following features: Proper Harvard Referencing:
There are subtle differences between Harvard and APA, and there are people who can spot them too. Also the lack of support for referencing the same author in the same year is a significant oversight. Citation Import:
Many journal sites and elecronic catalog have the ability to copy the citation into other citation tools directly from their website. It would be useful if it were possible to add the citation into word too. I currently spend a lot of time retyping the citation into the correct fields in word. Citation Style:
In the text it is common to State "Fayol(1952) proposes ..." or "blah, blah (Fayol, 1952)." It would be useful if the citation tool allowed the author to optionally be placed in front of the brackets Works Cited, and Bibliography:
a list of works cited is easy to achieve in word 2007, however producing a bibliography of works used but not cited is not so easy. I understand the workaround to be to convert one version to text and create the other. Reference database: Reference lists can become very long so a tool that allows for the grouping of references and easier edittign of reference lists would make this much easier to use.
Random suggestion for a next version of Word--
why not build acronym/abbreviation management on top of the citation/bibliography features? E.G., a list of acronyms in use, integration with smart tags (for automated recognition and pop-up definitions), the ability to scan the document and provide a definition in parentheses or a footnote for the first occurrence of each acronym, and a button for "insert list of abbreviations?"
Here is a question for the Word team: Essentially the bibliography support in Word 2007 is VERY basic. On the other hand it seems pretty open, i.e. it should be possible for third parties to really extend it to something that can be used for scientific publishing in the real world. But then, I have not come across any offering from a third party that extends or builds on the support introduced in Word 2007. Are you aware of anything?
Nice tutorial! I wish I had seen this a month ago! I am building a stylesheet for the IEEE style standard and I would like to include a tab after the ref # so that I can allign it using tab stops. I have tried the normal techniques for including whitespace in XSLT output, but they never seem to show up in Word. How do you output a tab character?
"Now start up Word. You'll notice that your style is listed in the Styles dropdown on the References tab!" I've copied-and-pasted the exact sample code you give at the end of the post, and I've stuck it in the ...\Bibliography\Style\ folder as instructed, but I can't seem to get the new style to show up in the dropdown in Word when I restart word. The code seems to validate fine when I open it in IE (in other words, I don't think I missed a closing brace or anything). Am I missing a step? Any idea what might be going wrong?
Word 2007's bibliography feature run smoothly for me until I started to use 64-bit Windows XP. I installed a fresh copy of Office 2007 after XP-64, but all functions listed in "Citations & Bibliography" were disabled except for "Search Libraries" in "Insert Citation." I never encountered such a condition while using several different machines with Office 2007 on XP-32. Can you please comment on this situation and point out some possible directions? I really would like to use this feature on my 64-bit machine. Thanks a lot!
You gotta be kidding? Three pages of html code just to define one style? Is this really the best MS can do? I'm not giving up Endnote yet.
I don't see a way to cite my bibliographical references as footnotes or endnotes. It looks like it only works with in-text citations.
I also can't copy/paste information from an open Word doc into the source manager.