Page 1 of 1

Place, Publisher: Date -- Formatting problem

Posted: Thu Mar 16, 2006 12:00 pm
by Michael Bywater
Same old story -- I know what I want but I'm damned if I can get it...

Here's what I want.

If I enter everything, I want

Author, title (Place: Publisher, 2006)

If I don't know the Place, I want

Author, title (Publisher, 2006)

If I don't know the Publisher, I want

Author, title (Place, 2006)

If I don't know either Place or Publisher, I want

Author, title (2006)

...and if I don't know nothing nohow, I want

Author, title

I can get close, but I am, as I said, damned if I can get all of this. The insoluble problem seems to be in parsing <Place> to produce:

"If <Publisher> is defined, then print "Place: " else print "Place, "

Everything else is do-able but I end up, if Place is not defined, with:

Author, title (: Publisher, 2006)

(and if nothing is defined, I end up with

Author, title (

... but that's a different story.

What I am currently using is the string

a, t|~ (~u11~)~|~, ed++. ~e|~, trans. ~u3` (`l|~: ~u|~, ~d)

Any ideas, anyone?

Posted: Thu Mar 16, 2006 12:35 pm
by Jon
Hi Michael,

The situation where you know nothing (so to speak) is more difficult. But if you want to suppress the colon if there is no location, you should make the binding quote (~) follow the location field (you have it bound to the publishers field). Try this:

a, t|~ (~u11~)~|~, ed++. ~e|~, trans. ~u3 ` (`l~: ~u|~, ~d)

And you are right, it can be tricky getting things exactly right if you play with every conceivable combination of the availability of fields and complex punctuation.

Jon
Sonny Software

Posted: Thu Mar 16, 2006 9:15 pm
by Michael Bywater
Thanks... (SWAPS FORMAT) Ah... but with *that* one, if I don't know the publisher, I get, for example, (London:, 2006)

Ho hum... I shall keep fiddling. Or possibly just use good old-fashioned "n.p." if place of publication is unknown.

Posted: Thu Mar 16, 2006 10:06 pm
by Jon
Fair enough. But realistically, are there situations where you know the place of publication but not the publisher?

Jon
Sonny Software

Posted: Fri Mar 17, 2006 8:11 am
by Jon
Hi,

Upon a little reflection, I came up with this:

a, t|~ (~u11~)~|~, ed++. ~e|~, trans. ~u3 ` (`l:$ $u|~, ~d`)`

It even works if you don't have any of the information that would normally be output in the parentheses.

Jon
Sonny Software

Posted: Fri Mar 17, 2006 12:45 pm
by ozean
Jon wrote:Fair enough. But realistically, are there situations where you know the place of publication but not the publisher?
Since many German formats do only include the place and not the publisher I have added quite a few entries into Bookends for which I only know the place.

Posted: Fri Mar 17, 2006 12:53 pm
by Jon
Hi ozean,

Thanks, I didn't know that. Fortunately, at least in the example above, it looks like that wouldn't be a problem for Bookends.

Jon
Sonny Software