-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support Unicode superscripts for HTML note markers
Since HTML doesn't have semantic "footnote" elements, Pandoc has historically used the <sup> tag to mark the numeric reference to footnotes. In some fonts, depending on line-spacing, the common default <sup> style of "font-size: smaller; vertical-align: super;" doesn't look very good, spilling beyond the font's cap height and making browsers add extra space at the top of the text line. Many fonts include characters from the Unicode superscripts and subscripts block (https://unicode.org/charts/nameslist/n_2070.html) which are designed to function as footnote markers. Using these characters to render note marks, instead of a <sup> tag, yields better typographical results in these cases without additional CSS. The <sup> tag is purely typographical so losing it from the output doesn't cost anything semantically. This diff adds a --note-style option to pandoc, taking the values "sup-tag" (the default and hitherto only method) and "unicode-superscript" (print marks using superscript chars, no surrounding tag). Due to the nature of Note output in the HTML writer, a Lua filter cannot really customize how footnote marks are printed, justifying a writer option here. An alternative to adding this feature to Pandoc would be for authors to use CSS like 'a.footnote-ref sup { font-size: inherit; vertical-align: inherit; font-feature-settings: "sups"; }' which would work for fonts where the "sups" OpenType feature replaces digits with their superscript forms. That solution only works for fonts encoding that feature though; Times New Roman on my system has the superscript characters but do not support the "sups" OpenType feature. Future work could extend support for this writer option to plain output and possibly other formats where note marks are emitted by Pandoc rather than the renderer of the output document. (The present author has not studied whether there are such writer formats.)
- Loading branch information
Showing
6 changed files
with
77 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters