├── footToEnd.gs ├── index.html ├── readme.md └── style.css /footToEnd.gs: -------------------------------------------------------------------------------- 1 | // globals 2 | var doc = DocumentApp.getActiveDocument(); 3 | var body = doc.getBody(); 4 | 5 | // Add the custom menu 6 | function onOpen() { 7 | DocumentApp.getUi().createMenu("Create Endnotes") 8 | .addItem('Run', 'newEndnotes').addToUi(); 9 | } 10 | 11 | // Break a new page at the end of the document 12 | // Add "Endnotes" title section 13 | // Copy footnote contents into the new section as a numbered list 14 | // Add cross reference for each entry 15 | function newEndnotes() { 16 | var footnotes = doc.getFootnotes(); 17 | body.appendParagraph('Endnotes').setHeading(DocumentApp.ParagraphHeading.HEADING1); 18 | for(var i=0; i 5 | 6 | 7 | Endnote Generator 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 |
16 |
17 |

Endnote Generator

18 |
19 |
20 |

Google Docs offers footnotes for document citations. But, what if you need endnotes?

21 |

You're out of luck1. Until now2.

22 |
23 |
24 |

Endnote Generator is a Docs AddOn which will convert your footnotes into endnotes.

25 |

Cite your work as you go using footnotes. When you're done, use the menu to convert everything into an endnotes section keeping your references in place and in order.

26 |
27 |
28 | 29 |
30 |
31 |

Current features

32 |
    33 |
  • Formatting in footnotes is preserved when converted to footnotes, including links.
  • 34 |
  • Images and drawings are now included in the conversion.
  • 35 |
36 |

Known issues

37 |
    38 |
  • You have to wait until you're done with references to run the script. It clears the order once they're generated, so you can't go back and insert references once you generate the endnotes.
  • 39 |
  • When you get into triple-digits (100+), things can get wonky.
  • 40 |
41 |
42 |
43 |

Other Issues?

44 |

Things come up. Leave a note on GitHub with problems or requests.

45 |
46 | 52 | 55 |
56 |
57 | 58 | 59 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | Endnote Generator 2 | === 3 | Google documents do not allow you to create linked endnotes in a document. 4 | This Google Apps script looks for existing footnotes in a doc and creates an endnotes section from that content. 5 | 6 | Use 7 | === 8 | This is a Google Docs AddOn, so it's easiest to [add from the AddOns store in Drive](https://chrome.google.com/webstore/detail/endnote-generator/nmhebcalinkmgflgcfapknjhbliebooc). 9 | 10 | Current Version 11 | === 12 | **Current** - v0.5 - Footnotes on images are now preserved when converted. 13 | 14 | v0.4.7 - Endnotes now retain formatting. 15 | 16 | AddOn v0.4 - bug fix to repair the "Run" menu not appearing. 17 | 18 | v0.1 - AddOn published 19 | 20 | Other Uses 21 | === 22 | 23 | If you want to install and run **on a single document**, do the following: 24 | 25 | 1. Open the document you'd like to create endnotes in. 26 | 2. Go to **Tools > Script Editor** and delete the default `function` text in the editor. 27 | 3. Copy the `footToEnd.gs` script and paste it into the editor. 28 | 4. Name the script "Endnotes", save the file, and close the tab. 29 | 5. Reload your document. 30 | 6. There is a new menu item called "Create Endnotes." Use it to run the script. 31 | 32 | Known issues 33 | === 34 | - It only loops through `paragraph` elements in the doc, so if you have a footnote on an image, it's going to throw an error. 35 | - Creating endnotes removes all footnotes from the document, meaning if you go back and add a footnote, it starts over with **1**. 36 | 37 | License 38 | === 39 | This is provided AS IS under the MIT Open License. 40 | 41 | It was a fun little project and not something I plan on really improving a lot more. Feel free to fork and update however you'd like. 42 | -------------------------------------------------------------------------------- /style.css: -------------------------------------------------------------------------------- 1 | html, body { 2 | margin: 0; 3 | padding: 0; 4 | height: 100%; 5 | background-color: rgb(235,235,235); 6 | font-family:sans-serif; 7 | } 8 | 9 | #head { 10 | position:fixed; 11 | width:100%; 12 | top:0; 13 | margin:0; 14 | padding:2.5px 0 2.5px; 15 | z-index:10; 16 | line-height:2; 17 | background-color:rgb(255,255,255); 18 | } 19 | 20 | #head a { 21 | margin-left:25px; 22 | } 23 | 24 | #main-wrap { 25 | width: 100%; 26 | height: 100%; 27 | margin: 0; 28 | padding: 0; 29 | position: relative; 30 | } 31 | 32 | #content-main { 33 | width: 50%; 34 | margin: 55px auto; 35 | background-color: #fff; 36 | box-shadow: 1px 0 2px #888; 37 | display: block; 38 | position: relative; 39 | height: auto; 40 | padding: 20px 0; 41 | } 42 | 43 | .section { 44 | width:75%; 45 | margin-left:100px; 46 | position:relative; 47 | } 48 | 49 | .section video { 50 | width:100%; 51 | height:auto; 52 | box-shadow:0 0 2px rgb(135,135,135); 53 | } 54 | 55 | sup { 56 | font-size:10px; 57 | } 58 | 59 | #notes { 60 | position:relative; 61 | margin-top:50px; 62 | margin-bottom:25px; 63 | font-size:14px; 64 | } 65 | 66 | #notes p { 67 | -webkit-margin-before:0; 68 | -webkit-margin-after:0; 69 | } 70 | 71 | #foot { 72 | position:absolute; 73 | bottom:0; 74 | font-size:11px; 75 | text-align:right; 76 | margin-bottom:25px; 77 | } 78 | 79 | .highlight { 80 | background-color:rgb(204,255,51); 81 | background-color:rgba(204,255,51,0.5); 82 | cursor:pointer; 83 | } 84 | --------------------------------------------------------------------------------