Scrivener + LaTeX endnotes

For the past several weeks, and in some ways for the last year, as a Scrivener + LaTeX user, I have had a wonderful dilemma that only Scrivener can create. It is an irony not lost on me that the immense power and flexibility that Scrivener + LaTeX presents, has itself created a conundrum.

The issue is one that occurs due to the bounty of graphics, figures, tables, footnotes, etc. (as well as the dozen or so LaTeX screen Styleobjects’ I have created) that only Scrivener + LaTeX can accommodate as well as it does, but stops short of allowing a simple, straightforward way to enable common endnotes, particularly with non-fiction Scrivener + LaTeX documents that are teeming with equations, figures and footnotes, and hopefully endnotes.

Before I go any further, I need to acknowledge my very limited overall knowledge of all the features and capabilities that Scrivener has to offer, even after almost 2 years working with Scrivener + LaTeX. A good part of my research and writing time has been spent integrating many of the 6000+ packages LaTeX has to offer into my Scrivener project, as opposed to learning everything there is to learn about Scrivener. My bad.

There may be a simple, straightforward way to accommodate endnotes in Scrivener when using LaTeX, and I’d love to hear more if there are native Scrivener methods to do so that I am not aware of. I have been posting here for the last few weeks and have not read or learned of other native methods to employ endnotes in my Scrivener + LaTeX project.

As background, after almost two years working with Scrivener + LaTeX, the PDF output from my project is just under 500 pages with over 500 footnotes, almost 100 figures, and almost 20 tables, and counting. I anticipate that I will continue (as long as I can) with my research and writing using Scrivener for at least another two years, possibly much longer than that.

In the end (if there is one to my project) I anticipate a document of the size, breath and depth that ONLY Scrivener can accommodate. It is worth noting that, after researching and working on the subject of my project for decades, I was unable to undertake writing on the subject in any coherent fashion prior to having discovered Scrivener.

Learning about Scrivener + LaTeX was the ‘icing on top of the cake’.

While I have documented on this site (Is there a way to 'reference plain text' like with ‘reference Inline Footnotes’? - #6 by scrive) the 7 steps I have learned to use in order to create endnotes in my Scrivener + LaTeX project, I have have also learned of a feature currently available within Scrivener to Export inspector and/or inline footnotes as endnotes when compiling to PDF, e.g.:


This option is not, however, currently available when compiling to ‘Plain Text (.txt)’.

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.

If, however, such an option were available, it would completely eliminate the need for my 7 steps to create endnotes within my project, including the need to create a:

which can quickly clutter up a binder with possibly hundreds of ‘Latex Chunk’ type Sections, one for each endnote.

If the option to Export inline footnotes as endnotes were available when compiling to ‘Plain Text (.txt)’ for example, the additional Sections needed for each endnote to be added to the Project would simply not be needed, eliminating any need to clutter up the Binder.

By itself, the option to Export inline footnotes as endnotes could complicate the process of reading through the pre-compiled text in the Scrivener. A simple way to avoid any such complication would be to use the Scrivener <$include> feature

which would allow Scrivener users to place ALL endnotes in a single chapter or section anywhere in the Binder and to reference each endnote using a unique text string placed in the text to represent where the endnote mark needs to go within the body of the text, without cluttering up the pre-compiled text with what could be a lengthy endnote.

To demonstrate why endnotes may be preferable to footnotes (See also Is there a way to 'reference plain text' like with ‘reference Inline Footnotes’? - #6 by scrive), the following is a somewhat typical page from my project where there is competition for space between a figure, equations and footnotes. I’d prefer to use endnotes in lieu of footnotes to allow for more space to place the figure closer to where it is pertinent within the body of text and clear of the equations that now collide with the figure:

The ability to move the footnotes on the bottom of the above page instead to endnotes at the end of the section would increase the space available to re-position the figure to avoid colliding with the equations on the page. This is a typical scenario that can consume lots of time particularly given the long time it takes to compile and typeset the Scrivener + LaTeX code before the final image is available in PDF form.

There are many ways to accomplish the same objective. That is one of many strengths Scrivener has for writers. Being able to quickly and easily employ native endnotes in a Scrivener + LaTeXcproject would be a nice addition to the existing plethora of features available in Scrivener.

I will likely be using Scrivener while writing my project for years to come, so if I need to wait years for the option to utilize endnotes natively within my Scrivener + LaTeX project, so be it.

Knowing that such an option may be available in a future version of Scrivener would be a nice touch.

Thanks for reading,

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

1 Like

Hi bernardo_vasconcelos

Thank you for your suggestion.

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


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:


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:


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:


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,

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:


Any thoughts?

Thanks again for getting back so soon,

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


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.


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


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):




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,

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.


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.


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,

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

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,

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,

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:


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