ISO 690 First Element: How to Make Changes

Aug 7, 2009 at 7:07 PM

If this post appears twice, sorry. My computer hiccuped and it looked like the text was lost before posting.

I have only just started using the bibliography feature of Word 2007. I have several questions:

Q1: I want to keep the year date next to the author at the beginning, but we prefer to show month at the tail end instead. Using "Report" as source, if I include the month in the "date" field, it also shows up in the citation, and at the beginning by the author. Is there a way to create a new field called "month" and get it to display at the end? Or is there another field I could cheat and use that would display at the end? I tried using the "pages" field but it inserted a "pp." in front.

Sapere Consulting, Inc. (Sapere). 2006. Environmental Baseline Report. 2006.

 

Q2: When citing the same author multiple times, it only gives the author name in the first instance, after that, it uses dashes, as shown below. Is there a way around this?

Client. 2007 HH. Development and Use of Risk-Based Preliminary Remediation Goals for Ecological Risk Assessment. 2007 HH. SLAC-I-750-3A33H-017.

—. 2002. Celebrating 40 Years: A Photo History. [ed.] Jean Marie Deken. 2002. SLAC-R-605.

 

Q3: Some of our reports have ID numbers we need to display. I want the ID number to show just before the date, the date should be last item. In the example below, I used the "standard number" field in "report" source.

Client. 2007. Development and Use of Risk-Based Preliminary Remediation Goals for Ecological Risk Assessment. 2007 HH. SLAC-I-750-3A33H-017.

 

Any help you can give this newbie would be appreciated.

Coordinator
Aug 7, 2009 at 10:35 PM

That's one of the default Word styles. I don't really look at those anymore because their formatting is way too complex to rule out every exception. If you want to reorder elements, my opinion is to either start from scratch, or use a BibWord style where it is a lot easier to move things around.

I can give you some quick pointers:

Regarding Q1:

There is no "date" field in the input form. Day, Month, and Year are three separate fields. It might not be possible to enter the month field as in, it might be invisible. In such a case, you could always try to switch temporarely to another source type which does have it, fill in the month there and switch back to the intended source type. Word will store the month correctly. Of course, if the field is not available in the first place, there is a good chance that it won't be displayed by the style either. If that is the case, you will have to find out everywhere the year is displayed and add the month if required.

If you are only going to use the style on your own machine, then you might want to edit the bibform.xml file so the month field becomes available for your type.

 

Regarding Q2:

The dashes are made by calling the templ_prop_ISO690_SameAuthor template. So what you will want to do is looking for lines which look similar to the following:


<xsl:call-template name="templ_prop_ISO690_SameAuthor"/>

There should be two instances (one for journal articles and conference proceedings, and one for all the rest). On closer inspection, you will see that those calls are wrapped inside xsl:when statements which check if the previous work has the same author/title. Without doing major testing, I'm assuming that removing the entire when-clause should result in the author/title to be always shown rather than the dashes.

 

Regarding Q3:

That means an entire reordering of elements. Not a good idea with the predefined types. You will have to figure out where/when each element is displayed and then move them around. Most 'elements' are formatted beforehand after which they are all displayed in the order according to their type. The specific display order can often be found in the when-clause starting with code looking like this

<xsl:when test="b:SourceType='Report'">

where 'Report' can be any of the predefined types ('Book', 'JournalArticle', ...). You will have to check what happens with the separators (periods, commas, ...) on a case by case basis.

For 'Report' you could probably move StandardNumber to just behind DepartmentAndInstitution. So something along the following lines:

...
<xsl:value-of select ="$DepartmentAndInstitution"/>
<xsl:value-of select ="$StandardNumber"/>
<xsl:call-template name='PrintList'>
...

Note that the separators between the fields might be broken though.

Aug 8, 2009 at 12:40 AM

Thank you so much for the tips. Multiple users, and thus multiple computers, will be using this style.

After evaluating the Bibword styles, I found that Harvard Anglia took care of two of my problems (thank you so much, whoever made that style). It now repeats the author names, instead of dashes, for subsequent entries. And the second instance of the year has disappeared.

I also found that I could get things to display in the order I wanted by putting them into different fields. If I enter the month in the comment field, it appears as the last item. And if I put the ID Number into the Report Type field, that works. My output now looks like:

CFN, 2002. Celebrating 40 Years: A Photo History. XXX-R-605. Jean Marie Deken, Senior Editor.

CFN, 2006. The Geology of the Eastern Part of Site. XXX-I-750-3A33X-001. February.

CFN, 2007 HH. Development and Use of Risk-Based Preliminary Remediation Goals for Ecological Risk Assessment. XXX-I-750-3A33H-017. May 22.

Client Fictitious Name (CFN), 1999. Preliminary Site Assessment. XXX-I-750-OA33H-001. October.

 

Now I have some *new* questions.

Q1: When the same author has multiple references, it puts them into date order, with oldest date first, as above. Is there a way to reverse the order to most recent date first, instead (2009 would be first, then 2008, 2007, etc.)?

Q2: I would like to change the comma between author name and year to a period instead.  Where to make this change?

Q3: We frequently shorten or acronymize author names (these are usually corporate authors) after their first occurrence. This causes two problems. a) authors are put into alphabetical order, so often the full version name will not appear next to the short version name. Anyway to link them or group them, or associate them? and b) the citation for the full version name looks like (Client Fictitious Name (CFN), 1999). Anyway to override this and have it display the short version?

Thank you for your help.

Coordinator
Aug 8, 2009 at 11:19 PM

Q1:

No not directly. BibWord creates a sortkey string to sort on. So it will always place 2007 before 2008. Actually, even commercial products like EndNote can not do this for the exact same reason.

However, since the styles or actually XSLT code, you could rewrite an entire sorting mechanism the way you want. If you want to put minimal effort into it, you could hack the BibWord engine as follows: look where a b:SortKey element is generated and change it value in such a way that entries from 2008 will be placed before 2007. The latter could be achieved by using a simple replacement routine which does a 'reverse' before actually writing the value. So that would mean you run a simple string replacement function which replaces 0 by 9, 1 by 8, 2 by 7, 3 by 6, 4 by 5, 5 by 4, 6 by 3, 7 by 2, 8 by 1, and 9 by 0 before assigning the value.

An example:

Doe, 2008    would become    Doe, 7991

Doe, 2009    would become    Doe, 7990

When those two entries would be sorted (based on the value of SortKey), "Doe, 7990" would come before "Doe, 7991" resulting in "Doe, 2009" being displayed before "Doe, 2008".

Q2:

Every formatting in BibWord is stored within the data variable. Normally that variable is located at the top of the file. In it, there is a bibliography element which contains all formatting info for the bibliography. For each type of sources supported, there is a format element containing the specific format string for that source type.

For example, the one for ArticleInAPeriodical in HarvardAnglia looks like this:

<format>{%Author:2|"Anon."%,}{ %Year|"n.d."%{%YearSuffix%}.}{ %Title|ShortTitle%.}{ &lt;i&gt;%PeriodicalTitle%&lt;/i&gt;,}{ [%Medium%]}{ {%Day% }%Month:s%.}{ %Pages:p.:pp.:a2%}.{ Available at: &lt;u&gt;%URL:l%&lt;/u&gt;}{ [Accessed{{ %DayAccessed%} %MonthAccessed:s%} %YearAccessed%]}.{ %Comments%.}</format>

To change your "," into ".", you just have to change it where the author is displayed. So

{%Author:2|"Anon."%,}

would become

{%Author:2|"Anon."%.}

Don't worry that there will be 2 periods if a work is anonymous. BibWord will clean that up for you.

Q3:

No. Not using BibWord. Again, if you would write your entire style from scratch in XSLT, this is something you could do.

 

Coordinator
Aug 8, 2009 at 11:28 PM

Note regarding Q1, rather than a replacement at the end, you could temporarly replace the value of b:Year to (9999 - b:Year). This would probably require the least code.

Aug 10, 2009 at 8:21 PM
I did a search for b:Year and don't see where its value is assigned. Where in the following code (taken out of the Harvard Anglia style sheet) would I make this replacement?

<!-- Sort the elements for YearSuffix.
-->
- <xsl:variable name="sortedForYearSuffix">
-
- <xsl:for-each select="msxsl:node-set($withBibOrder)/b:BibWord/b:Source">
- <!-- Sort by YSReq first to group entries which might require year suffices.
-->
<xsl:sort select="b:YSReq" data-type="text" />
<xsl:sort select="b:SortKey" data-type="text" />
-
- <!-- Copy all elements.
-->
- <xsl:for-each select="./*">
<xsl:copy-of select="." />
</xsl:for-each>

</xsl:for-each>

</xsl:variable>
- <!-- Add the YearSuffix element.
-->
-
- <xsl:for-each select="msxsl:node-set($sortedForYearSuffix)/b:BibWord/b:Source">
-
- <!-- Copy all elements except for YSReq and SortKey.
-->
- <xsl:for-each select="./*">
- <xsl:if test="local-name() != 'YSReq' and local-name() != 'SortKey'">
<xsl:copy-of select="." />
</xsl:if>
</xsl:for-each>
- <!-- Add the YearSuffix element.
-->
-
<xsl:variable name="current" select="./b:YSReq" />
<xsl:variable name="previous" select="preceding-sibling::b:Source[1]/b:YSReq" />
<xsl:variable name="next" select="following-sibling::b:Source[1]/b:YSReq" />
- <xsl:choose>
- <!-- Continuation of a series.
-->
- <xsl:when test="position() > 1 and $current = $previous">
- <xsl:call-template name="get-year-suffix">
<xsl:with-param name="index" select="position()" />
<xsl:with-param name="bibWord" select="$sortedForYearSuffix" />
</xsl:call-template>
</xsl:when>
- <!-- First in a series.
-->
- <xsl:when test="last() > position() and $current = $next">
<xsl:text>a</xsl:text>
</xsl:when>
- <!-- Not part of a series, the element is empty.
-->
<xsl:otherwise />
</xsl:choose>


</xsl:for-each>

</xsl:template>


>>> yves <notifications@codeplex.com> 8/8/2009 4:28 pm >>>
From: yves

Note regarding Q1, rather than a replacement at the end, you could temporarly replace the value of b:Year to (9999 - b:Year). This would probably require the least code.

Coordinator
Aug 11, 2009 at 6:23 AM

Nowhere. This is the code that decides on the year suffix to display (and requires the Extender tool to run properly).

What you need is to adapt the value of the year that is used when the b:SortKey element is generated. You want your year to be "inverted" (9999-Year) there so that they get ordered differently. Currently the b:SortKey element gets generated in two places.

If I have some time today or tomorrow I'll try to move all the SortKey stuff into one template function. It should be a nice code cleanup and it should be a lot easier to make the adjustment you require.

Coordinator
Aug 11, 2009 at 6:57 PM

You can find a version of Harvard Anglia at http://allserv.ugent.be/~ydhondt which might do the trick for you. The entire sortkey generation process is now defined in the template "create-sortkey" at the bottom of the stylesheet. A special adaption was done to substract the year from 9999 and thereby achieve a reversed order.

This version will only be there for a couple of days before it will probably get removed.

Aug 12, 2009 at 12:10 AM
Thanks Yves, I downloaded it and will check it out.

>>> yves <notifications@codeplex.com> 8/11/2009 11:57 am >>>
From: yves

You can find a version of Harvard Anglia at
http://allserv.ugent.be/~ydhondt which might do the trick for you.
The entire sortkey generation process is now defined in the template
"create-sortkey" at the bottom of the stylesheet. A special adaption was
done to substract the year from 9999 and thereby achieve a reversed
order.This version will only be there for a couple of days before it
will probably get removed.

Aug 20, 2009 at 12:25 AM

Yves,

The version of Harvard Anglia you suggested did fix the date order, now they are reversed, just the way I wanted them. I have made the other edits I had previously made to change field output order, commas vs. periods, etc.

I want to add a lower-case letter as a year suffix for multiple instances of same author in same year. I have downloaded and installed BibWord extender, but can't seem to get it to work. I generated my bibliography, then closed word. Opened the Bibworder Extender2.exe file to run the program, pointed it at where the style sheets are on the C drive, then from within the BibWord extender dialog box, selected the Word doc containing my bibliography. It gave me this error message:

"Unhandled exception has occurred in your application. If you click Continue, the application will ignore this error and attempt to continue. If you click Quit, the application will close immediately.

Could not load file or assembly 'WindowsBase, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified."

Could it have something to do with defining both the sortkey and the yearsuffix element in the style sheet first??? If so, where do I do that?

Coordinator
Aug 20, 2009 at 6:26 AM

It sounds as if you don't have the .Net framework 3.5 (which contains WindowsBase.dll) installed. See the requirements section at http://bibword.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=24823