I'm having some trouble formatting headings correctly in a FOSI and I'm starting to wonder if it will even be possible to get the results I need. The document in question contains headings that need to appear on the left side of the page on left-hand (verso) pages but on the right side of the page on right hand (recto) pages. Unfortunately I can't seem to find a way for the FOSI to adjust the quadding of these elements based on the type of page that they occur on.
I tried creating a text variable and updating it in the versopg and rectopg descriptions for the appropriate pageset, but when I test the value of this variable in a specval, I get an error that says that the value of the variable can't be determined.
I also tried creating a custom ACL function in the specval for the heading and then using fosivar_value to get the value of folioct (the page number) so that I can set the quadding based on whether or not I have an odd-numbered page; but this doesn't work because the value of folioct that gets passed to my system-func is always 00 (even though a usetext that I added for debugging purposes shows the correct page number on printouts). I thought maybe that the problem was that my function wasn't getting called at the appropriate time (i.e. after the page numbers were determined), and so I tried launching my function from a usetext with a userule of "3"; thinking that I could check the folioct safely there; but when I do that, I get an error that says: "Cannot get the value of a Pagedesc counter "folioct" during Styldesc processing."
It appears to me that the print engine does not want to allow my e-i-cs access to information about the page number or the current style of page (recto or verso). Does anyone know of a way to adjust formatting (in this case changing the quadding from right to left) based on the handedness of a page? Any input would be welcome.
I guess I don't quite understand what your problem is. Is the header data the same for both recto and verso pages, or is it different for each? Where does the data come from? Is it something unique for each page that is taken from the page content or is it some "metadata" from some tag(s) at a high document level?
MessageI'll try to make things more clear. I'm not trying to adjust a header, it's an inline heading that I'm trying to render.
Essentially the file is like a series of lists: the headings are just the code and title that go with all the items in the list. For example, if we had lists of widgets, items, and things; it simply needs to end up like this on even-numbered pages:
10 - WIDGETS description of widget a description of widget b description of widget c description of widget d description of widget e
15 - ITEMS description of item a description of item b description of item c
25 - THINGS description of thing a description of thing b description of thing c
Should be easy. In the <pageres> section of each pageset you need to set a variable "recto.txt" with a value of 1 for recto pages and a value of 0 for verso pages. Then add an attribute test within the e-i-c to determine if you need to left (recto.txt="0") or right (recto.txt ="1") justify. <specval attname="recto.txt" attloc="#FOSI" attval="1"> or <specval<br/>attname="recto.txt" attloc="#FOSI" attval="0">
\ / Andy Esslinger - Lockheed Martin Aeronautics Company _____-/\-_____ (817) 777 3047 LM Aero Ft. Worth F/A-22 TOD Integration \_\/_/ Box 748 Mail Zone 4285 Ft. Worth, TX 76101
That was the first thing I tried, but when I do it the way that you suggest, I get an error message stating: [A30042] ERROR: Cannot get the value of variable type of "recto.txt" during Styldesc processing. The stringdecl I'm using is: <stringdecl textid="recto.txt" status="0"> and I update it in the rectopg with: <savetext textid="recto.txt" conrule="1"> and in the versopg with: <savetext textid="recto.txt" conrule="0"> and then in the e-i-c for the heading element, I have <att> <specval attname="recto.txt" attloc="#FOSI" attval="1"> <charsubset> <usetext source="\This" is=" a=" recto=" page\"="> </usetext> </charsubset> </att> <att> <specval attname="recto.txt" attloc="#FOSI" attval="0"> <charsubset> <usetext source="\This" is=" a=" verso=" page\"="> </usetext> </charsubset> </att>
but, I have no luck with this. I've tried using \\ in the savetext conrule and #EQ#\1\ in the specval, but I always end up with the same result: a sequence of the error messages listed above. I even tried moving the savetexts into the e-i-c for an arbitrary element and I saw that everything worked correctly: the recto.txt variable was changing back and forth and my generated text was switching back and forth accordingly, but of course the e-i-c that I used couldn't tell me if the page was recto or verso; I need the pageset to do that.
I think all the pieces are here, just check the following: Make sure these savetexts appear in their respective recto/verso pageres (Folio in the interactive panel) <savetext textid="recto.txt" conrule="1"> <savetext textid="recto.txt" conrule="0"> Make sure you repeat/reference these as necessary in the case of more than one quint in your page layout set (and if you change from your global page layout set anywhere during pagination).. Also, as Mr. Taylor said, make sure you have a startln="1" or endln="1" somewhere in the e-i-c that handles your "headings". I can't tell you how much profanity I have expended on this last little caveat. If you set up the e-i-c to force ALL headings to the right, and it doesn't work, this is most likely the problem. If all else fails, there may be some "fudge" opportunities here using some splitquad-style charfills, but that's a road I try not to head down if I don't have to. If this doesn't work with all the previous things in place, there's got to be something out-of-whack. If your e-i-c for headings has more than one context, you would need to duplicate this functionality for those as well. -Jason
There is good news and bad news here. The good news is that this is possible. The bad news is that it is not easy. The basic problem is that as the composition engine is creating the galley, the list of lines going into the flowing text, it has not yet figured out the page breaks. Because of this, there is no way to determine what page you are on during the formatting. So you need to do two formatting passes. Look in the documentation about the format command, you want to create a layout file. The actual contents of the layout file are not well-documented in the help, your best bet is to create a layout file a short document that you know how it looks and then read the layout file with a printout of the actual output and a copy of layout.dtd from the layout doctype available as well. The layout file shows you where all of the page and line breaks happened along with oid values that refer back to your document. Set up your headings so there is an attribute controlling if they are on the left or the right side of the page. Make sure that they always start a line. Run a format command once to create the layout file. Walk the line breaks in the layout file while also counting pages. If a line break points to an oid that is a heading, determine the page and set the attribute. Reformat the document and this time you will get the output you want. John Dreystadt Director of Product Management Arbortext