
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. Examine Sources.xml in \Microsoft\Bibliography\Sources.xml) to get a better idea about how these references match up to what is in the XML file. These references pull out the data that will populate each of the fields. The text in the xsl:text tags are references to the Sources.xml file. 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. Even when Show All Bibliography Fields is cleared, these fields will appear and have a red asterisk next to them. In the code, you can specify the fields that are important for your bibliography style. Then select Show All Bibliography Fields.Ī book source type has the following fields available: 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. 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. Your style will now appear under its own name in the Bibliography Style dropdown list-box in the application.
#How to save a style set in word 2016 code
To do so, add the following XML code to specify that the style name be in the English locale (Lcid determines the language). 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. This section contains the locale name of your style. Add this tag: and then give your style a name, in the language of your choice, by using the following code. More importantly, you can give your style a name. For example, you can give your style a version number to track the changes you make, as shown in the following example. Most of the preceding XML code is just preparation for the more interesting parts of the style. As the name suggests, our example is going to be a style for a "book" source type.Īt the top of the file, add the following code: Īs the comments indicate, Word uses HTML to represent a bibliography or citation within a document. xsl file called MyBookStyle.xsl, using your favorite XML editor. To create a bibliography style, we will create an XML style sheet that is, an. Building a basic bibliography styleįirst, create a basic bibliography style that the custom style will follow. All bibliography styles are stored in \Microsoft\Bibliography\Style. The \Bibliography\Sources.xml file won't exist until you create your first bibliography source in Word.
