2016-08-19 15 views
1

我的論文使用APA引用。但是,以泰文撰寫的研究文件,內聯引文必須是(姓氏名,年份)形式,而不是APA(姓,年份)。這應該可以通過自定義的Microsoft Word 2013參考書目風格實現,該風格需要對C:\ Program Files(x86)\ Microsoft Office \ Office14 \ Bibliography \ Style中的APA.XSL文件進行調整,以包含類似於以下內容的其他邏輯:根據源語言環境調整Word 2013參考書目風格以顯示APA引用(名字姓,年份)

<xsl:choose> 
    <xsl:when test="b:LCID='1054'"> 
     (Firstname Lastname, year) 
    </xsl:when> 
    <xsl:otherwise> 
     (Lastname, year) 
    </xsl:otherwise> 
</xsl:choose> 

我認爲,額外的邏輯應該在這個部分被添加,並且它必須包括一個調整的xsl:模板formatNameCore。

<xsl:variable name="author0"> 
</xsl:variable> 

但是,我的想法正在繪製一個空白。我想知道有沒有人能指出我正確的方向。非常感謝幫助。

Here's the current xsl file

回答

0

它是與這些模板:

<xsl:template name="templ_prop_APA_CitationShort_FML" > 
    <xsl:param name="LCID" /> 
    <xsl:variable name="_LCID"> 
    <xsl:call-template name="localLCID"> 
     <xsl:with-param name="LCID" select="$LCID"/> 
    </xsl:call-template> 
    </xsl:variable> 
    <xsl:value-of select="/*/b:Locals/b:Local[@LCID=$_LCID]/b:APA/b:CitationShort/b:FML"/> 
</xsl:template> 
<!-- ... --> 
<xsl:template name="templ_prop_APA_CitationShort_FL" > 
    <xsl:param name="LCID" /> 
    <xsl:variable name="_LCID"> 
    <xsl:call-template name="localLCID"> 
     <xsl:with-param name="LCID" select="$LCID"/> 
    </xsl:call-template> 
    </xsl:variable> 
    <xsl:value-of select="/*/b:Locals/b:Local[@LCID=$_LCID]/b:APA/b:CitationShort/b:FL"/> 
</xsl:template> 

嘗試:

<xsl:template name="templ_prop_APA_CitationShort_FML" > 
    <xsl:param name="LCID" /> 
    <xsl:variable name="_LCID"> 
    <xsl:call-template name="localLCID"> 
     <xsl:with-param name="LCID" select="$LCID"/> 
    </xsl:call-template> 
    </xsl:variable> 
    <xsl:value-of select="/*/b:Locals/b:Local[@LCID=$_LCID]/b:APA/b:CitationShort/b:FM"/> 
    <xsl:text> </xsl:text> 
    <xsl:value-of select="/*/b:Locals/b:Local[@LCID=$_LCID]/b:APA/b:CitationShort/b:FML"/> 
</xsl:template> 
<!-- ... --> 
<xsl:template name="templ_prop_APA_CitationShort_FL" > 
    <xsl:param name="LCID" /> 
    <xsl:variable name="_LCID"> 
    <xsl:call-template name="localLCID"> 
     <xsl:with-param name="LCID" select="$LCID"/> 
    </xsl:call-template> 
    </xsl:variable> 
    <xsl:value-of select="/*/b:Locals/b:Local[@LCID=$_LCID]/b:APA/b:CitationShort/b:FM"/> 
    <xsl:text> </xsl:text> 
    <xsl:value-of select="/*/b:Locals/b:Local[@LCID=$_LCID]/b:APA/b:CitationShort/b:FL"/> 
</xsl:template> 

我想不通越來越填充這些值在那裏,所以這是我能做到的最好目前。

在這裏做這個改變似乎是安全的,而不是在<xsl:variable name="author0">...</xsl:variable>的循環中,因爲它只能從那裏調用。這一改變不會影響您的書目。

您可能還需要修改其他temp1_prop_APA_*_*模板。

+0

謝謝你,克里斯。我贊同你。按照您的建議,我將在temp1_prop_APA _ * _ *模板中進行調整。只希望我能找出那些b的定義:FML,b:FM,b:FL等等。奇怪的是,C:中的搜索似乎並沒有產生任何與之相關的任何內容。 –

1

經過一些搜索(和閱讀),我已經在this post迷迷糊糊中,所有的temp1_prop_APA_ _被指定爲包含如下:

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 

有什麼可失去的;因此,我嘗試了。雖然我不知道這些%L,%F或%M以及它們的小寫對應詞是如何發生的(說明本來不錯),但表達式確實有效。反過來,下面是包含調整後代碼的部分。到目前爲止,它似乎爲此目的而工作。

<xsl:template name="templ_prop_APA_CitationLong_FML" > 
    <xsl:param name="LCID" /> 
     <xsl:variable name="_LCID"> 
      <xsl:call-template name="localLCID"> 
       <xsl:with-param name="LCID" select="$LCID"/> 
      </xsl:call-template> 
     </xsl:variable> 
    <xsl:choose> 
     <xsl:when test="$_LCID='1054'"> 
      <xsl:value-of select="'%F %M %L'"/> 
     </xsl:when> 
     <xsl:otherwise> 
      <xsl:value-of select="'%L, %F %M'"/> 
     </xsl:otherwise> 
    </xsl:choose> 
</xsl:template> 

<xsl:template name="templ_prop_APA_CitationLong_FM" > 
    <xsl:param name="LCID" /> 
    <xsl:variable name="_LCID"> 
     <xsl:call-template name="localLCID"> 
      <xsl:with-param name="LCID" select="$LCID"/> 
     </xsl:call-template> 
    </xsl:variable> 
    <xsl:choose> 
     <xsl:when test="$_LCID='1054'"> 
      <xsl:value-of select="'%F %M'"/> 
     </xsl:when> 
     <xsl:otherwise> 
      <xsl:value-of select="'%F %M'"/> 
     </xsl:otherwise> 
    </xsl:choose> 
</xsl:template> 

<xsl:template name="templ_prop_APA_CitationLong_ML" > 
    <xsl:param name="LCID" /> 
    <xsl:variable name="_LCID"> 
     <xsl:call-template name="localLCID"> 
      <xsl:with-param name="LCID" select="$LCID"/> 
     </xsl:call-template> 
    </xsl:variable> 
    <xsl:choose> 
     <xsl:when test="$_LCID='1054'"> 
      <xsl:value-of select="'%M %L'"/> 
     </xsl:when> 
     <xsl:otherwise> 
      <xsl:value-of select="'%L, %M'"/> 
     </xsl:otherwise> 
    </xsl:choose> 
</xsl:template> 

<xsl:template name="templ_prop_APA_CitationLong_FL" > 
    <xsl:param name="LCID" /> 
    <xsl:variable name="_LCID"> 
     <xsl:call-template name="localLCID"> 
      <xsl:with-param name="LCID" select="$LCID"/> 
     </xsl:call-template> 
    </xsl:variable> 
    <xsl:choose> 
     <xsl:when test="$_LCID='1054'"> 
      <xsl:value-of select="'%F %L'"/> 
     </xsl:when> 
     <xsl:otherwise> 
      <xsl:value-of select="'%L, %F'"/> 
     </xsl:otherwise> 
    </xsl:choose> 
</xsl:template> 

<xsl:template name="templ_prop_APA_CitationShort_FML" > 
    <xsl:param name="LCID" /> 
    <xsl:variable name="_LCID"> 
     <xsl:call-template name="localLCID"> 
      <xsl:with-param name="LCID" select="$LCID"/> 
     </xsl:call-template> 
    </xsl:variable> 
    <xsl:choose> 
     <xsl:when test="$_LCID='1054'"> 
      <xsl:value-of select="'%F %M %L'"/> 
     </xsl:when> 
     <xsl:otherwise> 
      <xsl:value-of select="'%L'"/> 
     </xsl:otherwise> 
    </xsl:choose> 
    </xsl:template> 

<xsl:template name="templ_prop_APA_CitationShort_FM" > 
    <xsl:param name="LCID" /> 
    <xsl:variable name="_LCID"> 
     <xsl:call-template name="localLCID"> 
      <xsl:with-param name="LCID" select="$LCID"/> 
     </xsl:call-template> 
    </xsl:variable> 
    <xsl:choose> 
     <xsl:when test="$_LCID='1054'"> 
      <xsl:value-of select="'%F %M'"/> 
     </xsl:when> 
     <xsl:otherwise> 
      <xsl:value-of select="'%F'"/> 
     </xsl:otherwise> 
    </xsl:choose> 
</xsl:template> 

<xsl:template name="templ_prop_APA_CitationShort_ML" > 
    <xsl:param name="LCID" /> 
    <xsl:variable name="_LCID"> 
     <xsl:call-template name="localLCID"> 
      <xsl:with-param name="LCID" select="$LCID"/> 
     </xsl:call-template> 
    </xsl:variable> 
    <xsl:choose> 
     <xsl:when test="$_LCID='1054'"> 
      <xsl:value-of select="'%M %L'"/> 
     </xsl:when> 
     <xsl:otherwise> 
      <xsl:value-of select="'%L'"/> 
     </xsl:otherwise> 
    </xsl:choose> 
</xsl:template> 

<xsl:template name="templ_prop_APA_CitationShort_FL" > 
    <xsl:param name="LCID" /> 
    <xsl:variable name="_LCID"> 
     <xsl:call-template name="localLCID"> 
      <xsl:with-param name="LCID" select="$LCID"/> 
     </xsl:call-template> 
    </xsl:variable> 
    <xsl:choose> 
     <xsl:when test="$_LCID='1054'"> 
      <xsl:value-of select="'%F %L'"/> 
     </xsl:when> 
     <xsl:otherwise> 
      <xsl:value-of select="'%L'"/> 
     </xsl:otherwise> 
    </xsl:choose> 
</xsl:template> 

注意:包含完整文件here