Showing results for 
Search instead for 
Did you mean: 
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

time-independent variables in 5.4


time-independent variables in 5.4

Hello FOSI-folk, got a quick question...

The document types I am working with were originally developed at the document level (MRU). I am building framework around this to enable complete-manual publishing and intermanual hyperlinking.

Where I am having trouble is, that up to this point, I haven't had a requirement to be able to produce a footer with total page counts (i.e. "Page 1 of X") that would apply to several sections within an overall instance.

So I go through the motions, got a counter in the folio for a pageset and a savetext that saves the counter to a variable for my TOC.

Now, I have a time-independent variable declared, and in the e-i-cs that start a new section, I reset the page counter, and I have my savetext with placement=after that uses the TOC variable with the BO modifier as the rule to save to the ID for the TIV.

This doesn't seem to work. The first section doesn't set the tiv, the second one sets the tiv, but it keeps the same value for the last section. I tried turning on gentexttrace for this, but the formatting pass causes a signal 22 and crashes Arbortext (doesn't crash with gentexttrace off). If I remove everything but one section, the TIV works like it's supposed to.

Is what I'm trying to do even possible with one page counter, one tiv, and one pageset, or do I need to split these up (sounds like a pain)?

Anyone have experience doing this successfully? I'm at a loss. Of course I've been staring at this FOSI for two days, it may jump out at me after a long weekend of not caring. Just wanted to see if anyone might have an idea of where I went wrong (with the stylesheet, not talking about career choices here...)



We use two variables, with names such as page.ct for the MRU pages and totalpage.ct for overall page count. The page.ct gets reset at the start of each MRU.

What is the scope for the tiv?

Suzanne Napoleon
"WYSIWYG is last-century technology!"

And herein lies the rub…

The elements I have to work with are sibling elements with different names. I have an intro, a body, and an appendix element. These are all siblings, they all need to restart the counter and collect the total number of pages to the end of the element. They are currently all using the same page counter and pagespec. I’m not sure if this is my problem, but I don’t have much flexibility with the DTD, so I’m trying to make the best of what I have.

I tried eliminating all but the counter for the intro content, and scoping the tiv there, but when I add scope local to the intro element, I lose the value all together. I have the default for this tiv set to ‘count’ just to make sure I had the variable picking up in the footer, and I get that if I do NOT have scope set for the tiv. When I set the scope local to the intro element, I get no value at all.

The page counter itself is set to Arabic, init to 0. It enumerates in the folio for both recto and verso pages, and after that I have a savetext sending the page counter value to a variable, set to occur after, no append. This value gets used for the TOC that generates for the body element, and it seems to work just fine.

When I have the tiv set for all three (subchar with a savetext that occurs after, sending the value of the variable set in the folio from the page counter [BO] to the tiv), the intro shows “Page 1 of count”, which is the default value for the tiv, the body will count “Page 1 of 1” and so on but subsequent pages will say “Page 2 of 1” and so forth. The appendix just carries the “1” from the body element.

Also, the intro, body, and appendix elements start a new page, with the page id being the same for all, and the page start being “next” and the scope is local. The footer that appears in this pageset id is a pseudoelement (needed to adjust font formatting on different lines of the footer). I also tried breaking out the one line from the pseudoelement footer and placing directly in the footer, but this didn’t seem to make a difference.

I can’t say that I’ve tried to reset and use the same tiv more than once in the same document instance, so I don’t know if it’s possible? Seems like it should be, but if I’m off-track, please say so. If I need to split out to separate tivs (or even reference as separate page sets) that’s fine. Just trying to find if there are other ideas before I put that much more work forward.

If I understand correctly that pages inintro should output "Page 1 of 20" in the footer, and pages in body and appendix should do the same, you need 3 tivs, each with the appropriate scope.

Note there is no need to reset a tiv. That happens automatically.

Are you using formatting pass reduction? Overlaying can fail so be sure you have all warnings, errors, etc. to see any messages.

Good luck!