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 ="*">
Hi Folks, I am trying to modify the current ISO690Nmerical.XSL file (in directory: C:\Program Files\Microsoft Office\Office12\Bibliography\Style) in hopes of making my own. I have managed to change a few formats, however, am stumped on: 1.) Changing the style name from "ISO 690 Numerical" to "My Bibliography". I've already tried writing... My Bibliography ...but apparently the template name in the xml isn't "StyleName", does anyone know the template name equivalent in this document? 2.) Changing the order of the "Journal Article" reference type from [Title, Author] to [Author, Title]? I've found that "Journal Article" proves to be a bit more difficult than the "Book" (@ ln 4500) because the Title and Author 'seemingly' appear out of nowhere, but of course, I may have been looking at this for too long ;^D 3.) In the citations section, instead of showing multiple references as follows (1,2,3), write (1-3) instead. 4.) If there are more than 3 authors, write "et alum" afterwards. Any help or pointers would be much appreciated... Happy Holidays Folks & Happy Coding!
How do I remove defaulting period after the middle initial? Your help would be greatly appreciated! Cheers
Nice feature for Office 2007 but useless to me as I always need to submit articles with AMA referencing style (not available with Word 2007) and I'm not in a position to code my own.
scleavit: you can set it around line 3420. There, you'll find a piece of code that looks like ISO690NR just replace that by ISO690NR --> Your Fancy Style Name ` It seems Office first checks if there's an "OfficeStyleKey" so that it can match that to some correct localised translation, and only tries StyleName if an OfficeStyleKey transforms to nothing.
Hi at all, happy new year. I am having trouble with the citation thing under word 07 as well. After struggeling around with google and his/her friends for a long time I found a way to put in a TAB character, which was one of the things I was looking for.
Use the following line where you'd like to put a tab in the word document: IAt least for me it worked right away. I hope I helped some of u folks. cheers
How do i add an empty line in the 'work cites' list after every citation ? I'm using the chicago.xls
I'm wondering in the citation edit box there is a author, year, and TITLE box to choose how much one puts in the citation.
Well I see the author, I see the year, but I don't see the TITLE show up in the citation.
Why not? The Bibliography certainly has a title in it's field along with author, year, publisher, etc....
Is it possible to change the location where Word looks for Bibliography Styles to somethig other than C:\Program Files\Microsoft Office\Office12\Bibliography\Style?
In our organisation, users have no permission to write into C:\Program Files\.... which means they cannot add additional styles.
This feature is great, but word should allow the user to enter the citation in one of three formats:
1. With brackets.
2. No brackets.
3. With the writer name before the year of publish.
The first case is the one already enabled.
The second case is useful when:
1. Mentioning a specific article: "This table is taken from blah, 2009"
2. When concluding from more than one aritcle: "We can determine that (blah, 2009; foo et al., 2010):"
The third case is also useful when mentioning a specific article: "A recent research conducted by blah et al. (2009)).
Since I started the whole bibliography in the section "Citations & Bibliography" and can easily create a bibliography or references at the end of the document, I am interested inanother option.
How can I insert the citation in footnotes at the bottom of the page?
In fact, when I click "Insert Citation" all you get is a form of "text notes" that looks like this:(Author, year), and I need to be like this: (full name, title, Place, Publisher, Year).
Changing styles, nothing changes, can someone help how to get this up, because when there are already data in a database, why is there only one way ? While quoting the bibliography there are 20 or so, plus the ability to create your own style.
Thanks all in advance!
It s the Word 2010.
nice archive, but i still confused
Thank you, this is extremely helpful.
Two more questions though:
* if i have two or more authors, what would i need to add to the code to make them both appear in the bibliography list?
Even if i enter both names as the surname of one author, it still only shows one...
In the citations i only need one though.
* if there were two works from the same author during the same year, how would i add an a/b at the end of the year in the citation?
thank you in advance!
Is there any way to modify the citation not to have the parenthesis?
This is the way I did : Go to C:\Program Files\Microsoft Office\Office12\Bibliography\Style, then in the ISO690Nmerical.XSL file modify the line (search it with ctrl + f) :
" <xsl:if test="msxsl:node-set($ListPopulatedWithMain)/b:Citation/b:FirstAuthor">
and replace it by : " <xsl:text>[</xsl:text> ", and do the same for the closing bracket : replace the line :
" <xsl:if test="/b:Citation/b:LastAuthor">
and replace it by : " <xsl:text>]</xsl:text>.
If you want numbers under [ ] in the bibliography table too, then go to the line :
" <xsl:call-template name="templ_prop_Dot"/><xsl:call-template name="templ_prop_Space"/> ",
and delete the part : "<xsl:call-template name="templ_prop_Dot"/> ", which is the '.' character. Just above this line is the line "<xsl:value-of select="b:RefOrder"/>". This is the number of your source in the list. On each side of this line put "<xsl:text>[</xsl:text>" and "<xsl:text>]</xsl:text>". It may look like :
I don't know if it's the best way to modify this file, since I don't know XML or XSL or this king of languages, but it works very well for me =)
this crappy chat box didn't wrote my tags ><