View Single Post
  #26   Report Post  
Posted to microsoft.public.word.docmanagement
Chrog Chrog is offline
external usenet poster
 
Posts: 4
Default How can I make a custom bibliography style?

Thanks this did the trick; it is working great!!!! One other quesiton that
you might be able to help with. When there are two authors for some source
the second is always listed as LAST, FIRST but I want it the other way around.

For example:
Smith, John and Jane Doe. 2020. etc.

not

Smith, John and Doe, Jane. 2020. etc.

I tried to make some adjustments in the (formatSecondaryName) part of the
code but nothing changed. Any advice?


"p0" wrote:

On 4 sep, 05:06, Chrog wrote:
Hello, I have been reading this string of posts and I think that maybe
someone here might be able to help me. I need to alter the APA style to the
LSA style. They are pretty much the same except Word 2007 keeps truncating
some author's first names, and putting parentheses aroung the date.

I am pretty sure there is a limit on the string length for the author's name
that might be increased but I have no idea where to look for it. I have no
clue how to fix the parentheses issue.


Before toying around with the APA.xsl I suggest you make a copy of it
and call it LSA.xsl. Put the copy in the same directory as APA.xsl.
Open up your new created LSA.xsl and look for a piece of xml looking
like this:
xsl:when test="b:OfficeStyleKey"
xsl:textAPA/xsl:text
/xsl:when

Change it into:
xsl:when test="b:StyleName"
xsl:textLSA/xsl:text
/xsl:when

Save the entire thing. Now when you start up Word, there will be an
LSA entry in the style list to pick from. Starting from here, you
should only play around with LSA.xsl and NOT with APA.xsl.

The parentheses around the year are put there during the declaration
of the "enclosedYearDot" variable by the following code (located
around line 5039):

xsl:variable name="enclosedYearDot"
xsl:if test="string-length($year)0"
xsl:call-template name="templ_prop_APA_GeneralOpen"/
xsl:value-of select="$year"/
xsl:call-template name="templ_prop_APA_GeneralClose"/
xsl:call-template name="templ_prop_Dot"/
/xsl:if
/xsl:variable

By removing the calls to templ_prop_APA_GeneralOpen and
templ_prop_APA_GeneralClose you will remove the brackets. So you would
get:

xsl:variable name="enclosedYearDot"
xsl:if test="string-length($year)0"
!--xsl:call-template name="templ_prop_APA_GeneralOpen"/--
xsl:value-of select="$year"/
!--xsl:call-template name="templ_prop_APA_GeneralClose"/--
xsl:call-template name="templ_prop_Dot"/
/xsl:if
/xsl:variable

Note that right under the declaration of enclosedYearDot,
enclosedDateDot and enclosedDateEmptyDot are declared. They put
'entire' dates between brackets. So you also might want to change
those if you don't want brackets around any date.


The name of one of the main contributors to a work is formatted as
follows:

xsl:template name="formatMainAuthor"
xsl:call-template name="formatNameCore"
xsl:with-param name="FML"
xsl:call-template name="templ_prop_APA_MainAuthors_FML"/
/xsl:with-param
xsl:with-param name="FM"
xsl:call-template name="templ_prop_APA_MainAuthors_FM"/
/xsl:with-param
xsl:with-param name="ML"
xsl:call-template name="templ_prop_APA_MainAuthors_ML"/
/xsl:with-param
xsl:with-param name="FL"
xsl:call-template name="templ_prop_APA_MainAuthors_FL"/
/xsl:with-param
xsl:with-param name="upperLast"no/xsl:with-param
xsl:with-param name="withDot"yes/xsl:with-param

/xsl:call-template
/xsl:template

with the following definitions (which you can't change directly):
templ_prop_APA_MainAuthors_FML = %L, %f %m
templ_prop_APA_MainAuthors_FM = %f %m
templ_prop_APA_MainAuthors_ML = %L, %m
templ_prop_APA_MainAuthors_FL = %L, %f
where lower case characters stands for initials and upper case
characters for the full name part. So if you don't want any of the
main authors names abbreviated, you could change the routine into:

xsl:template name="formatMainAuthor"
xsl:call-template name="formatNameCore"
xsl:with-param name="FML"
xsl:value-of select="'%L, %F %M'"/
/xsl:with-param
xsl:with-param name="FM"
xsl:value-of select="'%F %M'"/
/xsl:with-param
xsl:with-param name="ML"
xsl:value-of select="'%L, %M'"/
/xsl:with-param
xsl:with-param name="FL"
xsl:value-of select="'%L, %F'"/
/xsl:with-param
xsl:with-param name="upperLast"no/xsl:with-param
xsl:with-param name="withDot"yes/xsl:with-param

/xsl:call-template
/xsl:template

Once again, note that there is also a formatting routine for secondary
authors right beneath it (formatSecondaryName) which you might want to
change as well to your preferred format.

Yves