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

Other options for highlighted footnotes ids #1

Open
jgclark opened this issue Jan 29, 2014 · 5 comments
Open

Other options for highlighted footnotes ids #1

jgclark opened this issue Jan 29, 2014 · 5 comments
Assignees

Comments

@jgclark
Copy link

jgclark commented Jan 29, 2014

When highlighting some text to be the footnote id, it adds the footnote marker after it instead of replacing it. So for "some text.id1" with id1 highlighted, it turns into "some text.id1[^id1]" which seems rather redundant.

Your reply was: "My original use case for that was, to highlight a word or phrase you thought ought to be footnoted. “This sentence had the last word selected.[^selected1]” and the word selected would be the basis of the footnote id, but not necessarily intended to replace the word. If that makes sense? I intended it to work a bit like an indexing tool, e.g. if you got multiple selections of the same word, to insert the footnote at the end of every selected occurrence."

I can see the use case, but I can also see that it might produce clashing ids from time to time ...

@scotartt
Copy link
Owner

Yep. That's why it always asks the user for extra input. I see what you're doing though. You're entering the footnote id and would like the command to wrap the selection with the [^...]. Whereas when I designed the feature, I was more thinking about defining the actual id in the text input.

I might have to have a bit of think how to solve the problem in general; such as allowing it to auto-number the footnotes with a predefined prefix, for example. Or configurable behaviors with the selection.

@ghost ghost assigned scotartt Jan 30, 2014
@jgclark
Copy link
Author

jgclark commented Jan 30, 2014

Highlighting the footnote definition text and having a command auto-generate the next one-up (or random) id is a more valuable feature (and not what I had suggested yet, BTW). I don't want to have to worry about keeping track of id numbers or words, as that breaks my train of thought when writing. And that's the sort of thing our computers should be doing for us.

But it doesn't need to be either/or, as you could create an option for which selection method you want. Or you could keep the existing functionality available from a renamed menu item "Create footnote from footnote id", and add the other option as "Create footnote id from footnote".

Personally, I think I'd go with an automatic scheme numbering like [^fnxxx] where xxx is a zero-padded 3-digit number. Theses can get hundreds of footnotes, but I hope not thousands ...

@scotartt
Copy link
Owner

I think I'm going to drive this with preferences rather than with different commands per se. One use case that I am thinking about is per-file footnote prefixes. (I cut my thesis into one file per chapter, although even more fine grained than that when I am in the research process, or reorganising it). That saves having to keep track of footnote numbering across multiple files. -- this was the original idea of using the selected text as the basis of the footnote (stripped of spaces and punctuation).

Example:

I actually *name* each footnote for the content 
of the footnote.[^contentofthefootnote1] This 
helps avoid collisions.[^avoidcollisions1]

But I see to be generally useful it needs to be a bit more flexible than forcing the user to remember the numbering order. Also, even for me, it changes.

So this is what I propose. When you insert an footnote without any text selection, in the current file, it will locate the first footnote in (physically ordered closest to the beginning of) the file. The text portion of the note up to the last contiguous series of numbers becomes the default prefix for the footnote. The last contiguous sequence of numbers in the note is the numbering system. It will get all the existing footnotes that conform to the pattern, take the highest number, and add one. This is the suggested default. The note is inserted at the cursor position.

In other words, you have to have your first footnote inserted with the system and initial number you'd like.

If you have no notes inserted, it's choice will be your preferred default sequence from your preferences + "1".

On the other hand, if you have selected text when you insert the footnote, it will locate all existing footnotes that start with the selection, find the one with the highest number, and add one, the suggested footnote default is the selection + the number (which is "1" if the selection is unique in the existing footnotes). The footnote will be inserted at the end of each selected area (Pandoc is pretty unique in that you can have multiple selected blocks).

@scotartt
Copy link
Owner

Footnote cleanup when its written will then behave like the "insert footnote without a selection" behaviour. It will use the text of the first footnote as the prefix, the number portion as the start number, and incrementally order every single footnote in sequence through the file. At this point (ultimately when the features are added) moving and reordering the footnote text entries to conform with entry order in the file, and either placing them at the end of the file or after each paragraph (with configured number of spaces at start of line up to 3) according to what you have in your preferences.

@jgclark
Copy link
Author

jgclark commented Jan 30, 2014

Good thinking on both addition, cleanup and moving. I really like the way this is heading now, having a good mix of manual suggestion and automation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants