View Single Post
Old 10-17-2014, 09:35 AM   #9
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by BetterRed View Post
IIRC when the idea of editor plug-ins first came up, some folks wondered what they might be used for - this seems a possible candidate.
Well I have my own personal Java program I use to automatically renumber footnotes back/forth, although it is very buggy/finnicky.

It just goes through and looks for every "<sup>#</sup>" and begins counting up from 1 to end of chapter, creating links in this form:

Code:
<a href="#fn9" id="ft9">[9]</a>
Then it hits an "<hr />" which I place at the end of every chapter, right before every Footnote section. This signals for it to flip, and look for every "<sup>#</sup>" and begins creating links pointing in the other direction.

Code:
<a href="#ft9" id="fn9">[9]</a>
The features it needs + bugs are many though:
  • Doesn't take into account if there are a mismatching number of footnotes
    • Might generate 100 footnotes in the text, but 99 or 101 footnotes pointing back.
    • This is most likely an OCR error, OR, an actual mistake in the physical book.
  • It can't handle mathematical superscripts (think "x^2" or "x^(2x+b)")
    • I get around this by manually changing those to <span class="superscript">, run my program, and then fix those back to <sup>
  • If you have multiple non-numbers in a superscript, it only keeps the first character.
    • This is due to the way I crappily test/replace what is in the superscript
  • Can't handle symboled/lettered footnotes.
    • (*, †, ‡, §, ‖, ¶, **, ††, ...)
    • (a, b, c, d, e, ...)
      • There should also be a toggle to all footnotes (number + lettered + symbol) in the same renumbering flow, or all of them in a separate renumbering flow.
  • There should be a toggle to be able to point out when the footnote it is replacing it with does not match the actual text number
    • For example, if the text is "<sup>10</sup>", but my program reaches this and believes it should be replaced with a number 11. Either the text is wrong, or the program is wrong. It should be able to point this out, or allow manual intervention.
    • I work on a MASSIVE amount of OCR stuff, and these errors are quite common
      • Missing footnote number in the text
        • The actual text might have jumped from a superscript 3 to a superscript 5.
      • Missing footnotes at the bottom of the page
      • Accidental footnotes that have disappeared into thin air from the OCR
      • OCR missed the little tiny superscript.
      • Same footnote number showing in multiple places in the text
        • The text might have a superscript 3, followed by another superscript 3.
      • ...
  • Should be possible to feed it an array of "what the total number of footnotes per chapter SHOULD be"
    • If the program generates footnotes correctly, Chapter 1 should have 100 footnotes, Chapter 2 should have 50 footnotes, Chapter 3 should have 89 footnotes...
      • This is a step I have to manually do during the A/B comparison of EPUB/PDF.
  • Should have a toggle to either count from 1 -> end of chapter, or 1 -> end of book.
  • I always imagined it would be FANTASTIC to be able to see two arrays of the text side by side. The paragraph with the link to + the corresponding paragraph with the link from. So you can easily see if they match. (This would save me SO MUCH WORK on the A/B comparison with the PDF).
    • Currently, I just go through and take a random sampling of footnotes per chapter to see if they match.

I really should get around to programming it better, although I would rather focus my time on many other higher priority projects (or digitizing many more books). It works ok for me, and I am used to the bugs, so I get around them beforehand.

Quote:
Originally Posted by phossler View Post
The best convention I've come up so far is something like the to-from pairs below, BUT it's all manual, keeping track of current cite number, inserting the matching anchors / links, etc.
We had a huge footnote discussion in this thread. I gave real life examples, plus my reasoning for all of it:

https://www.mobileread.com/forums/sho...d.php?t=225045

The important thing is to be CONSISTENT.

(Of course, you can also expand upon it to make it more explicit):

Code:
<a href="../Text/01.xhtml#fn9" id="ft9">[9]</a>
<a href="../Text/01.xhtml#ft9" id="fn9">[9]</a>
or something like this:

Code:
<a href="../Text/01.xhtml#fn01.9" id="ft01.9">[9]</a>
<a href="../Text/01.xhtml#ft01.9" id="fn01.9">[9]</a>
That might help if you do a lot of splitting of HTML files, want to easily go from Footnotes to Endnotes, or want to make sure that tools like Calibre doesn't break the relative links if converting to format XYZ.

Last edited by Tex2002ans; 10-29-2014 at 03:48 PM.
Tex2002ans is offline   Reply With Quote