Totals...

V

vk

Hello!

I apologize if my queation was answered before, I have not found answer
yet.

I have rather dig document (PhD thesis), which contains list of
references. It is numbered just as numbered list, though it has own
style, say "References list". I'd like to insert a field which display
total numer of items in that list.

Another big question. I need to count total number of figures and
tables in the document. Their captions created using Insert/Caption. Is
there a way to calculate sum of those items?

Thank you.
 
S

Stefan Blom

Starting from the bottom, with your second question: Word captions
make use of SEQ fields. You can reference those numbers via bookmarks.

Here's how:

Bookmark the last occurrence of a Figure caption, as well as the last
occurrence of a Table caption. Below, I'm assuming that those
bookmarks are called bookmark_name_1 and bookmark_name_2 respectively
(but you can choose more descriptive names).

Then, at the location where you want the sum, insert the following
field:

{ = { SEQ Figure \c "bookmark_name_1" } + { SEQ Table \c
"bookmark_name_2" } }

Of course, this assumes that you aren't restarting caption numbering
after (say) each Heading 1. If you are, you'll need one bookmark per
chapter. Depending on the number of chapters, this could be tricky to
maintain.

To insert each pair of field delimiters, press Ctrl+F9. Type the code
exactly as shown. Note that fields do not update automatically.
Printing or print previewing updates most fields. In addition, you can
force an update at any time by selecting the entire document and
pressing F9.

With outline numbering, you can use Insert | Reference |
Cross-reference. A cross-reference to the last item in the list would
display the number of list items (assuming that you aren't restarting
numbering at some point).

--
Stefan Blom
Microsoft Word MVP


in message
news:[email protected]...
 
V

vk

Hi, Stefan!

Thank you for responding.

Your method is far from perfect because it assumes that no serious
changes could be made to the document. Really, if I add more figures or
tables after bookmarked ones, the counter would be wrong. Same with
corssreference to References List, if I add items behind bookmarked
one, there will be no update.

My question is sort of wheter its possible to literaly "count" items or
get last, not first, number used for specific item, list, etc.

Any ideas are very appreciated.

Thank ypu.
 
S

Stefan Blom

You are right; what I suggested requires a fairly large amount of
manual work. This is especiall true for the cross-reference, which
makes use of hidden bookmarks (you cannot see them even if you display
bookmarks, in Tools | Options, View tab).

If captions are not restarting on each chapter, you could add { SEQ
Figure \c } and { SEQ Table \c } at the very end of the document and
bookmark those; that way, you reduce the possibility that changes in
the document would interfere with the bookmarks. Of course, you still
have to make sure that those SEQ fields are at the very end of the
document. If you are the only editor of the document, this shouldn't
be a problem, though.

Alternatively, you could ask for a macro solution in a programming
newsgroup, if you want something more fancy.

--
Stefan Blom
Microsoft Word MVP


in message
news:[email protected]...
 
V

vk

Seems, yor suggestion is right, I've made just little makeup. Instead
of bookmarking last figure, last table I inserted a hidden bookmark
"DocEnd" at the very end of the document. Then
{SEQ Fig. DocEnd \c} is counting what I want. Same with tables. Oh,
yes, I have several restarting numerings in the document, but the field
is counting what I like - total number of figures/tables.

With References List is somewhat more tricky. I had to put field
{STYLEREF "References List" \l \n} behind the list, made it hidded and
put a bookmark to that field. Then crossreference is showing what I
like.

Thank you for idea.
 
S

Stefan Blom

Glad you got it sorted. In particular, I like the idea of bookmarking
a STYLEREF field.

However, since you can use SEQ fields with the \c switch and a
bookmark, it seems as if my initial assumption was correct: You do
have several different captions (with different identifiers), but you
have no restarts *within* a particular caption type (using either the
\r switch to specify a start at number or the \s switch to specify a
built-in heading level after which numbering should restart). I don't
see how the bookmark trick could work if you had.

--
Stefan Blom
Microsoft Word MVP


in message
news:[email protected]...
 
V

vk

However, since you can use SEQ fields with the \c switch and a
bookmark, it seems as if my initial assumption was correct: You do
have several different captions (with different identifiers), but you
have no restarts *within* a particular caption type (using either the
\r switch to specify a start at number or the \s switch to specify a
built-in heading level after which numbering should restart). I don't
see how the bookmark trick could work if you had.

In fact, the situation is different. I have one caption Fig. and it has
multilevel numbering, which includes Heading1 number like Fig. 1.3,
Fig. 2.5. With described technique I was able to count totals. Same way
I do count Tables in the document :) You can't imagine, how long did
it take to have a possibility to refere "fig x.x" with first lower case
"f" instead of "Fig. x.x". I hopem that Microsoft pepople do have
customers wishlist and counted my issue as well :)
 
V

vk

However, since you can use SEQ fields with the \c switch and a
bookmark, it seems as if my initial assumption was correct: You do
have several different captions (with different identifiers), but you
have no restarts *within* a particular caption type (using either the
\r switch to specify a start at number or the \s switch to specify a
built-in heading level after which numbering should restart). I don't
see how the bookmark trick could work if you had.

In fact, the situation is different. I have one caption Fig. and it has
multilevel numbering, which includes Heading1 number like Fig. 1.3,
Fig. 2.5. With described technique I was able to count totals. Same way
I do count Tables in the document :) You can't imagine, how long did
it take to have a possibility to refere "fig x.x" with first lower case
"f" instead of "Fig. x.x". I hopem that Microsoft pepople do have
customers wishlist and counted my issue as well :)
 

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