Customized Layout for TOC

P

pswiderski

I'm creating a TOC that needs to have both the Heading 2 and Heading 3 styles
on the same line. Is this possible?
Example -
The body reads like this

Article I
Officers and Elections (these two lines are style = Heading 1)

Presiding Officer (this line is style = Heading 3)

Rule 1.01 The presiding officer shall be the president, blah, blah, blah
(the words "Rule 1.01 are style = Heading 2)

I need the TOC to read

Article I
Officers and Elections

Rule 1.01 Presiding Officer ...........................3
Rule 1.02 President Pro Tempore..................4

Is it possible to have both Heading 2 and 3 on the same line?
I've gone to the point, by manually altering the field code, that I have
Heading 1 correct and Heading 2 correct, but Heading 3 is on the line above
Heading 2 (because it appears in the text before Heading 2).

Maybe I need to use TC instead of TOC for Heading 3. If so, please explain.

Thanks for your help.
 
P

pswiderski

Wow. What a great article. Thanks.
I'm pretty sure the last topic is going to help me tremendously, but I'll
post again if I can't figure it out.
p
 
P

pswiderski

Well, I guess I don't understand completely.
I create three new styles - Section Title, Rule Title and Actual Rule

Article I
Officers and Elections (assigned Section Title)

Presiding Officer (assigned Rule Title)

Rule 1.01 (assigned Actual Rule)


I places the following TC fields in the body.
ARTICLE I
OFFICERS AND ELECTIONS {TC "ARTICLE I" \n} {TC "OFFICERS ADN ELECTIONS" \n}

PRESIDING OFFICER OF THE SENATE {TC "PRESIDING OFFICER OF THE SENATE"}

Rule 1.01. {TC "Rule 1.01" \n}

and I created
{STYLEREF " Section Title"}

{STYLEREF "Actual Rule"} {STYLEREF "Rule Title"\1}

at the top of my page.
I guess I don't understand how to get this to act as a TOC, (or to get these
STYLEREF into the TOC field) or have a leader and page numbers after the Rule
Title.
I also need to reference the "Rule Title" that is directly above the "Actual
Rule" and not the one below it. I was trying to do this with the switch \1,
but it doesn't seem to work.

Any advice would be greatly appreciated.

p
 
S

Suzanne S. Barnhill

In order to get your TOC to pick up TC fields, you must check the box for
"Table entry fields" in the TOC Options dialog. You'll probably also need to
clear the check boxes for "Styles" and "Outline levels," given that you're
using built-in Heading styles (which have TOC outline levels by default) for
your headings.
 
S

Suzanne S. Barnhill

Thanks for that, Jay. I had completely forgotten about that part until I
recently revised the article, and I'd already forgotten about it again!
 
J

Jay Freedman

There's more to it than that.

The TC fields for "ARTICLE I" and "OFFICERS AND ELECTIONS" are fine, although
you might want to make them proper case instead of all caps. Also, unless you've
used an automatically numbered style for those paragraphs, you can omit the \n
switches because they aren't doing anything for you.

The TC fields for the rule number and section title should not be there, and the
StyleRef fields do not go at the top of the page. Instead, somewhere in the
paragraph following each rule number, insert a nested field with this content:

{TC "{StyleRef "Actual Rule"} {StyleRef "Section Title"}" }

Use Ctrl+F9 to create each matched pair of field markers, and be sure to place
the double quotes where I've shown them. While you're working on this, have the
nonprinting characters displayed by clicking the ¶ button, because TC fields are
automatically made hidden.

Repeat the same TC field (by copy/paste or by making the field into an AutoText
entry) in each rule paragraph. When you update fields (Ctrl+A, then F9), the
StyleRef fields will take as their values the text of the most recent occurrence
of the named styles -- even if there are more than one such occurrence on the
same page. You don't need any \l switches to make this work.

Another consideration: If the rule number is just the beginning of a larger
paragraph, make the Actual Rule style a character style instead of a paragraph
style. That way you can apply the Actual Rule style to just the "Rule x.yy"
text, leaving the rest of the paragraph in Normal or Body Text or whatever
you're using. The formatting can be the same or different; the only thing the
StyleRef field looks at is the style's name.

Finally, as Suzanne said, make sure the TOC options are set to pick up only TC
fields and not heading styles or outline levels.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so all
may benefit.
 
P

pswiderski

I understand better now, but it still isn't working for me.

Here's my steps. I've limited this to messing with one of the three styles
because I'd like to get that to work first and then worry about trying to get
all three in the TOC. So, I'm just referencing the "Rule x.yy" or "Actual
Rule" style here.

I set a style for "Rule x.yy". It is called "Actual Rule" and is a character
style based on the "default paragraph font" .
I placed my curser just after the text "Rule 1.01" and performed the
following key strokes:
Ctrl + F9
Typed: TC
Ctrl + F9
Insert | Field...
Selected STYLEREF and Actual Rule, clicked OK.

The results appear in the body of the document as:
{TC {Rule 1.01} } or if I Alt+F9 they appear as {TC {STYLEREF "Actual Rule"
\*MERGEFORMAT} }.

I go to the top of the document.
Go to Insert | Reference | Index and Tables
The TOC window opens and I select Options. I deselect the Styles and Outline
check boxes and select the Table Entry Field check box.

It goes back to my document and the TOC field reads as follows:
Error! No table of contents entries found. (the code reads: {TOC \f\p" "
\h\z})
I look at my TC code again and it has deleted the STYLEREF command. It
appears like this: {TC }

Please note: I tried many other ways. I typed the TC field out exactly like
you recommented with the " ". I placed it above the "Rule 1.01" paragraph.
Below this paragraph. Inside this paragraph.

Nothing seems to be working.

Thank you both for your advice. I really appreciate you taking the time to
explain this.

p
 
S

Suzanne S. Barnhill

Sometimes quotes aren't required around fields used as field arguments, but
this may not be one of those cases. Try using this syntax:

{ TC "{STYLEREF "Actual Rule" > \*MERGEFORMAT}" }.

Also note the first of the "Notes" at the end of
http://sbarnhill.mvps.org/WordFAQs/StyleRef.htm. From your description it's
not clear whether you're putting the field in the same paragraph or not.
 
P

pswiderski

Wonderful! It worked.
I was able to add the other two styles in also. Although the "Article" line
and the "Officers" line are the same style (Section Title), I used to
seperate TC fields because I need them to be in the TOC on seperate lines.
Was that necessary? Or, OK?

ARTICLE I 1
OFFICERS AND ELECTIONS 1
Rule 1.01 PRESIDING OFFICER OF THE SENATE 1
Rule 1.02 PRESIDENT PRO TEMPORE 2

Thank you both so, so much. I'm going to try to continue this through the
whole document and see if I can get the results I need. I tried to save the
field as a AutoText but it didn't pick up the entire field. Is this because
it's hidden text? Is there a way around this?

Here are the obsticles I see, if you have any more advice for me.
ARTICLE I 1 (I need to get rid of the page number next to it.)
OFFICERS AND ELECTIONS 1 (I need to get rid of the page number next to it.)
And, both of these lines need to be centered.
Rule 1.01 PRESIDING OFFICER 1
and
Rule 1.02 PRESIDENT PRO TEMPORE 2 (I need to right align page numbers and I
need a tab leader.)

Again, thank you. You've been a huge help.
p
 
P

pswiderski

Ah! I figure out how to turn the page number off within the TOC field but it
turns it off for all lines because they are all level 1. Need to figure out
how to turn them off for all except the "Rule Title" portion.
p
 
J

Jay Freedman

In the TC fields for the article and officer entries, include a \n switch like
this:

{TC "Section Title" \n}

(Yes, I know I told you before to get rid of them. I was looking at the wrong
help topic when I looked that up. Sorry.)

But you do have to remove the \n switch from the TOC field to allow page numbers
for the "Rule Title" TC fields.
 
P

pswiderski

Solutions for the obsticles I had listed below.(I MADE THESE A HEADING 1 STYLE, AND MADE HEADING 1 A LEVEL 2 FOR TOC. THIS
ALLOWED ME TO FORMAT THE TOC LEVEL 2 DIFFERENTLY THAN THE TC FIELDS, WHICH
SEEM TO DEFAULT TO TOC LEVEL 1)(SOLVED BY ALLOW THEM TO DEFAULT TO TOC LEVEL 1 AND FORMATTING IT TO BE
JUSTIFIED).
IN THE TOC FIELD CODE I ADDED \N 2-2 TO GET RID OF THE PAGE NUMBERING FOR
TOC LEVEL 2 AND ADDED A TAB BETWEEN THE " " AFTER THE \P, LIKE THIS \P "TAB
MARK".

This is really looking great.
Thanks again for your help.

Any suggestions on a good book or website to learn more about the fields you
can insert into Word documents and the switches you can use to customize them?

Thanks.
p
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top