メインコンテンツまでスキップ

Footnotes

Write a footnote with ((…)) in Notation::mejiro(), or ->footnote() on a Paragraph in any notation:

$book = new Document($info, notation: Notation::mejiro());
$book->section('第1章', '本文の中に注を置く((注の本文。**強調**も使える。))。');

// or, whatever the notation:
$book->section('第2章', [Paragraph::of()->text('本文')->footnote('注の本文')]);

In Notation::novel(), 漢字((かんじ)) is ruby, not a footnote — that is what the notation means on novel sites. Use Paragraph::footnote() there.

What is written​

The reference is a small raised number linked to the note; the notes are collected at the end of the section, each with its number linking back:

<p>本文の中に注を置く<a class="noteref" epub:type="noteref" role="doc-noteref" href="#fn-1" id="fnref-1">1</a>。</p>
…
<aside class="footnote" epub:type="footnote" role="doc-footnote" id="fn-1">
<p><a class="backlink" role="doc-backlink" href="#fnref-1">1</a> 注の本文。<strong>強調</strong>も使える。</p>
</aside>

epub:type="noteref" is what tells a reading system that this is a note. A reader that supports it can open the note in a pop-up; one that does not shows the list at the end of the section, and the numbers jump back and forth. Either way nothing is lost. Which readers do which has not yet been checked on devices — see Reading systems.

A note in vertical text has its number set upright, like tate-chu-yoko.

Numbering​

use MejiroEPUB\Text\FootnoteNumbering;
use MejiroEPUB\Text\FootnoteStyle;

new Document($info, footnoteStyle: new FootnoteStyle()); // 1, 2, 3 … through the book (default)
new Document($info, footnoteStyle: new FootnoteStyle(FootnoteNumbering::PER_SECTION)); // each section starts at 1

Continuous numbering is the default because it is what MejiroPDF does, so a book made from one manuscript numbers its notes the same in both.

Details​

  • A note inside link text is referenced right after the link, since links cannot contain links.
  • A footnote in a section title is dropped: a title is one plain line.
  • The library holds a section's notes only until the end of that section, so footnotes do not change the memory picture.
  • An empty footnote is an error (ME-VAL-1001) rather than an empty note.