Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Footnotes #342

Closed
Tracked by #1541
vkbo opened this issue Jun 26, 2020 · 11 comments · Fixed by #1832
Closed
Tracked by #1541

Footnotes #342

vkbo opened this issue Jun 26, 2020 · 11 comments · Fixed by #1832
Assignees
Labels
discussion Meta: Feature discussions editor Component: Editor enhancement Request: New feature or improvement next release Note: Features planned for next release

Comments

@vkbo
Copy link
Owner

vkbo commented Jun 26, 2020

Add footnote support using the kramdown mrkdown syntax of [^label] to point to a labelled footnote, and the footnote being specified with the [^label]: syntax where the footnote text are the following indented paragraphs.

See kramdown docs

Since novelWriter doesn't necessarily use a fixed width font, indentation as group indicator isn't ideal. Some solutions may be:

  • Only allow a single paragraph for a footnote, like we do for synopsis.
  • Same as above, but allow multiple definitions with the same label, which are then appended as separate paragraphs (not very elegant).
  • The default is first point, but if no text follows on the same line, all following paragraphs are considered part of the footonote until we either see a new footnote definition label, a heading, or reach the end of the file. This works fairly well if the user always puts the footnotes at the end of the header section they're working on. It is not an unreasonable requirement.
  • A modification of the above may be to have a file layout only for footnote definitions, and each note is defined by the area between one label definition and the next. This is definitely the cleanest option, but it removes the flexibility of putting the footnote in the same file where you're referring to it. This makes writing them easier, but may make it more difficult to find where you defined them.

I'm leaning towards the fourth option. Footnotes are defined in files with the FOOTNOTE layout. Each footnote contains all text following a label definition until a new one is defined, or the end of the file is reached. Multiple footnote files are allowed.

Distinguishing between page notes, chapter notes and end notes may be desirable. This can be achieved globally as a single setting as you don't want to use both.

@vkbo vkbo self-assigned this Jun 26, 2020
@vkbo vkbo added discussion Meta: Feature discussions potential feature Request: May be considered later labels Jun 26, 2020
@johnblommers
Copy link

I've made extensive use of footnotes in Markdown. I place the footnote text near the [^LABEL] itself, typically at the end of the nearest paragraph following it, so I can find it easily. I never gather the footnotes into dedicated footnotes files.

Admittedly my footnotes are typically very short, nothing longer than a paragraph1. They may contain a LaTeX formula or a Markdown style referernce like [See here](https://see.here/index.html].

When converting Markdown to PDF the footnotes appear at the bottom of the corresponding page. When converting to ePub they appear at the end of the chapter.

In either case the export tool makes the footnote a link so a click on the footnote sends you to its text. The export tool also places a reverse link at the end of the footnote text to send you back to the reference.

Footnotes

  1. Usually a short paragraph, one or two sentences.

@vkbo
Copy link
Owner Author

vkbo commented Jun 26, 2020

That seems to be in the context of technical writing, or non-fiction at least. It makes sense to use footnotes there. It's not very common in fiction, but for instance Terry Pratchett does it quite a lot. It would be nice to have the option, and it is, as you say, supported by ePub.

Spreading them around or collecting them in dedicated files makes no difference to the way it would be implemented in the code. I would just have the indexer class collect them like it does for the synopsis. It's mostly an issue of how to indicate that a set of paragraphs belong to a single footnote without relying on indents as in kramdown.

It's not a high priority feature, and I may just leave this Issue here in case there is a request for it.

@vkbo vkbo pinned this issue Jul 26, 2020
@vkbo vkbo unpinned this issue Aug 15, 2020
@alexisargyris
Copy link

Most definitely! (BTW, I'm interested in fiction, not technical writing). I just came across novelWriter, went through its currently available features -- and was very impressed! -- and concluded that it's missing one, very important, thing: footnotes (and endnotes)!

@vkbo
Copy link
Owner Author

vkbo commented Nov 18, 2020

Thanks for your feedback :)

I absolutely see the value in adding footnotes for fiction-writing, so I'll tag this issue for the version 1.1 release since there is interest in it. I'll add it as soon as I'm done with 1.0, maybe before, but if so, it'll be in the dev branch.

@vkbo vkbo added this to the Release 1.1 RC 1 milestone Jan 15, 2021
@vkbo vkbo removed this from the Release 1.1 RC 1 milestone Jan 24, 2021
@vkbo vkbo added this to the Release 1.4 Beta 1 milestone Mar 14, 2021
@vkbo vkbo added the editor Component: Editor label May 31, 2022
@vkbo
Copy link
Owner Author

vkbo commented Oct 19, 2023

Possible notation for this proposed in #1337.

@vkbo
Copy link
Owner Author

vkbo commented Oct 20, 2023

Following from #1337, I think the following notation may work:

This is some text with a footnote[footnote:mynote] in it.

[target:mynote] This is the text of my footnote.

[target:mynote] If I wish, I can add a second paragraph to the footnote.

I'm not sure if target is the best keyword for the definition, and I would like to also allow fn as a short form for footnote.

I'm also not sure if I want to distinguish between footnotes and endnotes in the syntax, and instead make it an option in the build tool. How they are treated is somewhat dependent on output format. Footnotes don't make sense on formats without pages. There they become chapter notes or endnotes anyway.

@vkbo vkbo mentioned this issue Oct 20, 2023
8 tasks
@vkbo vkbo added enhancement Request: New feature or improvement planned Note: Feature planned for a later release and removed potential feature Request: May be considered later labels Feb 26, 2024
@xahodo
Copy link

xahodo commented Mar 1, 2024

How about doing it like Latex does?

That would mean [footnote]some text[/footnote] right in the middle of the text where the footnote is needed. NW could then figure out, in accordance to a setting, what the footnote number is.

The reason for defining it in the middle of the text is that the footnote is defined where it's relevant, not at some external location, so things are easier when editing later (i.e. you don't have to reference another document when editing, but the relevant information is right there.

@vkbo
Copy link
Owner Author

vkbo commented Mar 1, 2024

For short footnotes, that is fine. However, I would like a way to refer to a footnote as well. This is useful if you refer to the same footnote more than once, or want a footnote that is longer, or rendered as an endnote.

So you could have the option to:

  1. Write Text bla bla bla[footnote]Foot note text.[/footnote]. More text bla bla.
  2. Or, point to a target like Text bla bla bla[footnote=mynote]. More text bla bla.

I think it should be possible to implement both.

@vkbo
Copy link
Owner Author

vkbo commented Mar 1, 2024

In any case, since you can define the [target] wherever you want, you can easily just put it after the paragraph where you use it. This is cleaner than the inline notation anyway. I don't particularly like the LaTeX approach. It is very messy when writing.

@vkbo
Copy link
Owner Author

vkbo commented Mar 1, 2024

Looking at the history here, I like @johnblommers suggestion. I will just use a syntax that is more consistent with the shortcodes already implemented.

@vkbo vkbo mentioned this issue Apr 25, 2024
10 tasks
@vkbo
Copy link
Owner Author

vkbo commented Apr 28, 2024

Footnotes have finally been added in #1832. This was a huge patch, so it was only worth the effort because the framework added for footnotes can also be used for adding annotations/comments to text segments and also for the story feature (#1784). After all, footnotes are not very common in fiction.

Since the syntax for footnotes is a bit cumbersome to manually type, there is an "Insert Footnote" menu entry that inserts the marker, generates a unique footnote key, and creates the special comment where the footnote text goes, and move the cursor to this location so the user can start typing the footnote right away.

@vkbo vkbo added next release Note: Features planned for next release and removed planned Note: Feature planned for a later release labels Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Meta: Feature discussions editor Component: Editor enhancement Request: New feature or improvement next release Note: Features planned for next release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants