Eu gostaria de poder obter título, autor, ano sem colchetes.
Apresentamos a seguir como criar um estilo de bibliografia personalizada básica no Word. O link também contém instruções para criar estilos mais complexos.
Crie estilos de bibliografia personalizados
First, create a basic bibliography style that the custom style will follow. Set up the bibliography style
To create a bibliography style, we will create an XML style sheet; that is, an
.xsl
file calledMyBookStyle.xsl
, using your favorite XML editor.Notepad
will do fine. As the name suggests, our example is going to be a style for a “book” source type.At the top of the file, add the following code:
<?xml version="1.0" ?>
<!--List of the external resources that we are referencing-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:b="http://schemas.openxmlformats.org/officeDocument/2006/bibliography">
<!--When the bibliography or citation is in your document, it's just HTML-->
<xsl:output method="html" encoding="us-ascii"/>
<!--Match the root element, and dispatch to its children-->
<xsl:template match="/">
<xsl:apply-templates select="*" />
</xsl:template>
As the comments indicate, Word uses HTML to represent a bibliography or citation within a document. Most of the preceding XML code is just preparation for the more interesting parts of the style. For example, you can give your style a version number to track the changes you make, as shown in the following example.
<!--Set an optional version number for this style-->
<xsl:template match="b:version">
<xsl:text>2006.5.07</xsl:text>
</xsl:template>
More importantly, you can give your style a name. Add this tag:
<xsl:when test="b:StyleNameLocalized">
; and then give your style a name, in the language of your choice, by using the following code.
<xsl:when test="b:StyleNameLocalized/b:Lcid='1033'">
<xsl:text>[Your Style Name]</xsl:text>
</xsl:when>
This section contains the locale name of your style. In the case of our example file, we want our custom bibliography style name, "Simple Book Style,” to appear in the Style drop-down list on the References tab. To do so, add the following XML code to specify that the style name be in the English locale (Lcid determines the language).
<!--Defines the name of the style in the References dropdown list-->
<xsl:when test="b:StyleNameLocalized">
<xsl:choose>
<xsl:when test="b:StyleNameLocalized/b:Lcid='1033'">
<xsl:text>Simple Book Style</xsl:text>
</xsl:when>
</xsl:when>
Your style will now appear under its own name in the Bibliography Style dropdown list-box in the application.
Now, examine the style details. Each source type in Word (for example, book, film, article in a periodical, and so forth) has a built-in list of fields that you can use for the bibliography. To see all the fields available for a given source type, on the References tab, choose Manage Sources, and then in the Source Manager dialog box, choose New to open the Create Source dialog box. Then select Show All Bibliography Fields.
A book source type has the following fields available:
- Author
- Title
- Year
- City
- State/Province
- Country/Region
- Publisher
- Editor
- Volume
- Number of Volumes
- Translator
- Short Title
- Standard Number
- Pages
- Edition
- Comments
In the code, you can specify the fields that are important for your bibliography style. Even when Show All Bibliography Fields is cleared, these fields will appear and have a red asterisk next to them. For our book example, I want to ensure that the author, title, year, city, and publisher are entered, so I want a red asterisk to appear next to these fields to alert the user that these are recommended fields that should be filled out.
<!--Specifies which fields should appear in the Create Source dialog box when in a collapsed state (The Show All Bibliography Fields check box is cleared)-->
<xsl:template match="b:GetImportantFields[b:SourceType = 'Book']">
<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:Year</xsl:text>
</b:ImportantField>
<b:ImportantField>
<xsl:text>b:City</xsl:text>
</b:ImportantField>
<b:ImportantField>
<xsl:text>b:Publisher</xsl:text>
</b:ImportantField>
</b:ImportantFields>
</xsl:template>
The text in the
<xsl:text>
tags are references to theSources.xml
file. These references pull out the data that will populate each of the fields. ExamineSources.xml
(%APPDATA%\Microsoft\Bibliography\Sources.xml
) to get a better idea about how these references match up to what is in the XML file.Design the layout
Output for bibliographies and citations is represented in a Word document as HTML, so to define how our custom bibliography and citation styles should look in Word, we’ll have to add some HTML to our style sheet.
Suppose you want to format each entry in your bibliography in this manner:
Last Name, First Name. (Year). Title. City: Publisher
The HTML required to do this would be embedded in your style sheet as follows.
<!--Defines the output format for a simple Book (in the Bibliography) with important fields defined-->
<xsl:template match="b:Source[b:SourceType = 'Book']">
<!--Label the paragraph as an Office Bibliography paragraph-->
<p>
<xsl:value-of select="b:Author/b:Author/b:NameList/b:Person/b:Last"/>
<xsl:text>, </xsl:text>
<xsl:value-of select="b:Author/b:Author/b:NameList/b:Person/b:First"/>
<xsl:text>. (</xsl:text>
<xsl:value-of select="b:Year"/>
<xsl:text>). </xsl:text>
<i>
<xsl:value-of select="b:Title"/>
<xsl:text>. </xsl:text>
</i>
<xsl:value-of select="b:City"/>
<xsl:text>: </xsl:text>
<xsl:value-of select="b:Publisher"/>
<xsl:text>.</xsl:text>
</p>
</xsl:template>
When you reference a book source in your Word document, Word needs to access this HTML so that it can use the custom style to display the source, so you'll have to add code to your custom style sheet to enable Word to do this.
<!--Defines the output of the entire Bibliography-->
<xsl:template match="b:Bibliography">
<html xmlns="http://www.w3.org/TR/REC-html40">
<body>
<xsl:apply-templates select ="b:Source[b:SourceType = 'Book']">
</xsl:apply-templates>
</body>
</html>
</xsl:template>
In a similar fashion, you'll need to do the same thing for the citation output. Follow the pattern (Author, Year) for a single citation in the document.
<!--Defines the output of the Citation-->
<xsl:template match="b:Citation/b:Source[b:SourceType = 'Book']">
<html xmlns="http://www.w3.org/TR/REC-html40">
<body>
<!-- Defines the output format as (Author, Year)-->
<xsl:text>(</xsl:text>
<xsl:value-of select="b:Author/b:Author/b:NameList/b:Person/b:Last"/>
<xsl:text>, </xsl:text>
<xsl:value-of select="b:Year"/>
<xsl:text>)</xsl:text>
</body>
</html>
</xsl:template>
Close up the file with the following lines.
<xsl:template match="text()" /> </xsl:stylesheet>
Save the file as
MyBookStyle.XSL
and drop it into the Styles directory (%appdata%\Microsoft\Bibliography\Style
). Restart Word, and your style is now under the style dropdown list. You can start using your new style.