index file - sorting items

C

Cees Mulder

I am making an index file (MS Word 2007) where I sort out Article numbers.
In the document, I create an Index file named "b" comprising e.g. the
following items:
{XE "Art. 75" \f \b}
{XE "Art. 135" \f \b}
{XE "Art. 4" \f \b}
{XE "Art. 16" \f \b}
When the Index is generated, it shows:
Art. 134....page number
Art. 16....page number
Art. 4....page number
Art. 75....page number
I can understand why the sequence is as it is, but it is not what I desire.
The Index should look like - sorting the "numbers" only:
Art. 4....page number
Art. 16....page number
Art. 75....page number
Art. 134....page number
All items in the index start with "Art. " and this should always be visible.
The problem could be solved if the Index file could "overlook" the "Art. "
and ONLY sort the numbers...
My question is, is this possible...? And if so, how to proceed?
Thank you for your responses.
 
R

Robert M. Franz [RMF]

Hello Cees

Cees said:
I am making an index file (MS Word 2007) where I sort out Article numbers.
In the document, I create an Index file named "b" comprising e.g. the
following items:
{XE "Art. 75" \f \b}
{XE "Art. 135" \f \b}
{XE "Art. 4" \f \b}
{XE "Art. 16" \f \b}
When the Index is generated, it shows:
Art. 134....page number
Art. 16....page number
Art. 4....page number
Art. 75....page number
I can understand why the sequence is as it is, but it is not what I desire.
The Index should look like - sorting the "numbers" only:
Art. 4....page number
Art. 16....page number
Art. 75....page number
Art. 134....page number
All items in the index start with "Art. " and this should always be visible.
The problem could be solved if the Index file could "overlook" the "Art. "
and ONLY sort the numbers...

the problem is not the "Art. ", but that the index treats/sorts its
entries as character strings. You can create entries w/o the "Art. ",
but that will not solve the problem.

The only way I see is to include leading zeros in the article numers:
"Art. 004" is sorted before "Art. 016", etc.

HTH
Robert
 
C

Cees Mulder

Dear Robert,

Thanks for your reply - I had thought of this solution too - but the leading
"zero's" do not look so very "nice".
Anyhow, I tried this and then tried to set the leading "00" as hidden text -
but this did not work because the field codes are already hidden - and
"double" hidden is not possible...
I have a number of books here on my desk with perfectly sorted lists where
all the items start with "Art." or with "Rule" in the manner I desire. Or
even where case law numbers are perfectly sorted like "T19/87" before
"T105/87" and which is followed by "T12/89" if you see the problem (first
sortting for the year - then for the sequence number).
There must be other users doing this...?
There must be a solutuin for this in MS Word...?

My problem would already have been solved if I could include "Art. " in the
definition of my Index File such that each item starts with "Art. " followed
by a perfectly sorted list... This would make indexing an easier job. Is that
possible...?

Thank for any response, Cees
 
R

Robert M. Franz [RMF]

Hello Cees

Cees said:
Thanks for your reply - I had thought of this solution too - but the leading
"zero's" do not look so very "nice".

it's the only way I see (FWIW :)) to get there without manual or
programmatic intervention.


[..]
I have a number of books here on my desk with perfectly sorted lists where
all the items start with "Art." or with "Rule" in the manner I desire. Or
even where case law numbers are perfectly sorted like "T19/87" before
"T105/87" and which is followed by "T12/89" if you see the problem (first
sortting for the year - then for the sequence number).
There must be other users doing this...?
There must be a solutuin for this in MS Word...?

I've never played with TOA fields (they're next to unknown in the
language editions of Word I'm using, or in the document types created
therein), but maybe they can help here.

My problem would already have been solved if I could include "Art. " in the
definition of my Index File such that each item starts with "Art. " followed
by a perfectly sorted list... This would make indexing an easier job. Is that
possible...?

Well, you could create the index entries w/o the "Art. ", then manually
unlink the INDEX field and add the missing string to each line. This can
be done with a Find/Replace run. And it's possible to put that, and the
index unlinking, into a macro.

0.2¢
Robert
 
C

Cees Mulder

Eventually, there appears to be a simple solution to the problem...
It is too simple that I am surprised that nobody came up with that suggestion.

Let me go back to my original question where I indicated that I want to sort
the following items:
{XE "Art. 75" \f \b}
{XE "Art. 135" \f \b}
{XE "Art. 4" \f \b}
{XE "Art. 16" \f \b}
When the Index is generated, it shows:
Art. 134....page number
Art. 16....page number
Art. 4....page number
Art. 75....page number
which is not what I desire...

But a friend told me that adding a ";" behind the reference followed by how
you want to sort is all that is necessary. Thus, in order to sort in the good
order one should add:
{XE "Art. 75; 075" \f \b}
{XE "Art. 135; 135" \f \b}
{XE "Art. 4; 004" \f \b}
{XE "Art. 16; 016" \f \b}
When the Index is generated, it shows:
Art. 4....page number
Art. 16....page number
Art. 75....page number
Art. 134....page number

As simple as that...

Robert: thanks anyway for you comments and advise...!

Robert M. Franz said:
Hello Cees

Cees said:
Thanks for your reply - I had thought of this solution too - but the leading
"zero's" do not look so very "nice".

it's the only way I see (FWIW :)) to get there without manual or
programmatic intervention.


[..]
I have a number of books here on my desk with perfectly sorted lists where
all the items start with "Art." or with "Rule" in the manner I desire. Or
even where case law numbers are perfectly sorted like "T19/87" before
"T105/87" and which is followed by "T12/89" if you see the problem (first
sortting for the year - then for the sequence number).
There must be other users doing this...?
There must be a solutuin for this in MS Word...?

I've never played with TOA fields (they're next to unknown in the
language editions of Word I'm using, or in the document types created
therein), but maybe they can help here.

My problem would already have been solved if I could include "Art. " in the
definition of my Index File such that each item starts with "Art. " followed
by a perfectly sorted list... This would make indexing an easier job. Is that
possible...?

Well, you could create the index entries w/o the "Art. ", then manually
unlink the INDEX field and add the missing string to each line. This can
be done with a Find/Replace run. And it's possible to put that, and the
index unlinking, into a macro.

0.2¢
Robert
--
/"\ ASCII Ribbon Campaign | MSFT |
\ / | MVP | Scientific Reports
X Against HTML | for | with Word?
/ \ in e-mail & news | Word | http://www.masteringword.eu/
.
 
R

Robert M. Franz [RMF]

Hello Cees

Cees said:
Eventually, there appears to be a simple solution to the problem...
It is too simple that I am surprised that nobody came up with that suggestion.

Let me go back to my original question where I indicated that I want to sort
the following items:
{XE "Art. 75" \f \b}
{XE "Art. 135" \f \b}
{XE "Art. 4" \f \b}
{XE "Art. 16" \f \b}
When the Index is generated, it shows:
Art. 134....page number
Art. 16....page number
Art. 4....page number
Art. 75....page number
which is not what I desire...

But a friend told me that adding a ";" behind the reference followed by how
you want to sort is all that is necessary. Thus, in order to sort in the good
order one should add:
{XE "Art. 75; 075" \f \b}
{XE "Art. 135; 135" \f \b}
{XE "Art. 4; 004" \f \b}
{XE "Art. 16; 016" \f \b}
When the Index is generated, it shows:
Art. 4....page number
Art. 16....page number
Art. 75....page number
Art. 134....page number

looks highly undocumented AFAICT, but glad you found a working way.

Thanks for sharing!
Robert
 
S

Suzanne S. Barnhill

That is surely undocumented and extremely useful. I wonder if it's possible
to do it with something other than numbers. It would certainly help with the
issues of sorting numeric items into alphabetical order and vice versa (for
example, where "2" needs to be alphabetized as if it were "two").

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org
 

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