Scrivener + LaTeX endnotes

Maybe I am not understanding exactly what you want, but there is a very straightforward way of having footnotes and endnotes or margin notes. In the Compile settings, go to Footnotes and Comments and check Use format for comments: and add a command like this <$lnk>\marginnote{<$cmt>} (or whatever the command for endnote is). Now all you have to do is use comments for endnotes. (And you can do the same with annotations).

Hope this helps :slight_smile:

1 Like

Though not an answer to your wish, I do have a solution to the last hitch in your footnote-divvying work around. See my happy solution at https://forum.literatureandlatte.com/t/is-there-a-way-to-reference-plain-text-like-with-reference-inline-footnotes/124164/10?u=gr

1 Like

Hi bernardo_vasconcelos

Thank you for your suggestion.

As for what I want, I’m looking to have the two options:

image

available when Compiling for: ‘Plain Text (.txt)’:

Both options are available when Compiling for: PDF:

but NOT available when Compiling for: ‘Plain Text (.txt)’.

As you know, when compiling Scrivener files to LaTeX ‘.tex’ files, footnotes appear in the ‘.tex’ file with the following syntax:

   \footnote{<footnote_text>}

For endnotes (assuming I include the command ‘\usepackage{endnotes}’ in my LaTeX Preamble Module Setup Package folder), the only requirement to use endnotes in the LaTeX ‘.tex’ file is for endnotes to use the following syntax:

   \endnote{<endnote_text>}

Otherwise, the treatment needed to use endnotes in the compiled LaTeX ‘.tex’ files is the same as that for footnotes.

The LaTeX command ‘\usepackage{endnotes}’ does what needs to be done to properly place the endnotes at the end of a chapter or section, and the command formats the endnotes similar to footnotes (except for the spelling) at the end of the chapter or section, as needed. It really is that simple!

Note: Scrivener does NOT, repeat NOT, need to relocate each endnote to the end of the appropriate chapter or section. The LaTeX Typesetter will do that automatically, assuming the LaTeX command ‘\usepackage{endnotes}’ has been included in the Preamble Module Setup Package folder.

So if I place my endnotes in the body of my Scrivener text as inline footnotes and select the image option, Scrivener would need to be smart enough to compile the Scrivener file to the ‘.tex’ file with all the endnotes using the syntax:

   \endnote{<endnote_text>}

As for your suggestions, there are two issues:

  1. Unfortunately I already use both Comments and LaTeX Margin notes in my lengthy project, and so they are not available to be used as endnotes.

  2. Apologies for my ignorance, but on the main Compile screen I do not see an option to Use format for comments::

And, also on the Comments and Footnotes screen, I do not see an option to Use format for comments::

Can you be a bit more specific on where the Use format for comments: option can be found?

Thank you again for your suggestion,
scrive
:thinking:

Try here:

1 Like

Hi bernardo_vasconcelos,

Thanks for getting back.

Here is what my Footnotes & Comments screen currently looks like:

As you can see, the ‘Use format for comments:’ option is already checked, and the field beneath already contains the following syntax:

     \hl{<$lnk>}\marginpar{<$cmt>}

Any thoughts?

Thanks again for getting back so soon,
scrive
:thinking:

I’m not sure why we need to have two separate threads on this discussion, as now we’ve got other comments off in another area, and some practical stuff is now over here instead—should I just merge all of this so that future readers do not need to dig into your posting history in order to find the full discussion on the matter?

I would be inclined to merge this back over into the LaTeX discussion area, since what you’re asking for is entirely impossible (in a laws of the universe sort of way, not even for Scrivener specifically) as a wish list request anyway.

@Scrive: After years of development through three complete versions of Scrivener, I am sure there is a good reason why the option to Export inspector and/or inline footnotes as endnotes when compiling to ‘Plain Text (.txt)’ is not available.

I can only reiterate what has already been said:

@AmberV: Given that, how could such a checkbox ever exist in a way that does anything meaningful? If we want multiple notation streams in XML, we need to configure that into our document design. Likewise for LaTeX. These are questions of configuration, or the relationship between the Format and the content.

I’m actually really struggling to understand what you are expecting here of such a checkbox, in a practical sense. What is a footnote in a .txt file? That’s what I’d start with. Endnotes of some placement strategy, I understand, but footnotes? To what foot are we attaching the note, in a .txt file?

I hope this doesn’t come across as dismissive. I just feel a bit dense here, like I’m missing something obvious.

1 Like

Perhaps you could use annotations for marginpar and comments for endnotes (or vice-versa)?

In which case you would have:

  • footnotes → tex footnotes
  • annotations → marginpar
  • comments → tex endnotes
1 Like

Ioa,

Scrive has perhaps gotten a bit fixated in the wrong place. All they really want is some point of entry that would enable them to process inline and inspector footnotes differently when compiling for LaTeX.

What they should really be dreaming of is an addition to this dialog box where one could specify independently the enclosing markers for inline and inspector footnotes. Unlike the other, this is a dreamable dream.

image

P.S., And if we are counting, our friend has started more than two threads on this same subject!!

2 Likes

That would make a lot more sense, and I think in retrospect it could be seen as a bit of an oversight. Since .txt does not have the ability to do anything reasonable with a second note stream, it’s never had any more than a single set of settings for all “footnotes” and one checkbox toggle for using them, or not. When TXT became capable of doing a whole lot more than just printing out a plain-text copy of the draft—capable of implementing whole new file types—that old limitation never got upgraded.

That said, as Bernardo points out above, we do already have three whole separate note streams to work with, and that’s not even getting into other perfectly adequate methods like styles. So I think overall, considering how niche it is to require even two notation streams, never mind how niche this entire workflow of using TXT to create custom file types is, it’s probably going to be if anything a pretty low priority thing to look into. I would definitely exercise Scrivener’s existing flexibility rather than looking for a change to the format design interface any time soon.

That’s one of the great things about this program. You can often invent your own features and you do not have to wait around for us to grant them to you. That is, I would say, very much more true for plain-text operators than otherwise. We can design our own syntax and implement formatting designs from it that no software does, until we put the workflow together.

1 Like

Hi AmberV, and others …

Thank you for your comments and feedback.

I’d like to be clear about what is being suggested.

Scrivener clearly offers a degree of power and flexibility that is far beyond what is available in competing writing applications. Such flexibility is what defines the Scrivener ecosystem.

The suggestion is an extension of that flexibility to accommodate a particular issue that this non-fiction writer has faced. For non-fiction writers where figures, tables, equations, etc. as well as user-defined text objects (that only Scrivener is capable of allowing) all create a sense of virtual ‘real estate’ (and all the associated ‘economic rent’ that engenders) on the printed page.

This creates a value defined by the proximity of the text object to the words within the printed text. Such value may not be perceived to the same degree by fiction writers and others where text objects such as figures, tables, equations, and user-defined text objects, are not as common. My suggestion allows for an additional degree of freedom, particularly for non-fiction writers, when addressing the tension between text objects and the text, as they place text objects within the text.

Please note that my earlier attempts to define a solution to the endnote issue should have focused less on the methodology, and more on the objective, which is as follows:

Allow Scrivener + LaTeX users access to the native LaTeX \endnote command to create endnotes, similar to how Scrivener allows LaTeX users to define footnotes.

As I mentioned in an earlier posting, endnotes in compiled LaTeX ‘.tex’ files appear almost identical to footnotes (except for the spelling):

 \endnote{<endnote_text>}

versus

 \footnote{<footnote_text>}

From the feedback expressed here, I can see my earlier attempts to define a pathway to allow users to define endnotes were not effective. My apologies for the errant bandwidth I may have consumed in doing so.

Thank you again for your comments and feedback,
scrive
:thinking:

If you’re discussing in good faith, you never have to apologize for having the conversation evolve and move to a significantly different place that where it started. That’s part of what these forums are so very good at – helping people refine and hone their understanding of the software, the mindset for using it, and the features that can be brought to bear.

Every successful wishlist interaction I can remember seeing has involved this kind of discussion.

3 Likes

A big +1

It would also be fairly easy to use some sort of tag and then a post-processing script to convert footnotes to endnotes — this is after all the great strength of text formats…

1 Like

I love the flexibility of the txt compile options in Scrivener. It allows three separate note streams and inline footnotes ([^Like this footnote here]), which is great. What keeps me from using it is the fact that it does not export tables properly (with some sort of markup) rendering them useless.

An option to export tables in markdown format or the flexibility of the TXT options in the Markdown compile settings would be nice.

1 Like

Yes indeed. I put up some LaTeX code for just that in one of the other threads on this same topic.

https://forum.literatureandlatte.com/t/is-there-a-way-to-reference-plain-text-like-with-reference-inline-footnotes/124164/10?u=gr

2 Likes

Hi gr,

Thank you again for the \fnote code that you developed to accommodate endnotes using footnotes tagged with ZZZ. As I mentioned in my post (Is there a way to 'reference plain text' like with ‘reference Inline Footnotes’? - #26 by scrive), let me know if you have any idea why the \url{…} was creating a conflict when I included your \fnote code.

Thanks again,
scrive
:thinking:

I offered some diagnosis in the other threead where you posted about this:

https://forum.literatureandlatte.com/t/is-there-a-way-to-reference-plain-text-like-with-reference-inline-footnotes/124164/27?u=gr

Just for clarity of terminology, let us not call it fnote code, because in that code fnote is just a re-naming of the footnote cmd!

In an effort to find out what the the data may be on footnotes versus endnotes in research and scientific papers, I came across a site that for me shed some light on where academia is on the issue.

The website, from the University of Southern California (USC) titled Research Guides - 11. Citing Sources, addressed quite a few issues with respect to writing for research, and addressed the issue of footnotes versus endnotes with a number of items, including a helpful list of advantages and disadvantages of each.

One statement toward the bottom of the page regarding the use of endnotes versus footnotes caught my eye:

“3. In general, the use of footnotes in most academic writing is now considered a bit outdated and has been replaced by endnotes [emphasis added], which are much easier to place in your paper, even with the advent of word processing programs. However, some disciplines, such as law and history, still predominantly utilize footnotes. Consult with your professor about which form to use and always remember that, whichever style of citation you choose, apply it consistently throughout your paper.”

On a personal note, one item spoke to me about my own tendency to perhaps overdo it when it comes to citations:

NOTE: Always think critically about the information you place in a footnote or endnote. Ask yourself, is this supplementary or tangential information that would otherwise disrupt the narrative flow of the text or is this essential information that I should integrate into the main text? If you are not sure, it’s better to work it into the text. Too many notes implies a disorganized paper.”

I’ve been put on notice!

Thanks for reading,
scrive
:thinking:

1 Like

FWIW, I hate endnotes with a passion… both in printed books but especially in digital ones. It is extremely distracting when reading a text, always having to find the relevant bit in the end of the book.
Some publishers insist on using them, because they think that it helps page esthetics, which, somehow, is supposed to spike book sales. But when I do research, I don’t care about page esthetics. Most academics I know (quite a lot of them) share my dislike.
In the pitiful cases when I do have to use endnotes, I do a general find+replace in my latex document and call it a day (\footnote{\endnote{).

1 Like

I share a bit of your dismay for endnotes, and for footnotes in general. I appreciate your comment as a caution to anyone that attempts to use endnotes for the criticism that they may engender when doing so.

I work with LaTeX within Scrivener, and as such, I have a few options that I try to use, such as active links that reveal the text of the footnote in place when highlighted, although even the active links can be somewhat limited.

The issue for me is that I rely on graphics extensively (which Scrivener + LaTeX handles quite nicely) and as such, the flow of text is constantly being interrupted, almost at every page within my almost 400 pages of text. I trend to rely more heavily on graphics than the vast majority of writers as words are definitely NOT my forte (hence I don’t think of myself as a ‘writer’ per se).

I’ve toyed with placing a few graphics within the glossary, and/or as part of an acronym, each with the appropriate active links, as a way to temper the disruption, but my limited LaTeX skills palliate that avenue as a way to help pace the text. So, I thought of working with endnotes as a compromise to try and alleviate the disruption that the graphics already impose on the flow of text, with the placement of endnotes as a near-at-hand proxy for footnotes.

There have been many wonderful ideas and options offered here by gr, bernardo_vasconcelos, AmberV, devinganger, nontroppo, et al, all culminating in the code by Eric Domenjoud on StackExchange (whom I still need to thank) for his most recent LaTeX code suggestion. When using Scrivener with LaTeX, Eric’s code creates the ability to turn any footnote (when using Scrivener + LaTeX) into an endnote simply by prefacing the text of any footnote with an at ‘@’ sign. Very clever, and works nicely within Scrivener. This is a major step forward for me in my quest to find the optimum balance between text, graphics, footnotes and endnotes.

Thank you again for your comment,
shive
:thinking:

P.S. For those Scrivener + LaTeX users thinking of employing endnotes using code developed by Eric Domenjoud on StackExchange , I found a simple enhancement also on StackExchange “To add a horizontal rule below the “Notes” heading” (under the title “Is there a way to move all footnotes to the end of the document?”) which adds a nice touch to the “Notes” heading:

\makeatletter
\def\enoteheading{\section*{\notesname
  \@mkboth{\MakeUppercase{\notesname}}{\MakeUppercase{\notesname}}}%
  \mbox{}\par\vskip-2.3\baselineskip\noindent\rule{.5\textwidth}{0.4pt}\par\vskip\baselineskip}
\makeatother

with a horizontal rule of “.5\textwidth” length underneath, the “Notes” heading looks a bit neater:

Enjoy!

Yeah, I also work with Latex, so this is very helpful, thanks. (Although I usually don’t try to do the whole thing from Scrivener).

Links definitely help in case of endnotes, although I still don’t like when I have to actively interact with the page I’m reading (by clicking a link instead of just glancing down at the bottom of the page). But this is really just personal preference, and page aesthetics may be more important for some. (There is no, absolutely no excuse however for digital books with endnotes without links. That’s the one that really drives me crazy when I read, so I just stop looking at the notes altogether.)

This is tangential, but it also seems to me that the academic style is changing. There are a few very good academic journals in my field that strongly discourage footnotes, and consider it bad academic style. And while some friends of mine have managed to convince OUP to use footnotes instead of endnotes in their book, some didn’t.