diff options
author | Karl Berry <karl@freefriends.org> | 2014-03-14 21:45:47 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2014-03-14 21:45:47 +0000 |
commit | 0c27b92841f29375f8faf1e42527c90fd7c226df (patch) | |
tree | de3e2c89b3e362e4fefc2cbf60b2d3a5c080bffc /Master/texmf-dist/tex/latex/biblatex-publist | |
parent | 0af7dc6b7a6b59b735efb25e93dd4e62be2126d5 (diff) |
biblatex-publist (14mar14)
git-svn-id: svn://tug.org/texlive/trunk@33176 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 | 93 |
1 files changed, 70 insertions, 23 deletions
diff --git a/Master/texmf-dist/tex/latex/biblatex-publist/publist.bbx b/Master/texmf-dist/tex/latex/biblatex-publist/publist.bbx index a965ffe197e..56751334857 100644 --- a/Master/texmf-dist/tex/latex/biblatex-publist/publist.bbx +++ b/Master/texmf-dist/tex/latex/biblatex-publist/publist.bbx @@ -25,8 +25,8 @@ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\def\bpl@version{0.8} -\def\bpl@rdate{2013/08/16} +\def\bpl@version{0.9} +\def\bpl@rdate{2014/03/13} \ProvidesFile{publist.bbx}[\bpl@rdate\space v.\bpl@version\space biblatex bibliography style (JSP)] @@ -60,11 +60,24 @@ % The omitted name of the publication list author \def\bpl@osurname{} \def\bpl@ofirstname{} +\def\bpl@ovonpart{} % % Manual way to specify omitted name -\providecommand\omitname[2][]{% - \def\bpl@osurname{#2} +\def\omitname{% + \@ifnextchar[% + {\omitname@i} + {\omitname@i[]}% +} +\def\omitname@i[#1]{% + \@ifnextchar[% + {\omitname@ii{#1}} + {\omitname@ii{#1}[]}% +} +\def\omitname@ii#1[#2]#3{% + % Do stuff + \def\bpl@osurname{#3} \ifx\@empty#1\else\def\bpl@ofirstname{#1}\fi + \ifx\@empty#2\else\def\bpl@ovonpart{#2}\fi } % @@ -82,6 +95,8 @@ \DeclareBibliographyOption{omitfirstname}{\def\bpl@ofirstname{#1}} +\DeclareBibliographyOption{omitnameprefix}{\def\bpl@ovonpart{#1}} + \newif\if@marginyear\@marginyearfalse \DeclareBibliographyOption{marginyear}[true]{% \ifstrequal{#1}{true}{\@marginyeartrue\reversemarginpar}{\@marginyearfalse} @@ -160,10 +175,13 @@ % % Helper function: -% Removing braces from names, courtesy of egreg at -% http://tex.stackexchange.com/a/79583/19291 +% Removing braces from names (courtesy of egreg at +% http://tex.stackexchange.com/a/79583/19291) +% and normalize spaces \def\bpl@normalize#1#2{% \begingroup + \def\bibnamedelima{ }% + \def\bibnamedelimb{ }% \def\IeC##1{##1}% \protected@edef\@tempa{#1}% \gdef\@gtempa{}% @@ -188,24 +206,32 @@ \DeclareIndexNameFormat{authorfiltered}{% \bpl@normalize{#1}{\bpl@tsurname}% \bpl@normalize{#3}{\bpl@tfirstname}% + \bpl@normalize{#5}{\bpl@tvonpart}% \bpl@normalize{\bpl@osurname}{\bpl@esurname}% \bpl@normalize{\bpl@ofirstname}{\bpl@efirstname}% + \bpl@normalize{\bpl@ovonpart}{\bpl@evonpart}% \ifboolexpr{ test { \ifdefstrequal{\bpl@esurname}{\bpl@tsurname} } and - ( test { \ifdefstrequal{\bpl@efirstname}{\bpl@tfirstname} } or test { \ifdefstring{\bpl@ofirstname}{} }) } + ( test { \ifdefstrequal{\bpl@efirstname}{\bpl@tfirstname} } or test { \ifdefstring{\bpl@ofirstname}{} }) + and + ( test { \ifdefstrequal{\bpl@evonpart}{\bpl@tvonpart} } or test { \ifdefstring{\bpl@ovonpart}{} }) } {\addtocategory{filtered}{\thefield{entrykey}}} {}} \DeclareIndexNameFormat{editorfiltered}{% \edef\bpl@tsurname{#1}% \edef\bpl@tfirstname{#3}% + \edef\bpl@tvonpart{#5}% \bpl@normalize{\bpl@osurname}{\bpl@esurname}% \bpl@normalize{\bpl@ofirstname}{\bpl@efirstname}% + \bpl@normalize{\bpl@ovonpart}{\bpl@evonpart}% \ifboolexpr{ test { \ifdefstrequal{\bpl@esurname}{\bpl@tsurname} } and - ( test { \ifdefstrequal{\bpl@efirstname}{\bpl@tfirstname} } or test { \ifdefstring{\bpl@ofirstname}{} }) } + ( test { \ifdefstrequal{\bpl@efirstname}{\bpl@tfirstname} } or test { \ifdefstring{\bpl@ofirstname}{} }) + and + ( test { \ifdefstrequal{\bpl@evonpart}{\bpl@tvonpart} } or test { \ifdefstring{\bpl@ovonpart}{} }) } {\addtocategory{filtered}{\thefield{entrykey}}} {}} @@ -230,12 +256,16 @@ % Exclude omitted author \bpl@normalize{#1}{\bpl@tsurname}% \bpl@normalize{#3}{\bpl@tfirstname}% + \bpl@normalize{#5}{\bpl@tvonpart}% \bpl@normalize{\bpl@osurname}{\bpl@esurname}% \bpl@normalize{\bpl@ofirstname}{\bpl@efirstname}% + \bpl@normalize{\bpl@ovonpart}{\bpl@evonpart}% \ifboolexpr{ test { \ifdefstrequal{\bpl@esurname}{\bpl@tsurname} } and - ( test { \ifdefstrequal{\bpl@efirstname}{\bpl@tfirstname} } or test { \ifdefstring{\bpl@ofirstname}{} }) } + ( test { \ifdefstrequal{\bpl@efirstname}{\bpl@tfirstname} } or test { \ifdefstring{\bpl@ofirstname}{} }) + and + ( test { \ifdefstrequal{\bpl@evonpart}{\bpl@tvonpart} } or test { \ifdefstring{\bpl@ovonpart}{} }) } {\toggletrue{myselfprec}\toggletrue{hadmyself}% \ifthenelse{\value{listcount}=1\AND\value{liststop}=1} {\stepcounter{liststop}}{}} @@ -274,7 +304,9 @@ \ifboolexpr{ test { \ifdefstrequal{\bpl@esurname}{\bpl@tsurname} } and - ( test { \ifdefstrequal{\bpl@efirstname}{\bpl@tfirstname} } or test { \ifdefstring{\bpl@ofirstname}{} }) } + ( test { \ifdefstrequal{\bpl@efirstname}{\bpl@tfirstname} } or test { \ifdefstring{\bpl@ofirstname}{} }) + and + ( test { \ifdefstrequal{\bpl@evonpart}{\bpl@tvonpart} } or test { \ifdefstring{\bpl@ovonpart}{} }) } {\toggletrue{myselfprec}\toggletrue{hadmyself}% \ifthenelse{\value{listcount}=1\AND\value{liststop}=1} {\stepcounter{liststop}}{}} @@ -360,32 +392,47 @@ \clearname{editor}} {}} -\newbibmacro*{date:labelyear+extrayear}{% - \mkbibbold{\printtext{% - \iffieldundef{month}{% +\newbibmacro*{date:makedate}{% + \printtext{% + \iffieldundef{year}{% + \iffieldundef{pubstate}{}{% + \printfield{pubstate}% + }% + }{% + \iffieldundef{month}{% \printdateextra}% {\printdate}% }% - }% + }% +} + +\newbibmacro*{date:labelyear+extrayear}{% + \mkbibbold{\usebibmacro{date:makedate}}% } \AtBeginDocument{% \if@unboldyear \renewbibmacro*{date:labelyear+extrayear}{% - \printtext{% - \iffieldundef{month}{% - \printdateextra}% - {\printdate}% - }% + \usebibmacro{date:makedate}% } \fi } \newbibmacro*{year+labelyear}{% - \iffieldundef{year} - {\let\bbx@lasthash\undefined} - {\usebibmacro{date:labelyear+extrayear}% - \if@marginyear + \iffieldundef{year}{% + \iffieldundef{pubstate}{\let\bbx@lasthash\undefined}{% + \usebibmacro{date:labelyear+extrayear}% + \if@marginyear% + \iffieldequals{pubstate}{\bbx@lasthash}{}{% + \printtext{\marginpar{\small\plmarginyear{\bibsentence\printfield{pubstate}}}}% + }% + \fi + \savefield{pubstate}{\bbx@lasthash}% + \clearfield{pubstate}% + } + }{% + \usebibmacro{date:labelyear+extrayear}% + \if@marginyear% \iffieldequals{labelyear}{\bbx@lasthash}{}{% \printtext{\marginpar{\small\plmarginyear{\printfield{labelyear}}}}% }% |