Suppress publisher in citations, but keep in bibliography. Patch.

Seb Wills <[email protected]> Thu, 7 Jul 2005 15:52:49 +0100 (BST)
Newsgroups gmane.comp.tex.bibtex.jurabib.user,gmane.comp.tex.bibtex.jurabib.devel
Message-ID <Pine.SOC.4.61.0507061729070.14908@mraos>
---559023410-341603450-1120747969=:19358
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit


I recently wrote in [email protected]:

> I also need to suppress the publisher name in citations, but keep it in the 
> bibliography. Is this possible?

Nobody responded, so I decided to have a go at hacking jurabib.sty and 
jox.bst to do this, and thought I might as well share the resulting patch. 
The big caveat is that I'm completely new to hacking .sty or .bst files,
so the way I've done this might be really stupid.

The attached patch against the current 0.61b (8 new lines in jurabib.sty, 
3 changed lines in jox.bst) adds an extra option for jurabib, 
"nopublisherincitations". If set, and if you are using oxford style (with 
jox.bst), then the publisher name is omitted from citations, but kept in 
the bibliography. If there is no address defined, then the publisher name 
is not omitted (partly because that seemed possibly the right thing to do, 
and partly because the way I've implemented it would probably leave an 
empty "()" if there is no year or address defined either).

The way I've implemented it is to create a new RobustCommand, 
\jbpublishertext, which normally just reproduces its argument, but if the 
nopublisherincitations option is given to jurabib it will only reproduce 
its argument in the bibliography, and will discard it in a citation. In 
jox.bst, the publisher (and related puncutation) is wrapped with this 
function.

I've pasted the patch below as well as attaching it, in case the 
attachment doesn't get through, but watch out for long lines.

Seb

--- jurabib.sty.orig	2005-07-07 14:00:57.000000000 +0100
+++ jurabib.sty	2005-07-07 15:09:17.000000000 +0100
@@ -466,6 +466,7 @@
  \DeclareRobustCommand{\jbaensep}{.}
  \DeclareRobustCommand\el[1]{#1}%
  \DeclareRobustCommand\bibel[1]{\ifjb@nat@use@year@command#1\fi}%
+\DeclareRobustCommand{\jbpublishertext}[1]{#1}
  \newcommand*{\jbshowbibextralabel}{\renewcommand\bibel[1]{##1}}%
  \newcommand*{\jblookforgender}{\global\jblookforgendertrue}%
  \newcommand*{\jbuseidemhrule}{%
@@ -2406,6 +2407,13 @@
    \ifjb@kv@recognized\else\jb@kv@warning{#1}{annotatorlastsep}\fi
  }%
  \define@key{jb}{commabeforerest}[true]{\jb@comma@before@resttrue\renewcommand*{\jbbeforestartpagesep}{,\space}}%
+\define@key{jb}{nopublisherincitations}[true]{%
+  \AtEndOfPackage{%
+    \DeclareRobustCommand{\jbpublishertext}[1]{%
+      \ifjbweareinbib##1\fi
+     }%
+  }%
+}%
  \define@key{jb}{bibformat}{%
   \@for\jb@val:=#1\do{%
    \jb@kv@recognizedfalse
--- jox.bst.orig	2005-07-07 14:00:57.000000000 +0100
+++ jox.bst	2005-07-07 15:27:48.000000000 +0100
@@ -1575,13 +1575,13 @@
            {
              year empty$
                  { month empty$
-                     { address "\bpubaddr {} " * publisher * * }
+                     { address "\jbpublishertext{\bpubaddr {} " * publisher * "}" * *}
                        'skip$
                    if$
                  }
                  { month empty$
-                     { address "\bpubaddr {} " * publisher "\bibbdsep {} " * year * * * add.extra.label }
-                     { address "\bpubaddr {} " * publisher "\bibbdsep {} " * month "{} " * year * * * * add.extra.label }
+                     { address "\jbpublishertext{\bpubaddr {} " * publisher "}\bibbdsep {} " * year * * * add.extra.label }
+                     { address "\jbpublishertext{\bpubaddr {} " * publisher "}\bibbdsep {} " * month "{} " * year * * * * add.extra.label }
                    if$
                  }
              if$





Please remember -- this is an international english speaking mailing list!

If you have a problem, please provide a complete minimal example document (with a small bibliography database), which runs out of he box without any superfluous packages loaded, otherwise we could not help. 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/jurabib/

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

---559023410-341603450-1120747969=:19358
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="nopublisherincitations.patch"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.SOC.4.61.0507071552490.19358@mraos>
Content-Description: 
Content-Disposition: attachment; filename="nopublisherincitations.patch"

LS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21tYW5ke1xqYnB1Ymxpc2hlcnRl
eHR9WzFdeyUNCisgICAgICBcaWZqYndlYXJlaW5iaWIjIzFcZmkNCisgICAgIH0lDQorICB9
JQ0KK30lDQogXGRlZmluZUBrZXl7amJ9e2JpYmZvcm1hdH17JQ0KICBcQGZvclxqYkB2YWw6
PSMxXGRveyUNCiAgIFxqYkBrdkByZWNvZ25pemVkZmFsc2UNCi0tLSBqb3guYnN0Lm9yaWcJ
MjAwNS0wNy0wNyAxNDowMDo1Ny4wMDAwMDAwMDAgKzAxMDANCisrKyBqb3guYnN0CTIwMDUt
MDctMDcgMTU6Mjc6NDguMDAwMDAwMDAwICswMTAwDQpAQCAtMTU3NSwxMyArMTU3NSwxMyBA
QA0KICAgICAgICAgICB7DQogICAgICAgICAgICAgeWVhciBlbXB0eSQNCiAgICAgICAgICAg
ICAgICAgeyBtb250aCBlbXB0eSQNCi0gICAgICAgICAgICAgICAgICAgICB7IGFkZHJlc3Mg
IlxicHViYWRkciB7fSAiICogcHVibGlzaGVyICogKiB9DQorICAgICAgICAgICAgICAgICAg
ICAgeyBhZGRyZXNzICJcamJwdWJsaXNoZXJ0ZXh0e1xicHViYWRkciB7fSAiICogcHVibGlz
aGVyICogIn0iICogKn0NCiAgICAgICAgICAgICAgICAgICAgICAgJ3NraXAkDQogICAgICAg
ICAgICAgICAgICAgaWYkDQogICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAg
eyBtb250aCBlbXB0eSQNCi0gICAgICAgICAgICAgICAgICAgICB7IGFkZHJlc3MgIlxicHVi
YWRkciB7fSAiICogcHVibGlzaGVyICJcYmliYmRzZXAge30gIiAqIHllYXIgKiAqICogYWRk
LmV4dHJhLmxhYmVsIH0NCi0gICAgICAgICAgICAgICAgICAgICB7IGFkZHJlc3MgIlxicHVi
YWRkciB7fSAiICogcHVibGlzaGVyICJcYmliYmRzZXAge30gIiAqIG1vbnRoICJ7fSAiICog
eWVhciAqICogKiAqIGFkZC5leHRyYS5sYWJlbCB9DQorICAgICAgICAgICAgICAgICAgICAg
eyBhZGRyZXNzICJcamJwdWJsaXNoZXJ0ZXh0e1xicHViYWRkciB7fSAiICogcHVibGlzaGVy
ICJ9XGJpYmJkc2VwIHt9ICIgKiB5ZWFyICogKiAqIGFkZC5leHRyYS5sYWJlbCB9DQorICAg
ICAgICAgICAgICAgICAgICAgeyBhZGRyZXNzICJcamJwdWJsaXNoZXJ0ZXh0e1xicHViYWRk
ciB7fSAiICogcHVibGlzaGVyICJ9XGJpYmJkc2VwIHt9ICIgKiBtb250aCAie30gIiAqIHll
YXIgKiAqICogKiBhZGQuZXh0cmEubGFiZWwgfQ0KICAgICAgICAgICAgICAgICAgIGlmJA0K
ICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgaWYkDQo=

---559023410-341603450-1120747969=:19358--