2 page numbers for each two-column page

I'm working on a book, and I have my document in a landscape two-column format. I used to be able (with a formula) to have two page numbers in each two-column page using Microsoft Word —one page below each column—. Can I do the same in Pages?

MacBook Pro 13" 2.4 GHz Intel Core 2 Duo, Mac OS X (10.6.3)

Posted on Oct 12, 2010 9:30 PM

Reply
17 replies

Oct 16, 2010 7:01 AM in response to goldfilm

Is it so difficult to read carefully ?

I wrote :

If you are OK to insert a two cells table at the bottom of every page, I guess that you will accept to *_insert a text block masking the footer area._*


I think that I will be able to insert the pages numbers in such boxes.
It would be more complicated than putting them in footers because it will be necessary to locate the text box which is the lower one in the page (I guess that you may have other ones).


I thought that it was clear that I wasn't asking you to insert text boxes in the footers but above them.
A text box inserted in the footer would be very uneasy to fill

User uploaded file

I hope that with this screenshot, you will understand.
I put a red background in the footer which contain the centered string "in the footer".
Above it is the text box with a transparent green background (so the mix red + green give a brown for the footer.
Here the box is wrongly located. Its top border must be at the same coordinate than the footer's one (or one pixel lower).
This way, the text will flow according to the footer setting.

You may go to my iDisk :
<http://public.me.com/koenigyvan>

and download :
For_iWork:iWork '09:for Pages09:insert_two_pages_numbers_perpage.zip

It contains :

the script,
a sample Pages document in which I inserted some text boxes.
I didn't inserted them on every pages and I treated the doc with a slightly modified script with doesn't quitif there is no box for page numbers in a physical page.
You will see that we may define the tab stop of different locations.

The folder contain also some chronological backups of the sample file created by my Autosaved script which I just revised.

It's available on my iDisk as :

For_iWork:iWork '09:autoSave_iWork.zip

Yvan KOENIG (VALLAURIS, France) samedi 16 octobre 2010 16:01:46

Oct 12, 2010 11:06 PM in response to goldfilm

goldfilm,

To do this in Pages, you would use Portrait Orientation and in the Document Inspector, Document Margins section, select "Facing Pages". What you lose in the Pages method is the ability to simply place graphics that span the pages. If this is a serious issue for you, you would probably want to go back to landscape orientation and forego the automatic page numbering. Otherwise, the most common workaround for graphics spanning pages is to place them on both pages.

Jerry

Message was edited by: Jerrold Green1

Oct 13, 2010 8:54 AM in response to goldfilm

You may achieve your goal with an AppleScript but it will introduce at least two requirements which may be annoying :
you must introduce a section break at the end of every page.
You must insert a 'align to right' tab stop at the right edge of the footer.
This way, if I remember well, the script will be able to state that footer of page n is different of page n-1.
Then, it will be able to insert the string :

(pageNum * 2)-1 tab (pagenum * 2)
in the different footers achieving what you wish.

Yvan KOENIG (VALLAURIS, France) mercredi 13 octobre 2010 17:54:25

Oct 13, 2010 9:53 AM in response to KOENIG Yvan

Here is a quick and dirty script doing the trick.

--

tell application "Pages" to tell document 1

set nb_sections to count sections
set nb_pages to count pages
if nb_sections is not nb_pages then
set missing to nb_pages - nb_sections
error "" & missing & " section breaks between pages are missing !"
end if
set ma_chaine to "page #"
repeat with ns from 1 to nb_sections
set le_pied to ma_chaine & (ns * 2) - 1 & tab & ma_chaine & (ns * 2)
tell section ns
if ns > 1 then set reuse headers and footers to false
if ns div 2 = 0 then
set even footer to le_pied
else
set odd footer to le_pied
end if
end tell
end repeat
end tell
--


Yvan KOENIG (VALLAURIS, France) mercredi 13 octobre 2010 18:53:27

Oct 13, 2010 9:26 PM in response to goldfilm

Thanks all! Is there any way to use a "pagenum" formula in the footer? In Word I used the following:

Left column:
={page {page-1}*10}

Right column:
={page {page-1}*11}

I appreciate the script, but I don't think I want to add sections in every page. It's a 200-page document (a book!). I need every page to look like a real book 🙂

I wish it would be easier...

hold on, what if I insert a one-row-table inside the footer? Could I use a formula there?

Oct 14, 2010 12:18 AM in response to goldfilm

The problem isn't really the one described by peterbreis.
It's that a table has no way to extract the page_number of the page in which it is stored.
If you are OK to put a two cells table at bottom of every page, I may try to build a new version of my first script which would insert the numbers in the tables.

Are you using other tables in the document ?

Yvan KOENIG (VALLAURIS, France) jeudi 14 octobre 2010 09:17:56

Oct 14, 2010 1:47 AM in response to KOENIG Yvan

Hello

I checked what is available in the Pages's Applescript dictionary.
There is no provision to rule the contents of tables.

All is not lost.

If you are OK to insert a two cells table at the bottom of every page, I guess that you will accept to insert a text block masking the footer area.

I think that I will be able to insert the pages numbers in such boxes.
I would be more complicated than putting them in footers because it will be necessary to locate the text box which is the lower one in the page (I guess that you may have other ones).

Yvan KOENIG (VALLAURIS, France) jeudi 14 octobre 2010 10:47:39

Oct 14, 2010 3:06 AM in response to KOENIG Yvan

Here is the script.

--

--[SCRIPT inserttwo_pages_numbers_perpage]
(*
Yvan KOENIG (VALLAURIS, France)
2010/10/14
*)
on run
local ma_chaine, nb_pages, num_pages, lesblocstexte, le_bloc, le_bas, un_bloc, un_bas, le_pied
set ma_chaine to "page #"
tell application "Pages" to tell document 1
set nb_pages to count of pages
repeat with num_page from 1 to nb_pages
(*
Extract the text boxes of one page *)
set lesblocstexte to (every text box whose page number of containing page is num_page)
(*
Init two variables *)
set {le_bloc, le_bas} to {"", 0}

if lesblocstexte is not {} then
(*
Extracts the lower text box in the page *)
repeat with un_bloc in lesblocstexte
set un_bas to (vertical position of un_bloc) + (height of un_bloc)
if un_bas > le_bas then
set le_bas to un_bas
set le_bloc to un_bloc
end if
end repeat
end if
if (le_bloc is "") or vertical position of le_bloc < 540 then
(*
Issue an error if there is no text box or if the lower one isn't sufficiently low to be used *)
error "There is no text box for page numbers in page #" & num_page
else
(*
Builds the contents of the text box and insert it in the box *)
set le_pied to ma_chaine & (num_page * 2) - 1 & tab & ma_chaine & (num_page * 2)
set object text of le_bloc to le_pied
end if
end repeat
end tell

end run
--[/SCRIPT]
--


Don't forget to define a tab stop in the text boxes.

Yvan KOENIG (VALLAURIS, France) jeudi 14 octobre 2010 12:06:03

Oct 14, 2010 1:14 PM in response to goldfilm

--=====

Save the script as a Script: insert two_pages_numbers_perpage.scpt

Move the newly created file into the folder:
<startup Volume>:Users:<yourAccount>:Library:Scripts:Applications:Pages:
Maybe you would have to create the folder Pages and even the folder Applications by yourself.

Open the document with Pages and leave it at front.
Go to the Scripts Menu, choose Pages, then choose "insert two_pages_numbers_perpage"
The script will do its duty.

--=====

The Finder's Help explains:
To make the Script menu appear:
Open the AppleScript utility located in Applications/AppleScript.
Select the "Show Script Menu in menu bar" checkbox.
Under 10.6.x,
go to the General panel of AppleScript Editor’s Preferences dialog box
and check the “Show Script menu in menu bar” option.

--=====

We insert a tab stop in a text box exactly as we do everywhere.

User uploaded file

Yvan KOENIG (VALLAURIS, France) jeudi 14 octobre 2010 22:13:46

Oct 16, 2010 9:50 PM in response to goldfilm

You could write the book on pages of the correct size, not 2 columns on one page. Then you could use the automatic page numbering. If you want to print on US Letter and want one page being half US Letter you can create a custom paper of that size. Write your book. When finished and save you also save it as PDF. Get Create Booklet (Book lightning is another choice) and let the program print out your book with two pages on one US Letter page. It will also imposition the pages for you.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

2 page numbers for each two-column page

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.