J
jon.hertzig
Just want to toot my own horn ... been wrastling with a problem that
was reported in several outdated posts: how to get a header to show
"breadcrumbs" in a complex document, eg so that it says "Heading 1 >
Heading 2 > Heading 3 ..." for whatever's on the current page (I have
a document with 8 levels of header and was wanting to show the
navigation on each page).
The problem is that the Styleref field searches for the first occurence
of a style (eg, Heading) up or down in the entire document, not just
the current page. So if you are on a page that only goes up to H3, it
would include the H4 from several pages hence in the document. There's
no way to use the PageRef or other fields to pick up the page number of
the StyleRef that it finds... but here's how I solved it:
Creating a character style that has no attributes, HeadChar, and
applying it with global search-replace to all headings. Then searching
for the first 'HeadChar' from the bottom up (\l), and if it matches a
style level, insert that style with all the previous levels. So, for
example, for level 3: {IF {STYLEREF "Heading 3" \n \l} = {STYLEREF
"HeadChar" \n \l} "{STYLEREF "Heading 1" \n \l} {STYLEREF "Heading 1"
\p \l} > {STYLEREF "Heading 2" \n \l} {STYLEREF "Heading 2" \p \l} >
{STYLEREF "Heading 1" \n \l} {STYLEREF "Heading 1" \p \l}" }
It works!
was reported in several outdated posts: how to get a header to show
"breadcrumbs" in a complex document, eg so that it says "Heading 1 >
Heading 2 > Heading 3 ..." for whatever's on the current page (I have
a document with 8 levels of header and was wanting to show the
navigation on each page).
The problem is that the Styleref field searches for the first occurence
of a style (eg, Heading) up or down in the entire document, not just
the current page. So if you are on a page that only goes up to H3, it
would include the H4 from several pages hence in the document. There's
no way to use the PageRef or other fields to pick up the page number of
the StyleRef that it finds... but here's how I solved it:
Creating a character style that has no attributes, HeadChar, and
applying it with global search-replace to all headings. Then searching
for the first 'HeadChar' from the bottom up (\l), and if it matches a
style level, insert that style with all the previous levels. So, for
example, for level 3: {IF {STYLEREF "Heading 3" \n \l} = {STYLEREF
"HeadChar" \n \l} "{STYLEREF "Heading 1" \n \l} {STYLEREF "Heading 1"
\p \l} > {STYLEREF "Heading 2" \n \l} {STYLEREF "Heading 2" \p \l} >
{STYLEREF "Heading 1" \n \l} {STYLEREF "Heading 1" \p \l}" }
It works!