how do quotes, force quotes, binding quotes work with fields

A place for users to ask each other questions, make suggestions, and discuss Bookends.
Post Reply
vcaston
Posts: 9
Joined: Wed Jul 05, 2006 3:24 pm

how do quotes, force quotes, binding quotes work with fields

Post by vcaston »

I've been fooling around with this, reading and rereading the manual (esp. pp. 132-4), but I'm still having a little trouble understanding how quotes, force quotes and binding quotes work with both preceding and successive fields.

Through trial and error, I've gotten the output I wanted, but it's still unclear to me why it had to be that way.

In the style I'm working with (a variant of Chicago 15th), a journal will ordinarily have a colon and no spaces between a volume number and the page numbers, e. g.,

15:35-45.

But sometimes I have to include the original date of publication (which I've put in u4), which should be in parentheses, e. g.,

15 (1967):35-45.

Or there will be additional assorted information in the notes field, preceded by a comma, e. g.,

15, School year 1906, program no. 213:35-45.

This is the only combination that doesn't add stray punctuation marks when one of these later fields is empty:

v$ ($u4~)~|~, ~n`:`p–.

But why does the open parenthesis require different quote marks than the closed? (I've tried quite a few other combinations.)


Victor
Jon
Site Admin
Posts: 10096
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Post by Jon »

Hi,

The ~ is a "binding quote". In this case, since there is an entry in the Volume field (to which the open paren is bound),

v~ (~u4

would always result in the open paren being output regardless of whether u4 has data or not.

The $ quote is sensitive to whether a space separates it from a following field that has or does not have content. If u4 is empty, the information inside of the $ signs in

v$ ($u4

is not output. If u4 has data, the open paren is output.

Jon
Sonny Software
vcaston
Posts: 9
Joined: Wed Jul 05, 2006 3:24 pm

Post by vcaston »

Is this a fair summary?

1. Any text between any pair of quotation marks, of any type, will print if there is a space following the close quotation mark.

2. But they differ when they are immediately adjacent to a field, that is, not separated by a space (or a pipe, in the case of ~ quotation marks):

a) text between $ quotation marks prints if the *following* field is nonempty.

b) text between ~ quotation marks prints if *either* the preceding *or* the following field is nonempty

c) text between ` quotation marks prints regardless of whether the fields are empty or nonempty.
vcaston
Posts: 9
Joined: Wed Jul 05, 2006 3:24 pm

a related question

Post by vcaston »

I also have a question about how quotation marks of a single type are parsed -- how Bookends decides which goes with which. It doesn't seem to be from left to right.

If I use the format

v$ ($u4~)~|~, ~n$:$p–. $Reprinted in $b

where u4, n, and b are all empty fields, I get something like the following output for v and p-

50 (382-402

whereas if I use

v$ ($u4~)~|~, ~n`:`p–. $Reprinted in $b

I get

50:382-402.
Jon
Site Admin
Posts: 10096
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Post by Jon »

vcaston wrote:b) text between ~ quotation marks prints if *either* the preceding *or* the following field is nonempty
Not quite. It binds to the preceeding field. You can make it bind to the following field if you use the pipe in front of it:

|~
c) text between ` quotation marks prints regardless of whether the fields are empty or nonempty.
Right.

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

Re: a related question

Post by Jon »

vcaston wrote:I also have a question about how quotation marks of a single type are parsed -- how Bookends decides which goes with which. It doesn't seem to be from left to right.
It is from left to right.

If you want to pursue the details, please contact me directly and we'll go over it.

Jon
Sonny Software
vcaston
Posts: 9
Joined: Wed Jul 05, 2006 3:24 pm

Post by vcaston »

Thanks, Jon -- that helps. On further experimentation, it's clear I had quotation marks all wrong. Does this look right?

The rule for ~ quotations:

Text between ~ quotation marks is printed if and only if it is bound to a nonempty field; and a quotation can only bind to fields which are immediately adjacent (i. e., not separated by a space or a pipe).

But fields immediately before are given priority:

If there is an immediately adjacent field before the quotation, the quotation always binds to it (whether or not there is an immediately adjacent field after it as well).

If there isn't an immediately adjacent field before it, then the quoted text binds to an immediately adjacent field after it, if there is one.


The rule for $ quotations:

The text between $ quotation marks is printed if and only if either

(a) the quoted text is not immediately adjacent to ANY field; or

(b) there is at least one adjacent field, but NONE is empty.

It seems that order doesn't matter here. If there is only one field, it doesn't matter whether it comes before or after, the text will be printed; and if there are two fields, but one is empty, the text will not print, regardless of whether the empty one comes before or after.


And ` quotations print no matter what.
Jon
Site Admin
Posts: 10096
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Post by Jon »

That looks to be essentially correct.

Jon
Sonny Software
Post Reply