Suppress publisher in citations, but keep in bibliography. Patch.
Seb Wills <[email protected]>
| Newsgroups | gmane.comp.tex.bibtex.jurabib.user,gmane.comp.tex.bibtex.jurabib.devel |
|---|---|
| Message-ID | <Pine.SOC.4.61.0507061729070.14908@mraos> |
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/
nopublisherincitations.patch
(text/plain, 1.9 KB)
--- 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$