Skip to content

Docx writer: Optionally insert space or tab before footnote text #2527

Closed
conklech opened this Issue · 1 comment

1 participant

@conklech

Currently, the docx writer produces footnotes that contain the footnote reference (i.e. superscript number) followed immediately by the text of the note. It appears like this:

image

By default, inserting a footnote in Word inserts the footnote reference and then a space, so most or many Word documents normally have a single space between reference and the text. The Pandoc reader I use (org-mode) discards whitespace at the beginning of the note, so it's not possible to simply type an extra space in the source document. A literal nonbreaking space in the input produces the desired effect, at the cost of having to remember to manually insert it in every footnote.

image

Better yet would be to have a tab character following the reference, so that the paragraph style may be used to align footnotes properly. I don't think there's a workaround for that—a literal tab character is ignored as simply whitespace.

image

image

The correct default behavior might be to insert a literal space between footnote reference and the body of the footnote. But this would change existing behavior, and would be even harder to work around.

So I propose a flag or other option to control whether nothing, a space, or a tab is inserted after the footnote reference.

Inserting spaces could be implemented as a filter, by prepending a space to each footnote. Would that work for tabs, too?

@jgm jgm referenced this issue
Closed

Footnotes in docx #2534

@jgm jgm added a commit that closed this issue
@jgm Docx writer: insert space between footnote ref and footnote.
This matches Word's default behavior.  Closes #2527.
593cbd8
@jgm jgm closed this in 593cbd8
@conklech

I confirm that Pandoc-produced footnotes now have a space between reference and text. Thanks! It looks like we were already setting the xml:space="preserve" attribute.

I plan to try implementing the alternative tab behavior as an option. I'll submit a pull request if I get there.

@conklech conklech added a commit to conklech/pandoc that referenced this issue
@conklech conklech Add --docx-note-tab flag to replace initial space with tab in footnotes.
This only applies to the docx writer, and implements the alternative behavior
from #2527.

I also tweaked the default footnote style to add a tab stop at .25".
In my testing, that (barely) accomodates four-digit footnotes, without looking
too absurd with one- and two-digit numbers.
6645302
@conklech conklech added a commit to conklech/pandoc that referenced this issue
@conklech conklech Add --docx-note-tab flag to replace the initial space in footnotes wi…
…th a tab.

This only applies to the docx writer, and implements the alternative behavior
from #2527.
38205d4
@conklech conklech added a commit to conklech/pandoc that referenced this issue
@conklech conklech Add --docx-note-tab flag to replace initial space in footnotes with a…
… tab.

This only applies to the docx writer, and implements the alternative behavior
from #2527.
f213ab7
@conklech conklech added a commit to conklech/pandoc that referenced this issue
@conklech conklech Add --docx-note-tab flag: replace initial space in footnotes with tab.
This only applies to the docx writer, and implements the alternative behavior
from #2527.
209fbcb
@conklech conklech added a commit to conklech/pandoc that referenced this issue
@conklech conklech Add --docx-note-tab flag: replace initial space in footnotes with tab.
This only applies to the docx writer, and implements the alternative behavior
from #2527.
513bd9b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.