Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

word xsl style formatting

Forum home » Delegate support and help forum » Microsoft Word Training and help » Word, .xsl, Style formatting, bibliography

Word, .xsl, Style formatting, bibliography

ResolvedVersion 365

Rory has attended:
Excel VBA Intermediate course
Excel Intermediate course
Excel Advanced course
Excel VBA Introduction course

Word, .xsl, Style formatting, bibliography

I am trying to translate the skills I learned during the VBA Intro and Intermediate sessions to tackle a problem I have within Word.

I would like to use Word's referencing system to create a bibliography.
I am also using Zotero to manage the reference documents

The University of York I am submitting work to requires use of the Harvard referencing system.

I have managed to find an .xsl file that will format the bibliography as the Harvard style that I require, between Word and Zotero.
https://www.zotero.org/styles?q=york

However, it does not produce a 1.27 cm hanging indent in the bibliography automatically.

Now, I can retroactively do this manually after the bibliography has been generated, but it would be useful for me to learn how to manipulate the code.

RE: Word, .xsl, Style formatting, bibliography

Hi Rory,

Thanks you for the forum question.

Here’s a clear explanation of why your Harvard .xsl style isn’t giving you a 1.27 cm hanging indent — and how you can modify it if you want to learn, plus an easier alternative in Word that many people actually use with Zotero.
________________________________________
First: What’s controlling your formatting?
Zotero’s referencing system uses CSL (Citation Style Language) styles, which are XML files (ending in .csl).
Word does NOT style the bibliography via the XSL, it simply receives the formatted bibliography from Zotero and applies a very basic default paragraph style.
This means:
➤ Hanging indents are NOT controlled by the CSL file
The CSL (or XSL) file controls:
• the order of fields
• punctuation
• italics
• authors’ names
• etc.
But NOT:
• paragraph indentation
• spacing
• justification
• fonts
• leader dots
Those are applied by Word styles.
________________________________________
So how do you get a 1.27 cm hanging indent automatically?
There are two ways:
________________________________________
1 (Recommended): Modify Word’s "Bibliography" style
This is by far the easiest and most robust.
Steps:
1. In Word, generate your bibliography using Zotero.
2. Right click any bibliography entry.
3. Choose Styles → Bibliography → Modify
4. Click Format → Paragraph
5. Set:
o Indentation → Special: Hanging
o By: 1.27 cm
6. Click OK → OK
Now the bibliography will automatically apply a 1.27 cm hanging indent—even if regenerated.
________________________________________
METHOD 2: Edit the CSL (XSL) file — if you want to learn how
Even though CSL cannot control the indent itself, you can add a small block that tells Word to apply formatting using an inline style attribute. This is unofficial and not guaranteed to work in all processors, but it functions in Word for many users.
✔️ Example of adding a hanging indent using CSL
Search inside the CSL file for the <bibliography> element.
It probably looks like this:
<bibliography et-al-min="3" et-al-use-first="1" line-spacing="1" entry-spacing="0">
You can add a CSS-like style attribute:
<bibliography
et-al-min="3"
et-al-use-first="1"
line-spacing="1"
entry-spacing="0"
hanging-indent="true"
second-field-align="flush">
Or the more advanced (Word-friendly) version using style:
<bibliography style="text-indent:-1.27cm; margin-left:1.27cm;">
Important notes:
• Word support for CSL formatting is partial.
• Zotero itself states that paragraph formatting is not guaranteed to transfer through CSL.
• If Zotero ever updates the style, you will need to re edit it.
________________________________________
Recommended approach (for university submissions)
Most universities—including York—expect you to control paragraph formatting using Word styles, not via the referencing tool.
This means:
University guidelines = Harvard content + Word formatting
Zotero handles the content, Word handles the look.
So editing the Word Bibliography style is the correct long-term method.



Kind regards

Jens Bonde
Microsoft Office Specialist Trainer

Tel: 0207 987 3777
STL - https://www.stl-training.co.uk
98%+ recommend us

London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector

RE: Word, .xsl, Style formatting, bibliography

Thank you for the swift and clear response.

Rory.

 

Training courses

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.

Word tip:

Change measurement units in Word

You might find that a computer you are working on is displaying measurements for margins, indents, tabs etc in units other than what you would prefer to use.

You can change measurement units by:

1. Going to Tools - Options.

2. Selecting the General tab.

3. Selecting the desired measurement units from the Measurement Units dropdown list.

4. Clicking OK.

View all Word hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.08 secs.