Place, Publisher: Date -- Formatting problem

A place for users to ask each other questions, make suggestions, and discuss Bookends.
Post Reply
Michael Bywater
Posts: 4
Joined: Tue Apr 19, 2005 11:00 am
Location: Cambridge, UK

Place, Publisher: Date -- Formatting problem

Post 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?
Jon
Site Admin
Posts: 10291
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Post 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
Michael Bywater
Posts: 4
Joined: Tue Apr 19, 2005 11:00 am
Location: Cambridge, UK

Post 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.
Jon
Site Admin
Posts: 10291
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Post by Jon »

Fair enough. But realistically, are there situations where you know the place of publication but not the publisher?

Jon
Sonny Software
Last edited by Jon on Fri Mar 17, 2006 8:12 am, edited 1 time in total.
Jon
Site Admin
Posts: 10291
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Post 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
ozean
Posts: 461
Joined: Fri Mar 04, 2005 11:53 am
Location: Norway
Contact:

Post 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.
Jon
Site Admin
Posts: 10291
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Post 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
Post Reply