Abbreviation configurable

Oct 28, 2010 at 8:54 PM

I want to have the citation tagsfor my master thesis like

Lastname: Musterman

Year: 2010

Tag: [MUS2010]

I allready build up a own citation style (greate solution besides, looking for something like that since while), but it seems something like display only the first 3 characters of the lastname is not possible.  With abbreviation I can just display the first char.

I helped me out in just using the %Tag% field from word and edit it for my needs, but I think this is not the best solution.

An other think: Am I correct, to get automaticaly something like this:

[MUS2010a]

[MUS2010b]

I have to use the external BibTool?

Regards

DerGraue

Coordinator
Oct 29, 2010 at 6:53 AM

There is currently no way to generate an abbreviation which takes only the first 3 letters of a name. If you want such functionality, you would have to extend

<xsl:template name="format-person-part-3">

There you could for example override the casing:

<xsl:variable name="case">
  <xsl:choose>
    <xsl:when test="contains($options, 'u')">
      <xsl:call-template name="upper-case">
        <xsl:with-param name="string" select="$person/*[local-name() = $name]"/>
	  </xsl:call-template>
    </xsl:when>
    <xsl:when test="contains($options, 'l')">
      <xsl:call-template name="lower-case">
        <xsl:with-param name="string" select="$person/*[local-name() = $name]"/>
      </xsl:call-template>
    </xsl:when>
    <xsl:otherwise>
      <xsl:value-of select="$person/*[local-name() = $name]"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:variable>

And add an extra check. You could implement the option "z" for example which gets a 3 character substring.

<xsl:when test="contains($options, 'z')">
  <xsl:value-of select="substring($person/*[local-name() = $name],1,3)"/>
</xsl:when>

You could wrap the middle line in a capitalization call to ensure the letters are uppercase if that is what you wanted.

To get suffixes after the year you would indeed need the BibWord Extender and add the necessary format strings to your style.

Oct 31, 2010 at 8:14 PM

Thanks for the reply. This works great. Minor problem with corporate, I also only use the first chars here, but for example, if I use several articles from wikipedia I get this:

[WIK2010]

[WIK2010]

So my idea was to use only 2 chars from corp and the first char from the title (which works great with names), but this is not possible in the <corporate> tag.

Another thing, The extender is not working. I set up the citations fileds like:

 

<source type="Book">
<format>{%CitationPrefix%}{%Author:1|Editor:1|"Anon."%}{%Year|"n.d."%}{%YearSuffix%}{, %CitationPages:p.:pp.:a2%}{%CitationSuffix%}</format>
</source>

under extensions it is like:
 <source type="Book">
        <yearsuffix>{%Author:0%}{%Year%}</yearsuffix>
 </source>
But the extender didn't add something to the citation tags (a, b, c).

 

 

Coordinator
Nov 1, 2010 at 9:50 AM

You could overwrite

<xsl:template name="format-corporate">

to do something similar for corporations as you did for normal authors. The thing is, you wouldn't have access to the title here by default. You could solve this by adding the title as an extra parameter to the template signature. So instead of

  <!-- Formats a b:Corporate element. -->
  <xsl:template name="format-corporate">
    <!-- The b:Corporate element to format. -->
    <xsl:param name="corporate"/>
    <!-- The format in which to display the b:Corporate element. -->
    <xsl:param name="format"/>

you would get

  <!-- Formats a b:Corporate element. -->
  <xsl:template name="format-corporate">
    <!-- The b:Corporate element to format. -->
    <xsl:param name="corporate"/>
    <!-- The b:Title element. -->
    <xsl:param name="title"/>
    <!-- The format in which to display the b:Corporate element. -->
    <xsl:param name="format"/>

And then the call to format-corporate should include the extra value. Note that you might have to do this at multiple levels to ensure the title trickles down to the format-corporate template.

Have you refreshed all the fields in your document after running the Extender? The simplest way is by reopening your document in Word and then switching the style to a different style and back to the orginal one.