Skip to main content

 Tutorials

Task-driven tutorials and recipes for PageSeeder

How to export footnotes/endnotes to DOCX

Skills requiredXML
Time required (minutes)15
Intended audienceDeveloper
DifficultyEasy
CategoryDocument

Objective

This tutorial demonstrates how to create footnotes or endnotes and export them to Word DOCX.

Prerequisites

To complete this tutorial requires:

  • PageSeeder administrator access to a server with PageSeeder version 6.2 or later installed.

All the files for this tutorial are on Github .

Tutorial

Project setup and installing configuration bundle

  1. Login to PageSeeder as an administrator.
  2. Go to the project where you would like to install these capabilities. Alternatively create a new project by clicking the System administration button at top right. Then click on New project under Projects & Groups and enter a project name, plus any description, then Submit.
  3. Click the Project administration button at the top.
  4. Select Template files from the left menu and click the Create button at the bottom of the page to open the Samples dialog.
  5. Install a configuration bundle – Click the Bundle button, then in the Bundle type field, select Document type from the dropdown.
    1. Click the Select button to the right of a bundle – for this example, select Basic auto-numbered publication. You can also select Intermediate or Advanced if you want bibliography or glossary features.
    2. Install the bundle under the root document type for your publication (e.g references, shown in the Document type field on the right of the dialog). Click Install.

Verify package content - project configuration files

In the Template files page check the files as follows.

Export process

The psml/references/export folder (or the document type you specified) contains the following files:

FilenameDescription
build.xmlCustom ANT script for exporting to docx. Not required but is used for this tutorial.
psml-to-docx.xslXSLT that adds the document labels necessary to format the publication root document. Not required but is used for this tutorial.
Document types

Select Template configuration from the left menu which should display these PSML document types:

Document typeDescription
defaultThe content of a publication. Includes a CSS style to display footnote and endnote references as superscripts in the user interface.
references (or your type)The root document of a publication. Includes the custom export configuration.
endnotesEndnotes for a publication.
footnotesFootnotes for a publication.
helpNot required for this tutorial.
XRef configuration

Select Edit XRef configs (top right).

FilenameDescription
xref-config.xmlThe Xref configuration for the import of cross-references including footnotes, endnotes, citations, and more as listed below.

The following xref configs should be listed (see Xref config):

  • footnote – to insert a footnote reference.
  • endnote – to insert an endnote reference.
  • paraNot required for this tutorial.
  • internal-paraNot required for this tutorial.
  • numbered-headingNot required for this tutorial.
  • captionNot required for this tutorial. 

Creating a publication

Create a publication root document and content as follows:

  1. In PageSeeder go to a group under the project from Step 1. Alternatively create a new group by clicking the Project administration button at the top. Then select Create group from the left menu and enter a group name, plus any description, then Submit and Go to group.
  2. In this group create or open an existing document of the root type you selected previously (e.g. references ).
  3. Click the Document information icon on the right, click Make this document a publication, ensure there is a Publication ID and for this example, select Publication type "default". Click Submit then Save.
  4. If there is no existing content, double-click in the root document, click Browse and create a document (for example default type), select it and save. On the root document press Ctrl-S to save everything.
  5. Click a content document, add some headings and paragraphs if required.

Footnotes or Endnotes

The model for this implementation is that a custom link type generates a simple link title and prompts the user to create a new fragment, or refer to an existing one, in the footnote or endnote document.

The generation of the link title, an “f” or an “e” with a numeric qualifier, happens when saving the xref. Upon export of the publication to Word, there is a transformation of these objects to native docx footnotes or endnotes.

This solution requires the creation of custom document types to hold the footnote or endnote fragments. Whether this document already exists will depend on whether the content came from an impoerted docx file that already had footnotes or endnotes, or whether the document is being written in PageSeeder.

To determine this, follow these steps

  1. Go to the folder containing your content documents.
  2. Create a document with document type Footnotes. If you get an error then it already exists, otherwise click the icon at top right enter edit mode.
  3. Add one or more fragments containing footnote content.
  4. Create a document with document type Endnotes. If you get an error then it already exists, otherwise click the icon at top right enter edit mode.
  5. Add one or more fragments containing endnote content.
  6. In a content document, enter edit mode by double-clicking on a paragraph.
  7. Place the cursor in the text and select the Insert/edit cross-reference icon, available either in the document toolbar at the top or in the editing context menu when you right-click in the text. The Xref dialog opens.
  8. In the Configuration field, select the XRef configuration, either Footnote or Endnote, from the drop-down. The Footnotes or Endnotes document displays in the main section. The process for inserting both footnotes and endnotes is similar. The following images display the footnote process:
    Select an Xref configuration for your xref 
  9. In the main section, click on the footnote fragment that you want to reference.
    Select a footnote fragment to reference
  10. The xref details display. The "Title template" field contains the link title that displays in your document. It has the generated letter “f” and the {fragment}, which is automatically populated with a numeric qualifier – the fragment number in the footnotes document – when you save the xref details. The "Link type" field shows alternate (as specified in the footnote xref template).
    Footnote link text and link type
  11. Click Save to insert the xref in your document. In the following image, the link text "f4" references fragment 4 in the Footnotes document. Press Ctrl-S to finalize the insertion.
    Xref inserted – showing generated link title

Export as a Word document

  1. Go to any document in your publication.
  2. Click the Document export (rocket) icon in the left margin.
  3. Under the Choose an export action drop down, select Export publication as custom DOCX and click Run.
  4. Open the document in Microsoft Word and see how the footnotes and endnotes are displayed by Word.
Created on , last edited on

Available tutorials