14 Replies Latest reply on Apr 11, 2015 1:06 PM by ElishevaH

    Restarting footnotes at each chapter

    ElishevaH Level 1

      I am working on a document with 5 chapters and the document has hundreds of footnotes. I want the footnotes to be restarted at each chapter. How do I do this?

      Thank you.

        • 1. Re: Restarting footnotes at each chapter
          vladan saveljic Level 4

          every chapter has to be new section.

          Then in "Footnote option" > numbering and formatting you have to choose restart numbering every section.

          Schermata 2015-04-09 alle 17.10.26.png

          Schermata 2015-04-09 alle 17.09.48.png

          • 2. Re: Restarting footnotes at each chapter
            Obi-wan Kenobi Adobe Community Professional

            Hi,

             

            A chapter == A section

             

             

            • 4. Re: Restarting footnotes at each chapter
              ElishevaH Level 1

              Do I have to do anything in InDesign to differentiate between the chapters/sections? How does InDesign know where each chapter begins?

              • 5. Re: Restarting footnotes at each chapter
                Obi-wan Kenobi Adobe Community Professional

                premio_oscar has shown you the way! 

                • 6. Re: Restarting footnotes at each chapter
                  ElishevaH Level 1

                  How do I make each chapter a new section? premio_oscar has the menus in a foreign language. I understand how to define that the footnotes restart at each section but I don't understand how to make each chapter a new section.

                  • 7. Re: Restarting footnotes at each chapter
                    Obi-wan Kenobi Adobe Community Professional

                    Aha! Not the good cop! I'm French! 

                    But you have the same windows! except the language!  A little work!

                    • 8. Re: Restarting footnotes at each chapter
                      ElishevaH Level 1

                      I am not French. What is the window that has to do with defining the chapter to be a different section. I know that I have the same windows, just in a different language. I just don't understand something. I'll ask differently: What is a "section"?

                      • 9. Re: Restarting footnotes at each chapter
                        Obi-wan Kenobi Adobe Community Professional

                        … Well! …

                         

                        The first screenshot (2 windows) is about the plan of your book (all the pages).

                        The 2nd is about footnotes options.

                         

                        To define a page as beginning of a section, find it in the plan (right part of the 1rst screenshot), click on Ctrl and the page you want as beginning of a section and choose the last sub-menu [in French:  "Options de numérotation et de section…"].  Gotcha! 

                         

                        I hope I'm clear!!

                        • 10. Re: Restarting footnotes at each chapter
                          Peter Spier Most Valuable Participant (Moderator)

                          The dialog you need is called Numbering and Section Options and is available from the Pages panel flyout menu or from the context menu when you right-click a page icon in the Pages panel.

                           

                          You'll probably also want to make each chapter a separate story.

                          • 11. Re: Restarting footnotes at each chapter
                            ElishevaH Level 1

                            Great, thanks. And what does this mean to "make each chapter a separate story"? (sorry, I'm not so experienced).

                            • 12. Re: Restarting footnotes at each chapter
                              Peter Spier Most Valuable Participant (Moderator)

                              A story is a set of threaded text frames. In the long run it will probably be easier for you if two chapters are not threaded together so that editing does not push a chapter start to a new page unexpectedly (but you do have to be mindful of possibly overset text at the end of each story).

                               

                              Here is a script you can install in a "Version 6.0 Scripts" (case sensitive, but leave off the quotation marks) folder inside your Scripts panel folder. Select the frame that should be the first frame in the next story, and the script will divide the threaded frames into tow stories. See How to install scripts in InDesign | InDesignSecrets  for direction to install scripts.

                              // Set to 6.0 scripting object model (Indesign CS4)
                              app.scriptPreferences.version = 6.0;
                              
                              
                              //DivideStory.jsx
                              //a modification of the DivideStory.jsx script from Dave Saunders' website (http://jsid.blogspot.com/2005_08_01_archive.html),
                              //combined with the error-checking from
                              //the SplitStory.jsx script that comes with Adobe Indesign CS4. I have removed the part of Dave Saunders'
                              //script that allows for tables, because we will never need that. The reason I have separated out the dividing
                              //from the selecting and error-checking is that I might use this divideStory function in another script,
                              //in which the textFrame to be divided is picked by the script, not by the user.
                              //- Richard Harrington 2010
                              
                              // P.S. I also added an optional part (activated by the boolean argument solidifyJumplines) where it takes
                              // already existing jump lines, // in the Forward's format, and makes the page
                              // numbers into numerals of text instead of special PreviousPageNumber and NextPageNumber characters.
                              // The variable solidyJumplines defaults to true.
                              
                              main();
                              
                              function main() {
                                //Make certain that user interaction (display of dialogs, etc.) is turned on.
                                app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;
                                
                                if (app.documents.length == 0)
                                  error_exit ("Please open a document and try again.");
                                if (app.selection.length == 0)
                                  error_exit ("Please select a text frame and try again.");
                                    
                                var mySelection = app.selection[0];
                                if (mySelection.constructor.name != "TextFrame")
                                  error_exit ("Please select a text frame and try again.");
                                if(mySelection.parentStory.textContainers.length == 1)
                                  error_exit ("Please select a story containing more than one text frame and try again.");
                                if(real_text_frame_index (mySelection) == 0)
                                  error_exit ("Please select some other text frame besides the first one in the chain, and try again.");
                              
                                divide_story (mySelection);
                              }
                              
                              function divide_story (myFrame, solidifyJumplines) {
                                //Splitting the story is a two-step process: first, duplicate
                                //the text frames, second, delete the original text frames.
                                var myStory = myFrame.parentStory;
                                var mySplit = real_text_frame_index (myFrame);
                                var myTot = myStory.textContainers.length;
                                
                                // Work from the back
                                var myStart = myTot - 1;
                                var myEnd = mySplit;
                                
                                var myPreJumpPage, myPostJumpPage;
                                var myPreJumpParagraph, myPostJumpParagraph;
                                
                                if (arguments.length < 2) var solidifyJumplines = true; // defaults to true
                                
                                if (solidifyJumplines) {
                                  myPreJumpPage = find_page (myFrame.previousTextFrame);
                                  myPostJumpPage = find_page (myFrame);
                                }
                                
                                // If there are more than two textFrames in the story
                                if (myStart > myEnd) {
                                  var myPrevFrame = split_me(myStory.textContainers[myStart]);
                                  for (var i = myStart-1; i > myEnd; i--) {
                                    var myNewFrame = split_me(myStory.textContainers[i]);
                                    myPrevFrame.previousTextFrame = myNewFrame;
                                    myPrevFrame = myNewFrame;
                                  }
                                }
                                // Now we deal with the last frame
                                myFrame = myStory.textContainers[myEnd];
                                try {
                                  var myIndex = myFrame.characters[0].index;
                                  var storyEnd = myStory.length - 1;
                                  var myText = myStory.texts[0].characters.itemByRange(myIndex,storyEnd);
                                } catch (e) { } // Ignore; happens if last character is a table or frames are empty.
                                
                                
                                myNewFrame = myFrame.duplicate();
                                try {myText.remove();} catch(e){} //ignore empty frame
                                myFrame.remove();
                                try {myPrevFrame.previousTextFrame = myNewFrame;} catch(e){} //fails if one frame only
                                
                                // FROM HERE ON IN THE MAIN() FUNCTION IS THE PART THAT I HAVE ADDED
                                // TO DAVE SAUNDERS' ORIGINAL SCRIPT.
                                
                                // Remove the last paragraph break from the jumped-from story, if it exists.
                                if (myStory.characters[-1].contents == "\r") {
                                    myStory.characters[-1].remove();
                                }
                                
                                // Now we deal with the changing the page numbers in jumplines from special page number characters into text.
                                if (solidifyJumplines) {
                                  myPreJumpParagraph = myStory.paragraphs[-1];
                                  if (myPreJumpParagraph.appliedParagraphStyle.name.match(/jumpline/i)) {
                                    // replace the special character after the word "page "
                                    myPreJumpParagraph.characters[myPreJumpParagraph.contents.indexOf("page ")+5].contents = myPostJumpPage.name;
                                  }
                              
                                  myPostJumpParagraph = myNewFrame.parentStory.paragraphs[0];
                                  if (myPostJumpParagraph.appliedParagraphStyle.name.match(/jumpline/i)) {
                                    // replace the special character after the word "page "
                                    myPostJumpParagraph.characters[myPostJumpParagraph.contents.indexOf("page ")+5].contents = myPreJumpPage.name;
                                  }
                                }
                              }
                              
                              
                              function split_me(myFrame) {
                                myDupeFrame = myFrame.duplicate();
                                while(myDupeFrame.contents.length > 0) {
                                  myDupeFrame.texts[0].remove();
                                }
                                myFrame.remove();
                                return myDupeFrame;
                              }
                              
                              
                              
                              function error_exit (message) {
                                if (arguments.length > 0) alert (unescape(message));
                                exit();
                              }
                              
                              
                              
                              // The following function is a replacement for the textFrameIndex property of the TextFrame object.
                              // The textFrameIndex property counts the number of columns in all the text boxes in the story, not the number of
                              // text frames. In my humble opinion, this is a huge bug.
                              
                              function real_text_frame_index (myFrame) {
                                var i;
                                var myStory;
                                
                                myStory = myFrame.parentStory;
                                for (i=0; i < myStory.textContainers.length; i++)
                                  if (myStory.textContainers[i] == myFrame)
                                    return i;
                              }
                                
                              
                              
                              //var myDoc = app.activeDocument;
                              //var myObj = app.selection[0];
                              //$.write("The selected object is on page " + findPage(myObj).name + "\n") ;
                               
                              function find_page(theObj) {
                                var thePage = theObj;
                                if (thePage.hasOwnProperty("baseline")) {
                                  thePage = thePage.parentTextFrames[0];
                                }
                                while (thePage.constructor.name != "Page") {
                                  var whatIsIt = thePage.constructor.name;
                                  switch (whatIsIt) {
                                    case "Story" :
                                      thePage = thePage.textFrames[-1].parent;
                                      break;
                                    case "Character" :
                                      thePage = thePage.parentTextFrames[0];
                                      break;
                                    case "Cell" :
                                      try {
                                        thePage = thePage.insertionPoints[0].parentTextFrames[0];
                                        break;
                                      } catch (e) {
                                        // must be overset, so ignore
                                        return null;
                                      }
                                    case "Application" :
                                      // must be off page, so ignore
                                      return null;
                                  }
                                  thePage = thePage.parent;
                                }
                                return thePage
                              }
                              
                              
                              
                              
                              
                              

                              Copy the above code into a plain text editor like Notepad on PC or TextEdit on Mac and save as text with the name DivideStory2, but change the extension to .jsx and then install. Double-click the name of the script in the Scripts panel to run it.

                              • 13. Re: Restarting footnotes at each chapter
                                ElishevaH Level 1

                                Very good, thank you