# Writing Sample #20

### How to create footnotes in DITA <a href="#writingsample-19-howtocreatefootnotesindita" id="writingsample-19-howtocreatefootnotesindita"></a>

Use the `<fn>` element to create footnotes in a DITA topic.<mark style="color:blue;">`1`</mark>

* You can create footnotes in paragraphs and in tables.
* You can specify letters, numbers, or symbols by including the `@callout` attribute.
* You can repeat footnotes when necessary.

#### Create a footnote <a href="#writingsample-19-createafootnote" id="writingsample-19-createafootnote"></a>

Use the DITA `<fn>` element to create a footnote.

This is an example of a paragraph that uses the DITA footnote element. When you publish your document, DITA typically places the footnote at the bottom of the page.<mark style="color:blue;">`2`</mark>

<table data-header-hidden><thead><tr><th></th></tr></thead><tbody><tr><td><strong>Sample &#x3C;fn> code:</strong></td></tr><tr><td><pre><code>&#x3C;p>
This is an example of a paragraph that uses the DITA footnote element. 
When you publish your document, the footnote is typically placed
at the bottom of the page.&#x3C;fn>You can control the placement of footnotes 
using CSS or other output processing techniques.&#x3C;/fn>.
&#x3C;/p>
</code></pre></td></tr></tbody></table>

**Note:** Use the `@deliveryTarget` attribute to specify a document type (`html`, `pdf`, `epub`).

For example:

```
<fn deliveryTarget="html">You can control the placement of footnotes using CSS
                    or other output processing techniques.</fn>
```

#### Repeat a footnote <a href="#writingsample-19-repeatafootnote" id="writingsample-19-repeatafootnote"></a>

Add an `@id` attribute to the `<fn>` element to repeat a footnote and use the `<xref>` element for each repeating instance of the footnote. Here is an example:

I like pets. At my house, I have a dog,<mark style="color:blue;">`3`</mark> a cat,<mark style="color:blue;">`3`</mark> and a llama.<mark style="color:blue;">`3`</mark>

<table data-header-hidden><thead><tr><th></th></tr></thead><tbody><tr><td><strong>Sample code to repeat a footnote:</strong></td></tr><tr><td><pre><code>&#x3C;p>
I like pets. &#x3C;fn id="reuse-fn">This is the name of an animal.&#x3C;/fn> 

At my house, I have
a dog\<xref href="testtopic.dita#testtopic/reuse-fn" type="fn"/>,
a cat\<xref href="testtopic.dita#testtopic/reuse-fn" type="fn"/>,
and a llama\<xref href="testtopic.dita#testtopic/reuse-fn" type="fn"/>.
\</p> </code></pre></td></tr></tbody></table>

The `<xref>` element uses the `@href` attribute as a relative path to the topic that holds the original `<fn>` element, even if it is the footnote’s source topic.

#### Create a Footnote in a table <a href="#writingsample-19-createafootnoteinatable" id="writingsample-19-createafootnoteinatable"></a>

Here is an example of a table that uses the DITA `<fn>` element along with the `@callout` attribute:

| The text in this table column needs a footnote.<mark style="color:blue;">`a`</mark> | This table text also needs a footnote.<mark style="color:blue;">`b`</mark> |
| ----------------------------------------------------------------------------------- | -------------------------------------------------------------------------- |

<table data-header-hidden><thead><tr><th></th></tr></thead><tbody><tr><td><strong>Using the @callout attribute in a footnote:</strong></td></tr><tr><td><pre><code>&#x3C;p> 
   &#x3C;strow>
     &#x3C;stentry>
         The text in this table column needs 
         a footnote.&#x3C;fn callout="a">Footnote for first column.&#x3C;/fn>
     &#x3C;/stentry>
     &#x3C;stentry>
         This table text also needs 
         a footnote.&#x3C;fn callout="b">Footnote for second table column.&#x3C;/fn>
     &#x3C;/stentry>
   &#x3C;/strow>
&#x3C;/p>
</code></pre></td></tr></tbody></table>

#### Footnote Placement <a href="#writingsample-19-footnoteplacement" id="writingsample-19-footnoteplacement"></a>

When you publish your document, DITA typically places footnotes at the bottom of the page. To distinguish between paragraph and table footnotes, you can use numbered callouts for footnotes in paragraphs (1,2,3) and alphabetical callouts for footnotes in tables (a,b,c).

#### Creating manual footnotes for specific placement <a href="#writingsample-19-creatingmanualfootnotesforspecificplacement" id="writingsample-19-creatingmanualfootnotesforspecificplacement"></a>

As an alternative to using the `<fn>` element, you can use the `<sup>` element to manually create and build a superscript callout. You can then place the footnotes at any location. For example, instead of a table’s associated footnotes appearing at the bottom of the page, you can place them immediately after the table:

| **Sample table using manual footnotes:**                         |
| ---------------------------------------------------------------- |
| This is a table entry.<mark style="color:blue;">`c`</mark>       |
| This is another table entry.<mark style="color:blue;">`d`</mark> |

c. Manual footnote for the first row.\
d. Manual footnote for the second row.

***

1 Source: [Oasis 3.2.2.16 \<fn>](https://docs.oasis-open.org/dita/dita/v1.3/errata02/os/complete/part3-all-inclusive/langRef/base/fn.html#fn)

2 You can control the placement of footnotes using CSS or other output processing techniques.

3 This is the name of an animal.

a Footnote for the first column.

b Footnote for the second table column.

***


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://suntracer2030.gitbook.io/phillip-wilkerson-technical-writing-portfolio/writing-sample-20.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
