Let’s tackle question number 2 first:
If the Illustrator file of the map contains the gallery numbers inside it, then you cannot change them in InDesign. You cannot edit Illustrator files in InDesign. So I would suggest that you add the numbers on the map in InDesign instead. That is what I assume you’ll do in this answer.
Cross-references
The easiest way to get the result you’re after is, I believe, to use cross-references. Cross-references are a way to refer to or quote some type of content from one place in another place without having to type it all out manually. They consist of two parts: a source and a target. Each of these can be subdivided into a marker and content:
- the source marker is an invisible marker in the document which identifies the location of something you want to refer to elsewhere
- the source content is the content you wish to refer to elsewhere, most commonly a paragraph of text
- the target marker is an invisible marker in the document placed in the location where you need to refer to the source
- the target content is the string of text which actually appears in the document at the place where you refer to the source
The source
In your case here, your source would be the initial list of galleries with their arbitrary numbers, your pseudo-TOC. Since you say these are arbitrary, I’m going to assume that they’re not ordered into a numbered list (if they are, the following steps will be different). Here is an example of what I imagine such a list might look like, in simplified form:
This text frame consists of one paragraph with the style Gallery list header and four paragraphs with the style Gallery list item. These contain a number, a period, a tab character, and a highly inventive and original name for each gallery.
The targets
Now let’s say you’re on page 32, and this is where the spread for Gallery two (with the number 8) starts; you need to have the number and the name of the gallery as the header on this page.
Let’s insert a reference to the corresponding paragraph in the gallery list and include the entire text of the paragraph as it is as the target content. To do so, open the Window -> Type and Tables -> Cross-References panel and click on the “Create New Cross-Reference” button at the bottom:
In the New Cross-Reference dialog that pops up, make sure Link To is set to “Paragraph”. On the left is a list of paragraph styles defined in the document; choose “Gallery list item”. This brings up a list of all paragraphs in the document that have this style applied, and you can easily find and choose the right one. Under Cross-Reference Format (that’s the bit that defines what text the target content contains), choose “Full Paragraph”:
If you click OK now, you’ll see that the text “8. Gallery two” has been inserted (with a tab after the period, as in the pseudo-TOC).
The map
On the map, I imagine you only want the number of the gallery, not the name. This is quite easy to do.
Make a little text frame in the right position on the map (i.e., at the spot where “Gallery two” is located). Create a new cross-reference just like above, but this time, instead of choosing “Full Paragraph” in the Cross-Reference Format dropdown, click the little pencil icon next to it. This lets you define a custom target content.
In the dialog that pops up, click the “+” icon bottom left to duplicate the current style. Give it a logical name (I’ve called it “Gallery number”). In the Definition field, which is a free-text field where you can mix a limited subset of code with plain text, change the content to
<fullPara delim="." includeDelim="false"/>
(You can also click on the “+” icon on the right and choose “Partial Paragraph” from the dropdown menu, and then add in the period manually.)
This cuts off everything in the source content after the first instance of the character “.”. Since the gallery list has a period after the number, this boils down to cutting off everything after the number, so the target content ends up being just the number, “8”.
If your layout uses something else to delimit the numbers from the gallery names in the list, replace the period in the code here with whatever comes right after your numbers.
Updating numbers
If you need to update the number (or the name for that matter) of various galleries later on, you now only need to do this in one place: the pseudo-TOC.
As soon as you change anything in the source content, your existing cross-references will become unreferenced, noted with a yellow “⚠️” (warning triangle). To update them, simply click the “Update Cross-References” button: