tricky format question

A place for users to ask each other questions, make suggestions, and discuss Bookends.
Post Reply
Reiner
Posts: 192
Joined: Wed May 04, 2005 6:31 am

tricky format question

Post by Reiner »

Part of a format is written in parentheses. This works very well, except when the field u8 is empty. Then the closing parenthesis is suppressed what should not be.

... (u9. ~Bd. ~u14. $Hg. v. $u8*.) ...

Of course I could solve this problem using by setting ... u8*.`)` ... But this would not solve the problem because then I will have the closing parenthesis also when there is none of the fields within the parenthesis filled.

I'm stuck here. So any help would be much appreciated.

Or is it impossible to solve this problem with the operators Bookends provide at the moment? If that: Would this solvable via grouping multiple fields?


Edit: an additional question: Is it possible to have the field u8 printed in italic but the closing parenthesis in regular? I only managed to have the parenthesis also italics what is wrong.
Jon
Site Admin
Posts: 10292
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Post by Jon »

This is tricky because there are so many dependencies. I think you'll have to force the final parenthesis with `)`. If this reference type often has nothing in any of these fields, I'd consider eliminating the parentheses for this type and creating a new type for these cases.

As for the italics, I cleared all styles from the text and applied italics to "u8". The closing parenthesis was output in plain text.

Jon
Sonny Software
Jon
Site Admin
Posts: 10292
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Post by Jon »

Hm, on reflection I have a better solution. Use

`(` and `)`

in the format. If there is nothing in the fields between the parentheses, Bookends will eliminate the empty ().


Jon
Sonny Software
Reiner
Posts: 192
Joined: Wed May 04, 2005 6:31 am

Post by Reiner »

great as ever. that works perfectly! Thanks.
ozean
Posts: 461
Joined: Fri Mar 04, 2005 11:53 am
Location: Norway
Contact:

Post by ozean »

Ah, excellent. I really hammered my brain on that one (for a few minutes at least), but I did not find that solution. Post-processing is the key to a formatter’s happiness :)
Post Reply