Workaround: How to get page numbers in an ePub

Learn / Forums / General InDesign Topics / Workaround: How to get page numbers in an ePub

Viewing 8 reply threads
  • Author
    Posts
    • #59911
      jpannier
      Member

      I guess we’re all a little bit frustrated because of the ePub-development in bits and pieces. As a designer we need more control about nearly everything. But I don’t want to yammer.

      I’m doing scientific books in print and in e-publishing. And one of the most important things for scientist is to reference a quote exactly and accuratly. That means they take the book, they quote and they reference to the page. But how to do this in an ePub? Since there is no concept of pages – everything is reflow able – the quality of referencing sinks.

      After many hours of experimenting here is a workaround. I know, there a lot of additional problems involved with this workaround (broken cross-references and hyperlinks – are one of them) but maybe this starting point will lead for someone to further thinking.

      1. Master page items will not be exported to ePub so neither page numbers will.
      2. A story – even if it lives in hundreds of threated text frames – will be treated as one text. So how to get the page number in?
      3. Create a text variable on the master page – referring to the paragraph stile of the regular page number. (It is also a good idea to surround the variable with [#], so it will be separated from the main text later.) Place the text frame with the variable under the main text frame. And don’t forget to create an object stile for this text frame as well.
        After that you will not see the variable on a regular page.
      4. Therefore you have to override all of the master page items. You can do this for the whole document by selecting every page in the pages panel. Because of this override, it is a good idea to place potential other items on different layers, so that you can turn off these layers.
      5. Now you have two text frames with the same number on your page. But even if the page number is not a master page item anymore – it will not get exported. (The frame will but without content). The text variable will get exported to ePub.
      6. Now you have two choices to get this variable into the right spot.

        1. Use the build in script “SplitStory”. This will break your long story and it will remain exactly the same as in the print layout. (Therefore it would be very good to disable hyphenating at the end of a text frame while you’re setting up the print version in forehand.)
        2. You can use the new feature in CS5.5 and simply drag the frame as an anchored object after the last letter of the text frame. (But be careful this could cause problems if you later replace all of the ‘bad’ letters and characters like non-breaking spaces. This could lead to a page flow, and the anchor will flow as well and then the variable will get a wrong number – if it changes the page.)

        7. Now you can control the ‘fake’ page number with your CSS. I set the numbers in gray, a little bit smaller and assigned a left float to the containing div. (This is the reason for the object stile.)

      OK, I’m aware of the briefness of this explanations but I still hope you get an idea of the trick with the text variables.

      Jeldrik

    • #62093

      Thanks, Jeldrik, this really helped. One thing I did differently was to create a separate auto-numbered page number so that every page, including pages without folios, gets an ePub page number. Once the page numbers are on the page, we anchor each page number frame to the main text flow just before the last word on the page.

      The project gets passed on to our digital asset people for export to ePub. Do you have any further advice on this process?

      Rebecca

    • #62111
      jpannier
      Member

      Hi Rebecca,

      you're right I switched to your message as well. So I anchor the text frame which contains the page number. But don't anchor it before the last word you have to anchor it behind the last word (and before the last space ;-). If not you 'loose' a word respectively the last word gets a different page number.

      And there's another tip. You can anchor a text frame with a variable, then cut the anchor marker to the clipboard, now you can place your cursour at any point and insert the anchored text frame.

      And yet another tip. Avoid hyphenation over text or page breaks – so your page number will be 100% correct. You will find this settings under the paragraph menue

      Jeldrik

    • #62128

      Thanks, Jeldrik. Good point about putting the cursor “after” the last word—I must not have had enough coffee the day I was working this out!

      Interesting alternate process cutting-and-pasting the anchor. When you do this, the pasted text frame moves up and down the page, depending on the length of the text on the page, because it's position is relative to the anchor. Also, you have to add a text frame to blank pages so you have somewhere to anchor the page number frame. It is easier, though, to repeatedly paste the anchor than to repeatedly click and drag anchor handles.

      I have an InDesign CS5.5 file (and IDML copy) set up for this, including some long-winded instructions. The styles, layers, and frames are created but the process has not been “run.”

      If anyone to take a look, the DropBox link is:

      https://dl.dropbox.com/u/481433…..Folder.zip

    • #62139
      jpannier
      Member

      Hi Rebecca,

      thanks for this good instruction.

      I use the drag and drop method the most. But if the last character is a period or a comma and 'border/paragraph adjustment' (I don't know the english ID term) is on it is nearly impossible to put the drag and drop anchor cursor at the right place ;-).

      Jeldrik

    • #63332
      Laras
      Member

      Hi there,

      This thread is really interesting and I've spent some time experimenting myself. Jeldrik wrote, “… even if the page number is not a master page item anymore – it will not get exported. (The frame will but without content). The text variable will get exported to ePub.”

      Once I've overridden the master page items on all the pages, as Jeldrik writes, it will not get exported… the frame will, but not the content (unless I've included the word “page” in which case that text will export, but not the variable text). So I'm not sure how to get to the next sentence of “The text variable will get exported to ePub.”

      Any thoughts. I'm using the variable text in Type Menu… Insert Special Character… Markers… Current Page Number.

      Thanks for everything so far!

      Lara

    • #63420
      jpannier
      Member

      Hi Lara,

      you're right, this sentence doesn't make any sense.
      Before you export your document to epub use Marijans script to convert variables to text: https://tomaxxi.com/downloads/

      This will help.

      Jeldrik

    • #86661
      tiff3133
      Member

      Hi,

      I’m really interested about this idea.
      My only problem is that I have to do this in a 700 pages-book…

      So how to paste automatically the frame with the page number at the top of the main text frame ?

      Thank you for your response !

    • #86754
      David Blatner
      Keymaster

      You might also want to take a look at Page Staker here:
      https://www.bradytypesetting.com/rorohikoscripts

Viewing 8 reply threads
  • You must be logged in to reply to this topic.
>
Notice: We use cookies on our websites to give you a great online experience. If you keep browsing, we'll assume you're ok with this. For more information, see our privacy policy. By closing this banner, you agree to the use of cookies.I AGREENo