How can I make a custom bibliography style?

G

grammatim

We could discuss the theory of bibliographic style if you'd like, but
this probably isn't the right place ... I live in both worlds.
Linguistics these days rigorously uses author-date, but philology
still uses author-short title (in footnotes), and each has its merits.
(Linguistics, until recently, was a very small field, and everyone had
read everything, so author-date references were instantly
recognizable; and that could well be valid for workers in any very
small field.) And when I'm earning my living by copyediting, I have to
do whatever the respective publisher requires, even APA style, which
(having grown up on Chicago style) I find pretty silly in several
places.
 
K

Katie

I found a way to get numbered citations in the text. after you 'insert
citation', and add a new citation entry you get the name of your source in
brackets (Doe,J et al. 2008). click on the little triangle at the lower right
corner of the citation and click on 'edit citation'. this allows you to edit
the appearance of the citation in the text. where it says add, put the
desired number into the box. I want my Doe, J citation to be number 1, so i
put a 1 in the box. then check all three of the boxes below, to remove the
name, date and author from the citation field. now your citation should read
(1).

Now you should also go to manage sources, up in the toolbar of the
references tab and make sure you change the 'sort by' field to 'sort by tag'.
then you can give your source a new tag, which corresponds to the number
....1. this wont be updated automatically so you should leave this part until
the end. when you next update your citations, by clicking on the tab in the
works cited section, it should update and you shold have numbers in the text
and in the works cited.
 
P

p0

I found a way to get numbered citations in the text. after you 'insert
citation', and add a new citation entry you get the name of your source in
brackets (Doe,J et al. 2008). click on the little triangle at the lower right
corner of the citation and click on 'edit citation'. this allows you to edit
the appearance of the citation in the text. where it says add, put the
desired number into the box. I want my Doe, J citation to be number 1, so i
put a 1 in the box. then check all three of the boxes below, to remove the
name, date and author from the citation field. now your citation should read
(1).

Now you should also go to manage sources, up in the toolbar of the
references tab and make sure you change the 'sort by' field to 'sort by tag'.
then you can give your source a new tag, which corresponds to the number
...1. this wont be updated automatically so you should leave this part until
the end. when you next update your citations, by clicking on the tab in the
works cited section, it should update and you shold have numbers in the text
and in the works cited.

To be honest, I'm not sure what you try to achieve with the above
solution. I would think that if you use some kind of number to
represent the citation in the text, you would want that same number in
front of your citation in the bibliography. How else would you be able
to find the reference in your bibliography based on the in-text
citation? With your solution, it would be unlikely that the number
will show up in the bibliography. Unless you start editing the
bibliography formatting rules, but then it might be easier to just do
that for in-text citations as well.

Also, setting the "Pages" variable under "Edit citation..." might not
be such a good idea as it does have a totally different meaning.

Setting the "Tag" and suppressing the other variables is a good idea
though. Although it might still be easier to use a style which
actually uses numerical references to start with (e.g. ISO 690 -
Numerical Reference)

Yves
 
S

Simplex

Dear Yves
you did the best with chicago and iso, can you do the same for APA so that I
can have the refrences alphabetically ordered and numbered in brakets []

Thank U

Simplex

p0 said:
p0,

I wonder if you can help me? I would like to change the brackets from (1)
to [1] in the ISO numerical reference style, with the text aligned with 'abc'
under 'xyz' in your example.

I'd be really grateful if you could tell me how to do this.

Many many thanks in advance.

James,

Check out http://www.codeplex.com/bibliography/Release/ProjectReleases.aspx?ReleaseId=15028
. I think that will do what you want.

BR,

Yves
 
Y

Yves Dhondt

No. Citation numbering and alphabetic sorting do not go together in Word.
In-text citations, even those part of a group, are passed one at a time to
the stylesheet. The part of the stylesheet, formatting the in-text citation,
is not able to either retrieve the order of the source in the bibliography
from somewhere or calculate it somehow.

Hence it is not possible to simply transform the existing APA style
according to your request. If you are willing to drop the alphabetic sorting
requirement, you can use
http://bibliography.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=19756 .

I did write a template and an external tool which allows to use both
citation numbering and alphabetic sorting (as well as some other things).
However, in your case, you would have to rewrite APA according to that
template to make it work. If you are interested in doing so, you might want
to check out http://bibliography.codeplex.com/Wiki/View.aspx?title=BibWord
(the template) and
http://bibliography.codeplex.com/Wiki/View.aspx?title=BibWord Extender
(the tool).

Yves


Simplex said:
Dear Yves
you did the best with chicago and iso, can you do the same for APA so that
I
can have the refrences alphabetically ordered and numbered in brakets []

Thank U

Simplex

p0 said:
p0,

I wonder if you can help me? I would like to change the brackets from
(1)
to [1] in the ISO numerical reference style, with the text aligned with
'abc'
under 'xyz' in your example.

I'd be really grateful if you could tell me how to do this.

Many many thanks in advance.

James,

Check out
http://www.codeplex.com/bibliography/Release/ProjectReleases.aspx?ReleaseId=15028
. I think that will do what you want.

BR,

Yves
 
J

Julie T

Yves,

APA has been updated where I have to carry in the "DOI." Do you know how to
add a new field in XLST? Also, I need the issue number to be a mandatory
field.

Example:
Klimoski, R., & Palmer, S. (1993). The ADA and the hiring process in
organizations. Consulting Psychology Journal: Practice and Research, 45(2),
10-36. doi:10.1037/1061-4087.45.2.10


Thank you,
 
Y

Yves Dhondt

From a purely 'being compliant' point of view, you can't go adding new
fields. The resulting xml would not follow the standardized schema. The only
correct way of doing it would be through namespace subsumption but end-users
can't do that.

Luckely, Word 2007/2008 doesn't really care when it comes to validity. So
you can add almost anything you want, from new source types to new fields
attached to existing source types.

!!! ALWAYS CREATE BACKUPS BEFORE EDITING FILES !!!

To add a new field to the 'Edit Source' dialog, you will have to provide its
definition in 'bibform.xml'. 'bibform.xml' is language dependent and you can
find the one you use in

<winword.exe directory>\<LCID>\Bibliography

where LCID is your language and cultural identifier. It's a 4 (or 5) digit
value. The default one (en-us) is 1033. For a full list, see
http://msdn.microsoft.com/en-us/goglobal/bb964664.aspx

When you check out 'bibform.xml', you will find the following structure:

Forms
--Source <= you have one of these for every type of supported
source (Book, BookSection, ...)
----Tag <= you have one of these for every field the source
supports (Author, Year, ...)
------Label <= this is the string that will be shown to the right of
the input box
------DataTag <= this is tells Word where to store the data entered in
the xml
------Sample <= this is an example value as shown at the bottom of the
'Edit Source' dialog.

So when you want to add a new DOI field to a certain type, you will have to
provide a new tag element for the necessary source elements. The element
could look something like this:

<Tag>
<Label>DOI</Label>
<DataTag>b:DOI</DataTag>
<Sample>Example: 10.1000/182</Sample>
</Tag>

Once you saved your adjusted 'bibform.xml' and start up Word, you will find
the newly added fields in the 'Edit Source' dialog when you select 'Show All
Bibliography Fields'.

As Open XML does not define which fields belong to which source type (they
use a flat structure), you can, without breaking anything, add existing
elements to sources who are missing them. So it is possible to add a b:URL,
b:DayAccessed, b:MonthAccessed, and b:YearAccessed element to an ordinary
Book source without breaking anything. Of course, non existing elements such
as b:DOI break validity.

So think about it, before you break it. I mean, if you use a separate field
for a DOI the underlying xml will become invalid. Not that Word cares at the
moment, but what if one day it will? Or what if someone else needs to open
your document on another word processor. They might expect valid sources,
and you will be giving them something invalid. A DOI is just another
standard number like you have ISBN or ISSN. Why not use the same field
(b:StandardNumber) they use? APA doesn't care about ISBN or ISSN anyway. It
doesn't use the standard number. So you can safely add a b:StandardNumber to
any Source element in your bibform.xml without breaking anything.




Next you may want to control the importance of the field. That is, should
the field be shown in the 'Edit Source' dialog by default, or should it only
be available when 'Show All Bibliography Fields' is selected. The importance
of a field is defined on a per style basis as some styles think an issue
number is important while others think it is not. This means that it is
defined in the xsl files.

What happens is that Word sends a 'b:GetImportantFields/b:SourceType' to the
xsl. The xsl replies with 'b:ImportantFields' element containing the data
tags of the important elements. So for example, when Word want to know what
the important fields are for journal articles in APA, it sends

<b:GetImportantFields>
<b:SourceType>JournalArticle</b:SourceType>
</b:GetImportantFields>

And APA.xsl replies with:

<b:ImportantFields>
<b:ImportantField>
<xsl:text>b:Author/b:Author/b:NameList</xsl:text>
</b:ImportantField>
<b:ImportantField>
<xsl:text>b:Title</xsl:text>
</b:ImportantField>
<b:ImportantField>
<xsl:text>b:JournalName</xsl:text>
</b:ImportantField>
<b:ImportantField>
<xsl:text>b:Year</xsl:text>
</b:ImportantField>
<b:ImportantField>
<xsl:text>b:pages</xsl:text>
</b:ImportantField>
</b:ImportantFields>

So if you wanted to ensure that the 'Issue' field would show up by default,
you would have to add a:

<b:ImportantField>
<xsl:text>b:Issue</xsl:text>
</b:ImportantField>

Where and how this operation is defined inside the xsl depends on how the
xsl was created. In APA.xsl, the easiest thing is to look for:

<xsl:when test="b:GetImportantFields/b:SourceType='JournalArticle'">

You can of course substitute JournalArticle for other types of sources.




Now that you can define new fields and mark them as important or not, there
is one step left to do: displaying your field in a citation or bibliography.
I'm only going to consider a bibliography here but the principle is similar
for in-text citations.

When Word wants to format a bibliography, it sends a list of all the sources
it wants in the bibliography wrapped in a b:Bibliography element. The xsl
does its magic with that input and returns an HTML file. Word then takes
that HTML file and inserts it into your document. So Word gives something
like:

<b:Bibliography>
<!-- some localized stuff like what is 'and' in your language -->
<b:Source>
<!-- the content of the source -->
</b:Source>
<b:Source>
<!-- the content of the source -->
</b:Source>
<b:Source>
<!-- the content of the source -->
</b:Source>
</b:Bibliography>

And gets back something in the lines of

<html>
<head></head>
<body>
<p>My first source</p>
<p>My second source</p>
<p>My third source</p>
</body>
</html>

As to how the different p elements in the above html are generated, that's
up to the creator of the xsl. The principle is simple but the process is
complex. The reason is, you have to cover every possible case (well you
don't have to, but it is polite to do so). The availability of one element
can influence the look of other elements or the separators between elements.
In the end, you get one giant heap of if loops. A mess to navigate through
(this is actually what BibWord tries to simplify) resulting in an xsl of a
few 1000 lines scaring people away.

Some style authors try to add some order to this madness. For example, in
the APA stylesheet, you can look for:

<xsl:when test="b:Bibliography">

This indicates where the bibliography formatting part begins. Then there is
a small piece of sorting your sources, after which each source is processed
using a for-each loop:

<xsl:for-each select="msxsl:node-set($sList)/b:Bibliography/b:Source">

In that loop, a number of variables are calculated first. Things like the
number of authors, how the title should look like (italics, bold, ...). The
second part of the loop then display the source based on its type and those
variables. You will find a piece of code looking like:

<xsl:choose>
<xsl:when test="b:SourceType='Book'">
<!-- display information if your source is a book -->
</xsl:when>
<xsl:when test="b:SourceType='BookSection'">
<!-- display information if your source is a section of a book -->
</xsl:when>
<!-- other types of sources -->
<xsl:choose>

If you want to add your DOI, you will have to do it here. If you are lucky
enough that your DOI just has to be at the end of the reference, you can
move to just before the </xsl:when> of the source type you want to add it to
and put your code there. Your code could be something simple like checking
if there is a DOI, and if so, display it. So you would get something looking
like:

<xsl:if test="string-length(b:DOI)>0">
<xsl:text> doi:</xsl:text>
<xsl:value-of select="b:DOI" />
</xsl:if>

Of course, if you want it elsewhere, you will have to start looking through
the code.

On a final note, unless you can think of some good reasons, you really
should consider using the StandardNumber field rather than inventing your
own DOI field.

Yves
 
N

NickSKF

Got the DOI field. Followed every instruction. But when I insert
Bibliography, no DOI information included.
 
N

NickSKF

Got the DOI field. Followed every instruction. But when I insert
Bibliography, no DOI information included.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top