diff options
author | Karl Berry <karl@freefriends.org> | 2012-11-03 22:52:39 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-11-03 22:52:39 +0000 |
commit | 12dfdffcfdbd3a4758bb319fd5883f4072120901 (patch) | |
tree | cb9c6f1b106c918be1cbf5231bf49e48b71b1bfa /Master/texmf-dist/tex/latex/biblatex-publist | |
parent | 7a08f1a4e6be25cd32454a18802202d99af08995 (diff) |
biblatex-publist (3nov12)
git-svn-id: svn://tug.org/texlive/trunk@28166 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/biblatex-publist')
-rw-r--r-- | Master/texmf-dist/tex/latex/biblatex-publist/publist.bbx | 98 |
1 files changed, 78 insertions, 20 deletions
diff --git a/Master/texmf-dist/tex/latex/biblatex-publist/publist.bbx b/Master/texmf-dist/tex/latex/biblatex-publist/publist.bbx index 147cac98f4d..83da09a55a7 100644 --- a/Master/texmf-dist/tex/latex/biblatex-publist/publist.bbx +++ b/Master/texmf-dist/tex/latex/biblatex-publist/publist.bbx @@ -11,7 +11,7 @@ % % This work has the LPPL maintenance status "maintained". % -% This Current Maintainer of this work is Jürgen Spitzmüller. +% This Current Maintainer of this work is Jürgen Spitzmüller. % % This work consists of the file publist.bbx % @@ -25,8 +25,8 @@ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\def\bpl@version{0.3} -\def\bpl@rdate{2012/10/21} +\def\bpl@version{0.4} +\def\bpl@rdate{2012/10/30} \ProvidesFile{publist.bbx}[\bpl@rdate\space v.\bpl@version\space biblatex bibliography style (JSP)] @@ -51,10 +51,22 @@ defernumbers=true, maxnames=4} + +% +% Customization settings +% + % % The omitted name of the publication list author -\providecommand*\mysurname{} -\providecommand*\myfirstname{} +\def\bpl@osurname{} +\def\bpl@ofirstname{} +% +% Manual way to specify omitted name +\providecommand\omitname[2][]{% + \def\bpl@osurname{#2} + \ifx\@empty#1\else\def\bpl@ofirstname{#1}\fi +} + % % Formatting of year in margin par (if requested) \providecommand*\plmarginyear[1]{% @@ -65,9 +77,10 @@ % % Options % -\DeclareBibliographyOption{omitname}{\renewcommand*\mysurname{#1}} -\DeclareBibliographyOption{omitfirstname}{\renewcommand*\myfirstname{#1}} +\DeclareBibliographyOption{omitname}{\def\bpl@osurname{#1}} + +\DeclareBibliographyOption{omitfirstname}{\def\bpl@ofirstname{#1}} \newif\if@marginyear\@marginyearfalse \DeclareBibliographyOption{marginyear}[true]{% @@ -138,24 +151,53 @@ % -% Filtered category +% Helper function: +% Removing braces from names, courtesy of egreg at +% http://tex.stackexchange.com/a/79583/19291 +\def\bpl@normalize#1#2{% + \begingroup + \def\IeC##1{##1}% + \protected@edef\@tempa{#1}% + \gdef\@gtempa{}% + \expandafter\bpl@@normalize\@tempa\@nil + \endgroup + \let#2\@gtempa +} +\def\bpl@@normalize#1{% + \ifx#1\@nil\else + \expandafter\gdef\expandafter\@gtempa\expandafter{\@gtempa#1}% + \expandafter\bpl@@normalize + \fi +} + + +% +% Bibliography filter % % Inspired by http://tex.stackexchange.com/a/28555/19291 \DeclareBibliographyCategory{filtered} \DeclareIndexNameFormat{authorfiltered}{% + \bpl@normalize{#1}{\bpl@tsurname}% + \bpl@normalize{#3}{\bpl@tfirstname}% + \bpl@normalize{\bpl@osurname}{\bpl@esurname}% + \bpl@normalize{\bpl@ofirstname}{\bpl@efirstname}% \ifboolexpr{ - test { \ifdefstring{\mysurname}{#1} } + test { \ifdefstrequal{\bpl@esurname}{\bpl@tsurname} } and - ( test { \ifdefstring{\myfirstname}{#3} } or test { \ifdefstring{\myfirstname}{} }) } + ( test { \ifdefstrequal{\bpl@efirstname}{\bpl@tfirstname} } or test { \ifdefstring{\bpl@ofirstname}{} }) } {\addtocategory{filtered}{\thefield{entrykey}}} {}} \DeclareIndexNameFormat{editorfiltered}{% + \edef\bpl@tsurname{#1}% + \edef\bpl@tfirstname{#3}% + \bpl@normalize{\bpl@osurname}{\bpl@esurname}% + \bpl@normalize{\bpl@ofirstname}{\bpl@efirstname}% \ifboolexpr{ - test { \ifdefstring{\mysurname}{#1} } + test { \ifdefstrequal{\bpl@esurname}{\bpl@tsurname} } and - ( test { \ifdefstring{\myfirstname}{#3} } or test { \ifdefstring{\myfirstname}{} }) } + ( test { \ifdefstrequal{\bpl@efirstname}{\bpl@tfirstname} } or test { \ifdefstring{\bpl@ofirstname}{} }) } {\addtocategory{filtered}{\thefield{entrykey}}} {}} @@ -170,7 +212,7 @@ % -% Remove own name from author and editor lists +% Remove omitted name from author and editor lists % \newtoggle{myselfprec} \newtoggle{hadmyself} @@ -178,10 +220,14 @@ \DeclareNameFormat{author}{% \ifthenelse{\value{listcount}=1}{\ifthenelse{\value{author}>1}{\bibopenparen\bibstring{with}\addspace}{}}{}% % Exclude omitted author + \bpl@normalize{#1}{\bpl@tsurname}% + \bpl@normalize{#3}{\bpl@tfirstname}% + \bpl@normalize{\bpl@osurname}{\bpl@esurname}% + \bpl@normalize{\bpl@ofirstname}{\bpl@efirstname}% \ifboolexpr{ - test { \ifdefstring{\mysurname}{#1} } + test { \ifdefstrequal{\bpl@esurname}{\bpl@tsurname} } and - ( test { \ifdefstring{\myfirstname}{#3} } or test { \ifdefstring{\myfirstname}{} }) } + ( test { \ifdefstrequal{\bpl@efirstname}{\bpl@tfirstname} } or test { \ifdefstring{\bpl@ofirstname}{} }) } {\toggletrue{myselfprec}\toggletrue{hadmyself}% \ifthenelse{\value{listcount}=1\AND\value{liststop}=1} {\stepcounter{liststop}}{}} @@ -200,7 +246,9 @@ {\addspace\bibstring{and}\addspace}}% }% }% - \ifblank{#3}{}{#3\addspace}% + \iffirstinits + {\ifblank{#4}{}{#4\addspace}}% + {\ifblank{#3}{}{#3\addspace}}% \ifblank{#5}{}{#5\addspace}% \togglefalse{myselfprec}% #1}% @@ -211,10 +259,14 @@ \DeclareNameFormat{editor}{% \ifthenelse{\value{listcount}=1}{\ifthenelse{\value{editor}>1}{\bibopenparen\bibstring{with}\addspace}{}}{}% % Exclude omitted author + \bpl@normalize{#1}{\bpl@tsurname}% + \bpl@normalize{#3}{\bpl@tfirstname}% + \bpl@normalize{\bpl@osurname}{\bpl@esurname}% + \bpl@normalize{\bpl@ofirstname}{\bpl@efirstname}% \ifboolexpr{ - test { \ifdefstring{\mysurname}{#1} } + test { \ifdefstrequal{\bpl@esurname}{\bpl@tsurname} } and - ( test { \ifdefstring{\myfirstname}{#3} } or test { \ifdefstring{\myfirstname}{} }) } + ( test { \ifdefstrequal{\bpl@efirstname}{\bpl@tfirstname} } or test { \ifdefstring{\bpl@ofirstname}{} }) } {\toggletrue{myselfprec}\toggletrue{hadmyself}% \ifthenelse{\value{listcount}=1\AND\value{liststop}=1} {\stepcounter{liststop}}{}} @@ -233,7 +285,9 @@ {\addspace\bibstring{and}\addspace}}% }% }% - \ifblank{#3}{}{#3\addspace}% + \iffirstinits + {\ifblank{#4}{}{#4\addspace}}% + {\ifblank{#3}{}{#3\addspace}}% \ifblank{#5}{}{#5\addspace}% \togglefalse{myselfprec}% #1}% @@ -243,7 +297,10 @@ \DeclareNameFormat{bookauthor}{% \ifblank{#5}{}{#5\addspace}% - #1\ifblank{#3}{}{\addcomma\space #3} + #1% + \iffirstinits + {\ifblank{#4}{}{\addcomma\space #4}}% + {\ifblank{#3}{}{\addcomma\space #3}}% \ifthenelse{\value{listcount}<\value{liststop}} {\addslash} {}% @@ -256,6 +313,7 @@ \andothersdelim\biblcstring{andothers}} {}} + % % Macros % |