About Arbortext Styler > Formatting Footnotes and Endnotes > Creating and Modifying an Inline Model Endnote
  
Creating and Modifying an Inline Model Endnote
Some document types use a single Endnote element to both generate the endnote reference mark and contain the body text of the endnote. This element generates the endnote mark at the place the element appears in the document. You must determine which element in the document to use as the scope for a set of endnotes. You must also determine where a collection of endnotes should appear in your document.
The examples shown in the section are based on the axdocbook doctype, for example the Arbortext Styler sample document transport.xml, located at Arbortext-path/samples/styler.
The following procedures explain how to work with the chapter element as the scope for the endnote collection and place the collection at the end of a chapter. Here the footnote element is designated as the element that will be configured and formatted as an Endnote.
Setting the Style of the Endnote Element
1. In Arbortext Editor, open your document and use the Styler menu to open a new stylesheet.
2. In Arbortext Styler, select the footnote element in the Elements list.
3. Assign the Inline style to that element via the Edit > Style menu option.
Setting the Endnote Scope and Numbering
1. With the footnote element still selected in the Elements list, select Insert > Context to create a new context for the element. The New Context dialog box opens.
2. Click the New ancestor button and pick the chapter element from the list of elements. Click OK to save the context and exit the New Context dialog box. The context footnote anywhere in chapter is created in the Elements list.
3. With the context footnote anywhere in chapter selected in the Elements list, go to the Text category. Set the Hidden option to Yes. Here you have specified that the content of the footnote element will not be output at the position at which the element appears in the document. Later procedures will specify where the text should actually be used.
4. Go to the Generated text category. Select the Number option then click the Details button. The Number Details dialog box opens.
5. In the Number Details dialog box, click the Restart button.
6. In the Numbering Restart dialog box, select the chapter everywhere context as the scope for endnote numbering. Click OK to save the setting and exit the dialog box. Here you have specified that the numbering for an endnote collection will always start at 1 for each chapter.
7. If you want punctuation to appear after the number in the endnote, but not in the endnote reference mark that appears in the body of the document, enter it in the Suffix (does not appear in references) field in the dialog box. For example, if you want an endnote to read 1. Text for footnote but the reference mark to simply show 1 (i.e. with no period), enter the period character in the Suffix (does not appear in references) field.
Do not add any punctuation to the Number format, as these settings are for the reference mark that is located inline at the reference location. Punctuation is generally not used for a reference mark.
8. In the Number Details dialog box, you have the option to change the Number style if you wish. Make any changes you require to this field then click OK to save the settings and exit the dialog box.
Styling the Endnote Reference Mark
1. With the footnote anywhere in chapter context still selected in the Elements list, click the Edit button in the Generated text category to add generated text before element content.
2. In the Generated Text Editor, highlight the ElementLabelAndNumber element and select Insert > User Formatting Element > (new).
3. In the New User Formatting Element dialog box, enter reference-mark. Click OK to save the change and exit the dialog box. The ElementLabelAndNumber element is wrapped by the _ufe:reference-mark element.
4. Select File > Apply and Close to save the change and exit the Generated Text Editor.
5. In the Elements list, select _ufe:reference-mark and assign the Inline style via the Edit > Style menu option.
If you cannot see User Formatting Elements in the Elements list, make sure that the View > User Formatting Elements option is activated.
6. In the Text category, select Superscript in the Super/Subscript field. Here you have ensured that the reference mark for each note in the chapter is output in superscript style.
Creating a Test for the Endnote Element in the Scoping Element
1. In the Elements list, select the chapter element. Ensure it is correctly styled as a Division if this has not already been done.
2. Select Insert > Condition to create a new condition for the element.
3. In the New Condition dialog box, select the New Content Test button.
4. In the New Content Test dialog box, select the Current Element, Includes, and At any level options. Select footnote in the Content to test for list. Click OK to save the test and exit the dialog box.
5. Click OK to save the condition and exit the dialog box.
This creates a new condition If element includes “footnote” at any level for each context of the chapter element.
Setting the Location and Style of the Endnote Collection
1. With the condition you just created still selected in the Elements list, go to the Generated text category. Click the Edit button to add generated text after element content.
* 
If the chapter element had multiple contexts, the previous procedure will have created multiple conditions – one for each context. In this case, you can use copy and paste to apply the formatting properties set in this procedure to all of those conditions, as follows:
Select the first condition you added.
Follow steps 1-9 of this procedure for that condition.
With that condition still selected in the Elements list, select the Edit > Properties > Copy menu option.
Select each of the other conditions in turn and for each one select the Edit > Properties > Paste menu option to apply the copied formatting properties.
2. In the Generated Text Editor, select Insert > User Formatting Element > (new).
3. In the New User Formatting Element dialog box, enter endnotes-title. Click OK to close the dialog box.
4. In the Generated Text Editor, enter the title text for your endnote collection in the _ufe:endnotes-title element. Use the Format > Font menu option to style the title text as required.
5. Move the cursor after the _ufe:endnotes-title element and select Insert > User Formatting Element > (new).
6. In the New User Formatting Element dialog box, enter endnotes. Click OK to close the dialog box.
7. Move the cursor inside the _ufe:endnotes element and select Insert > Element Content.
8. In the Insert Element Content dialog box, select to insert the Element and content of the footnote element for an Occurrence of All within chapter. Click OK to save the changes and exit the dialog box.
This is an image of the Generated Text Editor for the chapter element, showing the UFE _ufe:endnotes-title element with the text “Notes” as its content, followed by the UFE _ufe:endnotes that contains the element ElementContent
Note that in the sample generated text markup shown above, a new line has been included before and after the text in the content of the _ufe:endnotes-title element, via the Format > New Line menu option. This improves the appearance of the Endnote collection at the end of the chapter.
9. In the Generated Text Editor, select File > Apply and Close to save the generated text setting and exit the editor.
10. Select the _ufe:endnotes-title element in the Elements list and assign the Block style via the Edit > Style menu option. Make any desired changes to the formatting properties of the User Formatting Element, for example you can reference some of the title-related property sets available from the Property sets category.
11. Select the _ufe:endnotes element in the Elements list and style it as desired. Since it is just a container for the endnote collection, just assigning the Block style to the element via the Edit > Style menu option is usually sufficient.
Adding Endnotes to the Endnote Collection
1. Select the footnote element in the Elements list and select the Insert > Context menu option to create a new context for the element.
2. In the New Context dialog box, check the User formatting elements (with _ufe: prefix) option in the Include in ancestor and parent lists field. Click the New Ancestor button then select _ufe:endnotes from the list of elements. Click OK to save the new context and exit the dialog box. The context footnote anywhere in _ufe:endnotes is shown in the Elements list.
3. In the Breaks category for the context, select Block from the Structure type list.
4. In the Generated text category, select the Number option and click the Details button.
5. In the Number Details dialog box, select the Restart button.
6. In the Numbering Restart dialog box, select the _ufe:endnotes everywhere context as the scope for endnote numbering. Click OK to save the setting and exit the dialog box.
7. In the Number Details dialog box, add any desired punctuation to the Number format. For example, add a period after the number. If necessary, change the Number style to match the style used earlier for the footnote anywhere in chapter context. Leave Keep number at beginning of line checked. Set the other Number position controls as desired.
Here you have specified the appearance of the endnotes when they appear in the endnote area at the end of the chapter.
If your document type includes paragraph-type elements as the children of the element designated as the Endnote element, the following additional steps are required to ensure the paragraphs that contain the Endnote content appear correctly in the Endnote collection.
Styling Paragraphs in Endnotes
1. In the Elements list, select the para element.
2. Select Insert > Context to create a new context for the selected paragraph element.
3. In the New Context dialog box, set Position to first.
4. Click the New parent button. Select footnote from the list then click OK to save the new context and exit the dialog box. The context first para in footnote appears in the Elements list.
5. With the new context selected in the Elements list, go to the Breaks category. Set Structure type to Inline.
This procedure prevents unnecessary line breaks within endnotes.
Generating the Endnote Collection for a Chapter
The steps shown here give an example of how to set up an Endnote collection to appear at the end of the first chapter in a document, using all the element settings set up in the previous procedures. As with the previous procedures, we are working with the Arbortext Styler sample document transport.xml, located at Arbortext-path/samples/styler.
1. In Arbortext Editor, add a footnote element at the end of the para element child of the first formalpara element at the beginning of chapter 1. Add some arbitrary text that will form the endnote content in the para element in the footnote tag.
2. Again in Arbortext Editor, add another footnote element at the end of the para element child of the second formalpara element at the end of chapter 1. Again, add some arbitrary text in the para element in the footnote tag.
3. In Arbortext Styler, choose Preview > Print. In the print preview window, note the following:
An endnote reference mark, numbered 1, appears at the end of the first paragraph in the chapter.
An endnote reference mark, numbered 2, appears at the end of the last paragraph in the chapter.
The two endnotes are grouped at the end of the chapter, under the heading “Notes”.