is now part of CreativePro.com!

Previous/Next Page Number on Same Page

I think we’re all familiar with adding a Current Page Number marker to a text frame on a master page for automatic folios (page numbers) on document pages. But what if you wanted a page to also show a Previous or Next Page Number? For example, page 5’s header would show “4 | 5,” page 7’s header would show “6 | 7” and so on. Is there any way to get InDesign to do that automatically?

1-jumpa.gif

In close to two decades of page layout work I’d never encountered a project that needed this; yet for some reason, in the past couple weeks we’ve received a bunch of e-mailed requests for help with this same question.

The final straw was that at the Creative Suite conference here in Chicago (which just wrapped up yesterday, 10/17), an attendee walked up and asked me how to do the same dang thing. I thought I was on Candid Camera. She said it was the one question she was hoping to figure out during the show. (And no, she wasn’t one of the e-mailers, I asked her.)

I figured out a method and presented it during the final, fun and raucous “Tips from the Ensemble” session that David always schedules to close out the conferences. You can download the InDesign file I created to demo the solution, if you want. (It’s an .inx file, so you can open it in CS2 or CS3).

They Need a Threaded Text Frame

More after the jump! Continue reading below
Free and Premium members see fewer ads! Sign up and log-in today.

Unlike Previous/Next page number markers, the Current Page Number marker doesn’t need to be associated with a threaded story — it can sit by itself in an unthreaded text frame. All it reports is “What document page am I sitting on?” There’s only one answer, right?

But Previous/Next Page Number markers are reporting the page number where the previous or next text frame of a threaded story is located. The “answer” — the page number they display — could be any page number in the document, wherever the other frame is. (If you put either of these markers into their own standalone text frame, they’ll show the same as the Current Page Number — because the frame they’re sitting in is the previous and the next frame.)

I should mention for the beginners here that you insert the page number markers into text frames by choosing the appropriate entry from the Type > Insert Special Character fly-out menu. Here’s what it looks like in CS3:

1-jumpmenu.gif

All the numbers you see in the screen shots in this post were automatically generated by InDesign by inserting one of these markers into the text frame(s).

Normally you use Previous/Next Page Numbers for jump lines. When a story jumps from page 2 to page 3, in the text on page 3 you can type “Continued from page [Previous Page Number]” and it would show “Continued from page 2.”

1-jump.gif

If you moved the previous frame (the first frame, on the left in the screen shot above) to a different page, say from page 2 to page 20, the text on page 3 would update to “Continued from page 20.”

However, the marker doesn’t have be in the same frame as the article text to work correctly. In fact it usually isn’t. As long as any part of the text frame holding the page number marker overlaps the article’s text frame, it’ll figure out which threaded story it’s supposed to be reporting page numbers for:

1-jump21.gif

On the left in the image above, the jump line is in its own frame, overlapping the article frame, and says “cont’d on Page [Next Page Number].” InDesign enters a “3” because that’s where the next frame of the threaded story is located. The jump line frame on page 3 is actually “cont’d from Page [Previous Page Number].” (And the big “2” and “3” at the top are each “Current Page Number” markers in master page text frames.)

Solution: Make a Phantom Thread

Now that we know Previous/Next Page Numbers need to report on a threaded story, we can add a “phantom” one to the master page, and the markers will report page numbers correctly on the document pages, automatically. (With one limitation, covered in the final paragraph.)

Take a look at my B-Master from the demo layout file below. I created two small text frames, one on either side of the spine, and threaded them with the Selection tool. They can be any size you want, you won’t be putting any text in them. Then on the right-hand page, I added two text frames, one for the Previous Page Number (the first “B”) — which I made sure overlapped the threaded text frame — and one for the Current Page Number (the second “B”).

1-jump3.gif

I put the frames on different layers to help distinguish them, though it’s not necessary. And, you’ll have to take my word for it the “B’s” are two different markers, as InDesign doesn’t give you any visual indication which is which. On the master page, any page number marker shows up as the prefix letter of the master page name.

Now, when I move to a document spread, the right-hand pages all show the Previous and Current page numbers, automatically (see the first screen shot in this article for a Preview view):

1-jump4.gif

One Limitation

Interestingly, I found that using this method, the right-hand page will not show “Next Page Number” nor can the left-hand page show “Previous Page Number.” In either case, the non-working marker reports the current page number. The only way I could work around it was by 1) filling the phantom text frames in the document pages with text; and then 2) overriding the non-working master page text frame on each document page.

Anne-Marie “Her Geekness” Concepción is the co-founder (with David Blatner) and CEO of Creative Publishing Network, which produces InDesignSecrets, InDesign Magazine, and other resources for creative professionals. Through her cross-media design studio, Seneca Design & Training, Anne-Marie develops ebooks and trains and consults with companies who want to master the tools and workflows of digital publishing. She has authored over 20 courses on lynda.com on these topics and others. Keep up with Anne-Marie by subscribing to her ezine, HerGeekness Gazette, and contact her by email at amarie@senecadesign.com or on Twitter @amarie
  • salem says:

    This is great – I’ve been looking for a way to put text references in a catalog that say go to page X for more info. The trick has been when page X moves around during the creation process of the catalog. So far I’ve had to manually update the page reference each time.

    But now I can just use the next page number character, then place text into linked frames on the page making the reference and the referenced page. Color the text white, make sure there’s no wrap, and I’m done. Thanks again.

  • Salem,

    Watch out. In order for this trick to work, the two frames have to be threaded. In order for the frames to stay with their source and destination for a cross reference, they have to be anchored.

    But: you can’t thread anchored frames.

    Catch 22.

    Dave

  • Anne-Marie says:

    Dave’s correct, sorry Salem.

    For links to cross-reference solutions for InDesign, see David’s recent post, Cross References in InDesign.

  • Eugene says:

    I would love and absolutely need without a shadow of a doubt to have a cross reference utility available within InDesign. I’m not a fan of how the workaround works, I can do it, but other members of my team are really new to InDesign and I only have them understanding the basics, let alone complex manners of creating the cross-reference.

    Cool post today though, I really enjoy all the little things that InDesign can do that ever so helpful. I’m sure this tip will come in handy some day, as the transform individually did for me today. I had 35 images that need rotating of 90 degrees inside the container and this was a superb way of doing it.

    Thanks a million for all the posts and I’m enjoying every minute of it.

    P.s. We should really get the cross-reference onto the wishlist for Adobe…

    Adobe WishList

  • Paul Bunyar says:

    I thought the idea was to simply have both page numbers for a spread on one page. Just create a text box on the left master page that crosses over to the right master page. In that text box you have page “1”. Create another text box on the right hand master page. In that you have page “2”. And you can still do some interesting formatting with these two text boxes. If you want both numbers on the left side, simply reverse the layout. It does work. Thanks.

  • Anne-Marie says:

    D’oh!

    Works great, less filling!

    Thanks, Paul.

  • David Blatner says:

    Paul’s idea is a good one, though for some reason I never like having objects cross the spine. It should work fine, but I prefer a third method:

    I make a small text frame, put the auto page number in it, then anchor that frame inside another frame on the left page. As a “custom” anchored object, I can drag it anywhere I want, including onto the right page of the spread. This way, it thinks it’s on the left page, but it appears on the right page.

    Here’s how it looks on the master page:

    • mandy says:

      Hi David,

      this way it worked for me, while the way suggested by the article didn’t, don’t know why..i am new to indesign..

      thanks a lot to everybody anyway

  • Sarah says:

    What perfect timing. I’ve racked my brain trying to think of a way to do this. And with a 256-page book, I was not looking forward to typing it in manually.
    David’s suggestion has worked like a dream, and even better is that you can have the current page # and the next page # appear in the same text box.
    Thank you so much!!!

  • Brian Cupp says:

    I found that when using the master page to populate the “Previous Page Number” on the left-hand page doesn’t work as Anne-Marrie pointed out. There is a fix for this and probably a bug.

    Unlink the Text Frame that has the “Previous Page Number” on the left-hand page and the numbering works correctly.

    Brian

  • Eugene says:

    You know… I always try to think of a better way to do things when they pop up here, just out of curiosity. But 10 times out of 10 I can’t, I just can’t. The way described here is great, I would never have figured it out on my own, it’s a great problem find that could be used for future reference, linking across pages and things like that is something I never thought of doing. It’s just a great fix, possibly for more than just the Previous Page Number, I can’t think of any now.

    This was a greater problem than what I was working on at the time, even though it was such simple thing to want, but hard to initiate.

    I’m going to have a moment for myself, to pat myself on the back and I’m sorry for going off topic… but…

    I was working on having 8 different alternating (change to match the text on the current page) running heads (four on the left and four on the right page).

    This does not work so great when you have 3 running head variables on one line, one aligned to the left, the other two tabbed over with a right tab, when the variable hit a long string of text, the tabs got all screwed up… again another tab problem I found with CS3.

    However, I solved it fairly quickly, first I inserted two tabs after the first variable, as with two windows open (another tip I picked up from here, viewing the master pages and the page with the change on it at the same time). I noticed that the tab stop that I put in controlled the width of the variable area!

    So one tab was to push that area back, and the other was to align the second variable to the right, then I needed to do it again for my next variable, two tabs in, one as a control and the other to right align the 3rd variable.

    Even with that, different variable lengths in my text resulted in screwed up text in the running head. Funny enough though (I wasn’t laughing, it was a ha ha funny at all), the running heads on the right hand page worked no problem, the left tabs kept everything in place. So I was like why don’t RIGHT TABS work for variables in running heads!!! ARRRGGHHHH!!!! I said to myself.

    Then I had an epiphany, I realised I didn’t need tab stops at all, I don’t need to tab, I don’t need spaces, I don’t need nested character styles (yes each variable changed from bold to roman to bold, so I made a nested style for the craic).

    Anyway, my epiphany, put the running heads in a table, 2 rows, 3 columns, cells don’t have a problem aligning variables to the right, but tabs do… I’m so clever.

    And that was big triumph of the week… I may get the coveted chutzpah award for this solution, but it works. Is it bad though that I just put the table on the left hand page and not the right, I was too lazy to do it and I didn’t need it, ah well, it works, so I’m happy.

    Sorry for going off topic, but people should know this and I’m offering it up as an experience, a problem and a solution.

  • David Blatner says:

    Eugene, putting the variables in a table in order to position them where you want them reminds me of the old HTML trick to build tables on a page for accurate positioning. So it’s very “retro” of you, but it sounds like it worked great! :)

  • Eugene says:

    I know it wasn’t anything revolutionary, it was just frustrating trying to get the tabs to work, for what should have been something simple… sometimes going retro is the only way to go. (smiley face here)

  • Cari Jansen says:

    b.t.w. this trick has been working for a long time :) (I wrote up it up as a tip for it back in InDesign CS – http://carijansen.com/tips/027/index.php ), great to see all the variants on it :)

  • Is it also possible to point to the “page after the Next Page” Number with a marker in InDesign?

  • Michael Anikst says:

    Is it also possible to have current/next page number on the same page?

  • David Blatner says:

    Martijn: No, I don’t think there is any way to add that kind of page number. (Though you probably could with a script.)

    Michael: The only way to do that would be to have a story that threads from one page to the page after it. Then you could tie the “next page” character to that story. Can you give me an example of why you’d need that?

  • John Walker says:

    Just wanted to say thanks for such a great tip. I thought my install had a bug until I read this.

  • krishna says:

    its good one!!! I’m looking out for this option for a very long time. thanks dave

  • I’m designing a french folded book (where the paper is folded and bound), this puts the following page on the same sheet, so i’d like to create have a current page and next page on the same sheet on my master page.

    So far I haven’t found any tricks to do so.

  • baris kuran says:

    i tried it in my own way, and also i downloaded the the file that u mentioned above. this solutions doesnt work on cs4.

  • Johannes says:

    unfortunately, this won’t work in CS4.
    but only on master pages, it will work on the actual spreads instead.
    very sad adobe put this off (know, it’s a bug, isn’t it?)

  • karl rick hunter says:

    I would like to confirm Johannes observation. Is there a way to get around in CS4? I cant possibly use it if it cannot be done on the master page.

  • Sam says:

    If anyone knows a CS4 version of this trick I would be extremely grateful.

  • Vince says:

    Put it on the master page and on a seperate layer, this master page contain only this troublesome issue, do your other master based on it, at the end of your publication composition lock all layers except this one, select all your pages and averide all masterpage items!! et c bon!! voila!

    the only solution i see viable that is allowing me to use it as i used to in cs3.

    hope this help
    V

  • Tys says:

    Vince,

    I am trying this in CS4 but it doesn’t work.
    I tried it on another layer on the masterpage but it still won’t show previous page. It works ok if I do it in the document itself. Maybe I’m missing something?

  • bo says:

    It’s doesn’t works in CS4, who can help me, pls ^^

  • Alright firstly this is a hack; but it works, assuming the same conditions apply as in the explanation above (the previous page number is on the right hand page of a double-page spread).
    Step one: Don’t use the previous page number character. Use a current page number character. Put it in its own text frame and align it right*.
    Step two: Put it on the far left of the left hand page of the spread, and then extend the text frame border to the right until it’s the width of the spread. In other words, make the text frame so wide that its center point lands on the previous page.

    * A possibly better solution to aligning the page number right would be to type a tab character prior to the page number, highlight all the text in the text box, and then use the tabs palette to set a decimal-aligned tab placement wherever you want the number to show up.

  • Nipat Paiboonponpong says:

    For CS4, similar to the old trick (stretching the text frame out of page border),
    but instead of doing it in one double-page master, do it separately in
    two single-page masters.

    http://img5.imageshack.us/img5/6270/pagenumbers.jpg

  • Arthur says:

    Hi all, unfortunately David’s last solution also doesn’t work on the masterpage in CS4. It works in the actual document. Seems it’s a nasty bug.. major bummer.. :(

  • Arthur says:

    Hi all, me again. Same goes for Nipat’s solution.

  • Nipat Paiboonponpong says:

    I don’t understand why it doesn’t work for you.
    Many people do it this way.

    I’ve just tried it just to check and it still worked even with
    current update (v6.0.4)

    May be because you did it all in a two-page master page
    (which definitely won’t work in InD CS4) ?

  • Mel says:

    Dave
    it doesn’t work!
    Thanks Dave

  • P.A. says:

    it works! thanks!

  • Gabriel says:

    wouldnt it be so much better if you could just use an expression – something like current page +1 or current page -1???

    is this possible?

  • @Gabriel: Nope… sorry! Cool idea, though.

  • Guillermo says:

    Old thread… still usefull!

    Thanks from Finland

  • This topic should be turned into its own eBook, apparently!

  • Funny, we got the same question on our own InDesign User Group forum and found out the .inx file works with CS 3 and CS5 but you have to use the “Blattner Page Hack” for CS 4. Apperently the boys and girls at Adobe fixed it. Another great reason to upgrade to CS5 ;-)

  • MuveeMax says:

    Finally thanks to Michael, I followed the correct tip for Cari and succeeded. Thanks all :)

  • Lara says:

    David Blatner (and anyone else who’s interested): You’d asked for an example of why a current/next page number would be needed on the same page. Here’s my challenge:

    I’m working on a “Choose Your Own Adventure” book where various pages have plot choices. Each different choice lands you on a different page. Fine, that all works with no problem.

    The problem is that when you reach a “The End” page, there need to be ways to navigate through other stories. I’ve provided one option in a “Back to Start” button that takes you back to page 1, but they also want us to offer Previous page/Next page links on each page.

    This means you have the current page number, previous page number, and next page number, all on the same page.

    If anyone has a solution to this, I would love to hear it! These books are for 7 to 12-year-olds and are very popular. I am not about to do this manually, page by page, on a 108-page book. Help — how can I do this on the master page?

    This particular version will be an interactive pdf on a website when it’s finished, so I’m displaying it a single page at a time — not with two-page spreads. So there’s only one master page for the story pages.

  • Many thanks fo you …
    I was seaching for this option for a long time…
    I can say I am ver happy that al last I found thant with you
    thanks again

  • raaj says:

    I didn’t get solution for the same, it is not very clear, thanking you.

  • Alex says:

    Thanks for the tip! Very helpful.

  • Linda says:

    How do I change the page number from 1 to say 151 or any other number and then reflow the pages with these new page numbers. I really don’t want to create many master pages to just change the page number? I am new to InDesign and have tried to find this information no such luck yet!

  • Umran says:

    Thank you, thank you, thank you and THANK YOU :)

  • Mike Rankin says:

    To reduce spam, comments have been closed for this post. If you want to start a related discussion, head over to the Forums and create a new topic.

  • >