text anchors for footnotes getting messed up!

hi,
i’ve been using scrivener to write a non-fiction book for the last 2 years. in the past week, two heavily footnoted documents in my draft have suffered the same problem: the footnote anchors have randomly migrated to different sections of the text (it seems that they’ve migrated a line or two down, but it varies). i use asterisks to anchor my footnotes so that I can move words around without changing the footnote anchors, so i noticed immediately when the footnote anchors were suddenly present on parentheses, periods, commas, and single letters of random words.

there are many documents in my draft in which this is not a problem. but there may be more in which it is–there are hundreds of documents within the draft and i have not yet checked them all to find out.

as you can imagine i am pulling my hair out trying to fix this problem, and have no idea why it happened or how to prevent it from happening again! i adore scrivener but this could be a deal breaker! :cry:

please advise.

i should have added that i’m using Scrivener 2.3.1.

many thanks in advance for your help.

sonia

Hi Sonia,

I’m very sorry to hear that you have run into this problem. Over the past couple of years, we’ve had a handful of reports of this happening, but I’ve never been able to get to the bottom of it. Let me explain how anchored footnotes are saved so that you can have some understanding of how the problem might arise, and also of how the code I have implemented for the next version should at least avoid this issue in the future:

A text file is saved inside a .scriv project in the RTF format. A .scriv file is really just a bundle - a folder - of other files that looks like a regular file in the Finder. Each text document in a project is saved as a separate RTF file inside the project. Inspector comments and footnotes, however, are not saved in the RTF file, but in a separate .links text file. Each footnote has two main pieces of information associated with it: the footnote text, and the range of the text with which it is associated.

For instance, suppose you had the following text, with the square brackets indicating an anchor point for a footnote:

This is some text followed by a footnote.[*] More text.

The “range” of this footnote would be {41, 1}, because the asterisk associated with it is the 42nd letter in the text (it starts at index 41 and is 1 letter long).

So, the .links file saves information telling Scrivener the text of the footnote, and the fact that it should be associated with one letter at position 41 in the text.

This is generally a solid way of saving this information. However, if the underlying RTF file is somehow changed “behind Scrivener’s back”, as it were, then it the anchors could go out of sync. In the above example, suppose you peered inside the .scriv project (which you could do, by ctrl-clicking on it and using “Show Package Contents”), located the RTF file and opened it in a word processor, and then snipped out any one of the letters before the asterisk. Now, when you opened the Scrivener project again, the asterisk is no longer at position 41, but at position 40 instead. Scrivener’s .links file does’t know that, though, so it places the anchor at position 41 - one letter after the asterisk.

So, this is what is going on. I’m not suggesting that you have dug around inside the .scriv project, of course, but something has somehow changed the RTF file without Scrivener knowing about it. There are a couple of potential causes of this:

  1. If it were only a letter or two off, I would guess that a bad character in the RTF hadn’t survived saving and reopening - this can happen when text is pasted in from elsewhere and has gremlin characters. You say that everything is a line or more off, though, so this is unlikely to be the case.

  2. A more likely explanation is syncing gone wrong: do you store this project on Dropbox, or sync it between computers in some other way? If so, I would guess that either you have opened the project before it has been fully synced, or something has gone wrong with the sync process, so that the .links file and .rtf files were left out of sync.

To avoid this in the future, for the next update I not only save the range of text associated with the footnote, but the text itself. So, if a footnote is associated with an asterisk, Scrivener stores the fact that it is associated with an asterisk. On re-opening the text, Scrivener first checks the saved range, then checks that the text at that spot matches what it was expecting. If not, it scans around for the nearest matching text and applies the footnote there. This should fix most situations where things get out of whack.

That said, if you are syncing between computers, it will still be important that you ensure things are fully synced before trying to open a project. I’d definitely be interested to hear whether or not this could have been the cause for you.

Thanks and all the best,
Keith

Thanks so much for this explanation.

In answer to your questions, I have only used a single laptop to create all the text in this project. but, It may be that the two text documents in which this problem occurred were pasted into the Scrivener project from Scratch Pad. in laziness, i have recently been copying and pasting text from the Scratch Pad into my Scrivener project, rather than using the “Send to project” function (the reason being that the project has so many layers and sub-layers that it is quicker to just cut and paste than to navigate through to the correct spot in the project).

Do you think this could be the culprit?

(since there is no footnote capacity in Scratch Pad, i add all the footnotes for the scratchpad material after I cut and paste it into Scrivener.)

I just noticed something else. Perhaps it is related. A note on scratch pad that i “sent to project” earlier this morning arrived in my scrivener project successfully but i see that it is also still on Scratch pad. usually don’t they get automatically deleted after they are “sent”?

-sonia

Hi Sonia,

No, they don’t normally get deleted - it makes no assumptions, as it is possible that a user might want to send the same material to more than one project. Did you type the text in the scratch pad originally, or did you paste it in from elsewhere? This is really strange - I would expect copying and pasting the text to be even less likely to cause this sort of thing than “Send to” (and neither should cause it, of course).

Thanks and all the best,
Keith

i typed directly into Scratch Pad and then cut and pasted into the problematic Scrivener text documents. I guess the origins of the problem will remain a mystery.

thanks for your help,
sonia

Hi all,

I have a somewhat similar problem, though not identical. I’m working on turning my thesis into a book. As an academic project it is heavy in footnotes, and I currently have the thesis chapters saved as .docs.

To import to Scrivener, I have converted these .docs to .rtf, and then imported. Some of the original .docs have 100+ footnotes. Following import into Scrivener, I have noticed that the footnote markers are placed in the correct spot for the first two thirds or so of the document (at the end of a sentence, following the full stop). However, towards the end of the Scrivener file, the footnote markers start to migrate to the middle of the last word of the sentence. This is of course frustrating, as when I compile to .doc format the footnote numbers/markers are now placed in the middle of the last word of the sentence, rather than at the end of the sentence. Naturally, this makes the programme (which is otherwise superb) difficult to use, as I have to go back over every exported file and reposition multiple footnote markers.

It’s not practical for me to export/compile to another format.

Does anyone have any suggestions? I’m guessing that the size of the file is the problem, as Scrivener displays the first part correctly. I’ve read the above explanation of how Scrivener displays/links footnotes, but I’m afraid I can’t divine a solution of my problem from that.

Thanks.

Hi,

Could you please send us an RTF document that exhibits this problem when imported? If you could send it to mac.support AT literatureandlatte DOT com and mark it for my attention, I’d appreciate it. This sounds like an issue with the import process, but I’ve never seen anything like it and can’t imagine what would cause it, so an example of a document with the problem would be very helpful.

Thanks and all the best,
Keith

Hi Keith,

Thanks so much for taking the time to look at this, I appreciate it. It may well be the case that I’m simply not using the system correctly. I’ve sent on the email, looking forward to hearing from you.

Best,
Kinsey

Issue resolved, thanks to Keith for such quick support!

Thanks, Kinsey, I’m glad it helped.

soniashah - in looking at Kinsey’s problem, I discovered that text had shifted because of something strange going on in a table. Do you have any tables in the documents of yours that have been affected?

Thanks,
Keith

Hi Keith,
Afraid I’ve encountered another issue with footnotes - have just sent an email to the mac support address, marked for your attention. Hope you can help out again!
Kinsey

Hi,

I see that this is a very old thread, but I have just had a similar issue. The anchor of my linked footnotes moved a few characters to end in the middle of a word, and one anchor moved completely elsewhere.

Cause?
I did a major change to these documents a few days ago: a style defined in the editor was messing up the compiling process when compiling to ODT, so I switched the whole text to “normal” style. Could THIS be the reason?

Solutions?
I was wondering if it would work better if I used footnote markers in Project Settings > formatting.
I am not sure that I understand the benefit of these markers compared with regular footnotes.

I hope that someone can help…

The difference is just the way the footnote is anchored to the text. I assume by “regular” footnotes, you mean where you select a word and the footnote is anchored to that word. With “Footnote markers” set in Project settings, the anchor is an asterisk by default, though you can designate any glyph.

I always use the asterisk footnote marker. I sometimes decide to move it to another point in the text and all you have to do is select the asterisk and move it. I also find it less obtrusive.

All that said, I have never—and I’ve been using Scrivener since 01/2007—had a footnote martker or any other text move arbitrarily.

1 Like

Thank you for this explanation. I thought that was what it was about, but was not sure.

I would love to understand what happened (especially to be sure that it will not happen again), but in any case, I think I will change my footnote to markers and continue working this way, as you do.
I am not too fond of attaching them to one word, as words may change in future revisions…

1 Like

Absolutely! But, I guess there is a potential risk that, because they are so much less obtrusive, it would be possible to edit a stretch not spotting a footnote marker within it, resulting in the unintended deletion of the footnote.

I hope you get to the bottom of what happened.

:slight_smile:

Mark

1 Like

Because these markers are not carried over into the output text, you can use any string that is sufficiently visible. I use three asterisks, but you could just as easily use FOOTNOTE HERE if you wanted to.

1 Like

Thank you, I had not thought of that, but for sure using 3 asterisks will make them much more visible.

I have just changed all my footnotes to footnote markers with ONE asterisk. If I now change to 3, is it going to retroactively change ALL my footnote markers, or will I have to go through all of them again?