![]() Nov 01, 2012 Footnotes won't work in ebooks, instead you need to insert italic statements in parentheses immediately after relevant sentences. To insert a link that jumps to some. ![]() With a few caveats, making footnotes and similar cross-references in ebooks is pretty simple. The idea is to use html anchors, which can be inserted directly into your html (if you’re doing it that way) or by using Sigil (if you have exported an epub file from InDesign, for example). Both your text editor used for editing the html (TextMate, BBEdit, etc) and support the use of for searching, so that the footnotes can be identified in some unique fashion and replaced all at once. First, the anchors. You can learn more about elsewhere; this is just a really simple-minded introduction that assumes you have just one file, not several–so I usually do *not* break my epub or html files into chapters. The idea is to go both forward and back–so if you click the link on the note, it takes you to the list of footnotes, but then you can go back again.This works: At each reference, put in the following: [number] Then at the footnotes themselves: [(number)] where (number) is the number of your footnote, from 1 up to whatever. ![]() All this does is make a back-and-forth link to other places within the same html text. If you have other cross-references in the text, they can be handled the same way–just give them a different name, for example, use “app” for appendix instead of “fr.” OK, that’s easy but how to get this rather beastly expression around each of your innocent little footnotes, which are often just a number? ![]() Here’s where the beauty of regular expressions comes in. You can do a regular expression search for any number of digits “ d+”and bracket that with your reference. Watch out, though, if there are other numbers in your text! Often there is something else that identifies your footnotes: they’re in parentheses, or in superscript, or some other specific format. In my latest example, the footnotes were all in a specific style defined by InDesign. So when I opened the exported Epub in Sigil, all footnotes looked like this: number So, using regular expressions: Search: ( d+) Replace: 1 Where “ 1” is regular expression-ese for “that same text that you found” (some editors use $1). It’s important to put the “ d+” inside a pair of parentheses–that tells the regular expression search to “capture” the contents of the parentheses for later use. The “ 1″ tells the replace to use the contents of the capture. (note that if you have more than one set of capture parentheses, the first one captures into 1 and the second into 2, and so on. That’s a topic for a different day) Now that that’s all done, go down to the footnotes themselves. There are lots of numbers in footnotes referring to pages and things, so you don’t want to pick them up by accident. Let’s say the numbers you want to link to are encased in square brackets. Then your life is pretty easy. Do this: Search: [( d+)] Replace: [ 1] The lesson to take home from this is that if you’re exporting from a program such as Word or InDesign, you want to have tags on your footnotes that make them easily searchable. If they can be identified in a unique fashion, then formatting them for your e-book is as simple as Search & Replace. The most important thing is to be very consistent so the search can find them! If there are no tags, you have to be very careful using “Replace All,” and may have to scroll through one by one to make sure only the desired targets are chosen, and not some innocent other text with numbers in it. Happy footnoting! 8 Responses to “Footnotes and References in Ebooks” •. Wiseguy – it depends on what program you’re using and how you’re using it. BBEdit and TextWrangler use 1. Sigil also uses 1. Perl (which we also use a lot for such things) uses 1 if you do the search and replace using the standard s/pattern/replacement_pattern/ method, but if you want to do it in two steps you’d use $1 in the next few lines of code. And we did note in the explanation of the search and replace strings that some editors use 1 and some use $1 (Indesign may use $1, but we don’t do so much grepping in that). I am having some difficulties with footnoting a scholarly book for my employer. We have the links working so that you can click an endnote-reference in the body of the text and be redirected to the appropriate spot in the endnote page. And we have backlinking set up so you can click the number on the endnote page and go back to where you were reading in the body of the text. However, we are now working on FORMATTING. The difficulty I’m having is twofold: 1.) I want a hanging indent that will look something like this: 9.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
March 2018
Categories |