Is there a way to 'reference plain text' like with ‘reference Inline Footnotes’?

@JimRac gets the beer. :slight_smile:

And to @Scrive, you’re most welcome!

I think the important thing to be aware of here is that the choice between endnotes and footnotes (or having both) is fundamentally a LaTeX layout decision and not a Scrivener thing, since Scrivener itself is ignorant of LaTeX. We must teach it everything, and we do so through the configuration of our content and the compile settings.

The project template provides a healthy start on that process of training the software, and by intention it does so in a way that is as vanilla as possible so one can more easily make those decisions and implement them.

So that is why there is no endnote checkbox in the compile overview area, because from that context Scrivener is ignorant of what an endnote is in LaTeX. For it to successfully implement them it would need to know how to do so, and doing so is not always straightforward. Using the endnotes package is a fairly simple tweak, but using both is not, and often require a bespoke setup to accomplish it.

From my own experience, I wonder if there is, and how large, an untapped market there may be for Scrivener + LaTeX in the scientific, research and engineering fields of study.

There very likely is, but the challenge we face is two-fold:

  1. On the surface Scrivener looks like how word processors look, which typically are fairly awful for authoring technical formats like this. You have to dig pretty deep to get past that first impressions in the tutorial and default UI, and into novel areas that few tools address, like using styles for syntax injection, which is very unorthodox and unexpected.

    When you consider how hard-won some people’s workflows are, how much sunk cost fallacy you have to fight against in some cases, it can be difficult to present an alternative that is so different.

  2. We have a reputation for being a tool for novel writers, despite insisting everywhere otherwise, even in the breadth of its offerings for non-fiction work on the surface. I would guess that a lot of that has to do with a preconception of what “software for writers” tends to be. If you look around at many of what people consider to be “competition” for Scrivener, you’ll mostly find tools that really do not work for anything other than novel writing. There are very few writing tools that strive toward general writing. So that it gets lumped together with what the genre seems to on the whole address, makes sense.

These problems aside, the fact is that Scrivener is a very unique tool for authoring technical formats, such as LaTeX. It is largely unknown for that, but you will not find much of anything out there that provides that kind of “front end”. As I’ve mentioned elsewhere, LyX is probably the closest thing to it, but we wouldn’t think of it so much as being a “tool for writers” in the modern sense. It’s closer to a word processor in how it presents the writing workflow. Beyond that, tools for LaTeX are invariably closer to coding editors, where all of the syntax is right in your face and only made less obstructive through conventions such as syntax highlighting—to help make the content easier to find among the symbols.

It would be more accurate to say that TeX is the Turing-complete programming language for typesetting, while LaTeX is a massive corpus of automation (what we refer to as macros) built from that language, that enable those who are not specialist programmers to make use of the system in a relatively comfortable environment for doing so. So in that sense it is closer to how we might think of Cocoa or Qt, which Scrivener is created with on Mac and PC respectively. It’s not a perfect analogy by any stretch, but if know you the relationship between those and Objective-C or C++, it’s a better way of thinking about the relationship.

3 Likes

The citation.

I try doing my best not to forget or miss a proper citation. Just because a quotation exists within an epigraph, I assume it still requires a citation (my knowledge and memory of The Elements of Style is somewhat limited).

N’est pas?

Thanks for your note,
scrive
:thinking:

A citation in what form? A footnote or endnote?

Just a run-of-the mill footnote, or it could be an endnote, depending on spacial requirements.

As a literary refugee of sorts, I’m starting to wonder if my personal understanding about having to cite everything, including citations in epigraphs, may not be according to Hoyle.

Are epigraph citations an oxymoron of sorts?

It would not be the first time that I’ve gone a little overboard.

Thanks for your note,
scrive
:thinking:

Here’s a typical chapter head in my WIP. I include <$title> in the epigram document template.

1 Like

It would be highly unusual to have a citation foot/endnote on this kind salutatory quotation.

The point of full citation in body text is so that a reader could, in principle, go check on the veracity of what you were saying about the quoted text (is it being interpreted out of context, for example), or what you are saying with the quoted text (depending on how you are using the quoted passage).

But in this sort of opening quote you are not saying anything that anyone could need to doublecheck.

I would say these kinds of lead-in quotes are generally attributed rather than cited. That is generally just credit where credit is due, but it also may be meaningful for you purpose where the quote comes from or who said it.

It seems to me one has a wide latitude in these sorts of attribution. Often, just the author of the quote is given. But I think, for example, you will never see the publishing house given. I also think you will not find any such quote using a foot/endnote to make the attribution.

2 Likes

Hi drmajorbob and gr,

Thanks for the chapter header and the low-down on citing or attributing epigraphs. I like to pull quotes from the NYT and I’m a bit paranoid about not getting everything just so. Thanks for the feedback … here is a sample of how I cited a quote from the NYT in an epigraph:

I haven’t decided if I’ll use a footnote or an in-text citation on all the epigraphs where I have a direct quote. So for now I’ve included both until I decide which one I’ll use in the end … a lot easier to delete than to recreate the footnote or citation later on, long after I created the initial citation …

Thanks for your comments,
scrive
:thinking:

P.S. FYI, I use the website MyBib to create citations directly from the URL.

Yup, I can certainly see why you would want/need to fully cite that quote.

UPDATE: See P.S. below regarding the \url{…} command.

Hi gr,

Thank you SO MUCH for the above LaTeX \fnote code to accommodate endnotes.

I was SO HOPING that your code would work. Unfortunately, when I tested the code, I am seeing the following error: (I searched for the error but did not find a solution)

! Undefined control sequence.
\hyper@normalise …M{ }\catcode `%\active \let %
\@percentchar \let \%@per
l.4679 …hp?title=Economic_rent&oldid=931394262}}

The line of code where the error occurred is:

economic rent.\footnote{Wikipedia contributors. (2019, December 18). Economic rent. In Wikipedia, The Free Encyclopedia. Retrieved 00:58, March 9, 2020, from \url{https://en.wikipedia.org/w/index.php?title=Economic_rent&oldid=931394262}} 

I thought the error might have occurred due to the presence of the syntax ‘&oldid=931394262’ at the end of the above \footnote, so I removed it and re-typeset the code, but to no avail.

When I commented out just the \fnote code, the compiled .tex file typeset without error, so I doubt the error was due to anything other than the \fnote code.

Any thoughts or suggestions you might have about what I might try to determine what is causing the error would be more than welcome.

Thanks again for your \fnote code to accommodate endnotes,
scrive
:thinking:

P.S. I did a bit more testing, and it seems that if I remove the \url{…} from the \footnote, that the ‘.tex’ file typesets just fine. So it appears that for some reason the \url{…} command within the \footnote is not compatible with the \fnote command. I have NO idea what is going on … Thanks again!

I can only imagine two ways that you might run into trouble using that code:

  1. If the string you are using to flag endnotes (‘ZZZ’ in my code) has anything that the tex processor might treat as a special character/code, that might cause you grief.

  2. If not that, it looks to me like the only place for a hitch would be in the url{} function and the IfBeginWith{} function not playing nice together.

(I think it unlikely to be the fnote cmd call, because this literally invokes the original footnote function and nothing more. The let cmd is very low level TeX. So, nothing should be hinky with that part.)

You could verify that by trying something like:
\let\fnote\footnote
\renewcommand{\footnote}[1]{\fnote{#1}}
Which should just return footnotes unmolested.

Hi gr,

The stripped-down fnote works without a hitch. So, as you mentioned in 2. above, the error may be due to a collision between the \url{…} function and the IfBeginWith{} function …

Any other thoughts where we might go from here? Is there another function or command I can use in lieu of IfBeginWith{} ? (I’m not aware of a possible replacement for the \url{…} function.)

Thanks for all your help,
scrive
:thinking:

You should take this problem to a dedicated LaTeX forum. See what some experts can tell you.

gr

P.S. I am able reproduce the problem using the hyperref package for the url{} command. But it is a bit hard to tell which package is choking here, hyperref or xstring.

Hi gr,

Thanks for getting back.

If you have the equivalent of a Minimum Working Example (MWE) available, I’d be glad to post it on StackExchange.

Otherwise, when I have a bit of time, I’ll try to put together a MWE to post on StackExchange.

I’m sure, with a MWE, someone on SE will have an answer.

Thanks again,
scrive
:thinking:

\documentclass{article}
\usepackage{endnotes} %
\usepackage{ifthen}
\usepackage{xstring}
\usepackage{hyperref}

\let\fnote\footnote
\renewcommand{\footnote}[1]{
	\IfBeginWith{#1}{@}
		{\endnote{\StrDel[1]{#1}{@}}} %%
		{\fnote{#1}}
}

\begin{document}
Lorem ipsum dolor sit amet.\footnote{\url{https://google.com}}

% Nesting of \footnote{ ... \url{...} ... } throws an error.

\theendnotes %
\end{document}

This is only almost minimal. You can comment out the two %-marked lines and replace the call to endnote with another call to fnote in the %%-marked line. But the resulting function will likely cause consternation among the LaTeXnicians about what the hell you are doing.

1 Like

You might be hanging fire with your use of hyperref anyway. I note the documentation (in my installation) for hyperef indicates the endnotes package is “unsupported” by it. (That isn’t the trouble with the code above though.)

Also, just noticed the ifthen package is not really used in the above MWE.

1 Like

Hi gr,

I just posted the error with \fnote on StackExchange … see:

“Undefined control sequence” when using footnote-to-endnote MWE

Thanks for the update!
scrive
:thinking:

One answer has been posted on StackExchange … I’ll give their solution a try once I’ve had a chance to rest … the answer was posted 4 hours after I posted it on StackExchange … what a resource!

scrive
:thinking:

The answer you got (Domenjoud’s) is written by someone who knows the TeX under LaTeX.(^fn1) He knew how to run the test for an initial character without using the string package. His diagnosis of why the original code was unhappy with url{} makes good sense also.

I pulled his code and it works for me as promised.

Note that because the original code posted used a single @ as the endnote trigger, the solution you got was written in a way that is specific to using a single-character trigger. I had not anticipated that someone might give a less than general answer. But maybe it is just as well. A single character trigger is most convenient and @ is a great choice!

I know it goes without saying, but don’t forget to thank Eric and mark his solution as accepted (once you confirm it for yourself)!

And with that, I think you now have a functional footnote+endnote workflow.

All Best,
gr

fn1: Aside from specific-purpose delving, my knowledge is pretty much limited to the LaTeX level of life. So, the elegant simpicity of hiving off the first char simply by concatenating the argument parameters (#1#2) would never have occurred to me!

For completeness, here is Eric’s solution:

\usepackage{endnotes}
\usepackage{hyperref}
 
\let\fnote\footnote
\edef\otherat{\string @}

\long\def\xfnt#1#2\xfnt{%
	\def\temp{#1}%
	\ifx\temp\otherat
		\endnote{#2}%
	\else
		\fnote{#1#2}
	\fi
}
\renewcommand\footnote[1]{\xfnt#1\xfnt}
1 Like

Hi gr,

I ran into an issue with the above code when I include the following URL in as a footnote. As an endnote with a preceding @ sign, the URL seems to work fine, but it throws an error w/o the endnote @ sign:

https://www.ilo.org/wcmsp5/groups/public/---ed_dialogue/---sector/documents/meetingdocument/wcms_741659.pdf

I’ve posted the issue on StackExchange beneath the original posting and answer that was provided. I’ll have to wait to see if there is a response.

Thanks for all your help!
scrive
:thinking:

This can be fixed by getting the full footnote content lashed back together before passing it to fnote. The following seems to do the trick (though Eric might have a more elegant soln).

UPDATE: Eric’s solution on SE was indeed more elegant (if somewhat more mysterious) as it required only a small modification of the last line, so I give it here instead of my own.

\usepackage{endnotes}
\usepackage{hyperref}
 
\let\fnote\footnote
\edef\otherat{\string @}

\long\def\xfnt#1#2\xfnt{%
	\def\temp{#1}%
	\ifx\temp\otherat
		\endnote{#2}%
	\else
		\fnote{#1#2}
	\fi
}
\renewcommand\footnote[1]{\xfnt#1\empty\xfnt}
1 Like