summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/biblatex-publist/publist.bbx
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-02-12 23:31:56 +0000
committerKarl Berry <karl@freefriends.org>2017-02-12 23:31:56 +0000
commit1b77359a5e97dbf40e82c6b0f4c5c70424dc2cba (patch)
tree100947680e34481fb16195475624bcc77aac06e2 /Master/texmf-dist/tex/latex/biblatex-publist/publist.bbx
parent32cd0022ad89e183f0e64d18cc4794daea2ae542 (diff)
biblatex-publist (12feb17)
git-svn-id: svn://tug.org/texlive/trunk@43200 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/biblatex-publist/publist.bbx')
-rw-r--r--Master/texmf-dist/tex/latex/biblatex-publist/publist.bbx213
1 files changed, 184 insertions, 29 deletions
diff --git a/Master/texmf-dist/tex/latex/biblatex-publist/publist.bbx b/Master/texmf-dist/tex/latex/biblatex-publist/publist.bbx
index 2f48be67bfe..51495f57d8a 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{1.3}
-\def\bpl@rdate{2016/08/06}
+\def\bpl@version{1.4}
+\def\bpl@rdate{2017/02/12}
\ProvidesFile{publist.bbx}[\bpl@rdate\space v.\bpl@version\space
biblatex bibliography style (JSP)]
@@ -45,11 +45,24 @@
% Bibliography Options and Base Style
%
-\DeclareBibliographyOption{omitname}{\def\bpl@osurname{#1}}
-
-\DeclareBibliographyOption{omitfirstname}{\def\bpl@ofirstname{#1}}
-
-\DeclareBibliographyOption{omitnameprefix}{\def\bpl@ovonpart{#1}}
+% Deprecated Options (as of v. 1.4)
+\DeclareBibliographyOption{omitname}{%
+ \PackageWarning{biblatex-publist}{The omitname option is deprecated!\MessageBreak
+ Please use plauthorname instead.}{}%
+ \def\bpl@osurname{#1}}
+\DeclareBibliographyOption{omitfirstname}{%
+ \PackageWarning{biblatex-publist}{The omitfirstname option is deprecated!\MessageBreak
+ Please use plauthorfirstname instead.}{}%
+ \def\bpl@ofirstname{#1}}
+\DeclareBibliographyOption{omitnameprefix}{%
+ \PackageWarning{biblatex-publist}{The omitnameprefix option is deprecated!\MessageBreak
+ Please use plauthornameprefix instead.}{}%
+ \def\bpl@ovonpart{#1}}
+
+% Valid options
+\DeclareBibliographyOption{plauthorname}{\def\bpl@osurname{#1}}
+\DeclareBibliographyOption{plauthorfirstname}{\def\bpl@ofirstname{#1}}
+\DeclareBibliographyOption{plauthornameprefix}{\def\bpl@ovonpart{#1}}
\newif\if@marginyear\@marginyearfalse
\DeclareBibliographyOption{marginyear}[true]{%
@@ -61,6 +74,11 @@
\ifstrequal{#1}{false}{\@unboldyeartrue}{\@unboldyearfalse}
}
+\newif\if@hlauthor\@hlauthorfalse
+\DeclareBibliographyOption{plauthorhandling}[omit]{%
+ \ifstrequal{#1}{highlight}{\@hlauthortrue}{\@hlauthorfalse}
+}
+
% Check if users have defined different base styles
% If not, use authoryear.
\newif\ifbpl@standardbasestyle\bpl@standardbasestylefalse
@@ -95,23 +113,23 @@
%
%
-% The omitted name of the publication list author
+% The name of the publication list author
\def\bpl@osurname{}
\def\bpl@ofirstname{}
\def\bpl@ovonpart{}
%
-% Manual way to specify omitted name
-\def\omitname{%
+% Manual way to specify publication list author name
+\def\plauthorname{%
\@ifnextchar[%
- {\omitname@i}
- {\omitname@i[]}%
+ {\plauthorname@i}
+ {\plauthorname@i[]}%
}
-\def\omitname@i[#1]{%
+\def\plauthorname@i[#1]{%
\@ifnextchar[%
- {\omitname@ii{#1}}
- {\omitname@ii{#1}[]}%
+ {\plauthorname@ii{#1}}
+ {\plauthorname@ii{#1}[]}%
}
-\def\omitname@ii#1[#2]#3{%
+\def\plauthorname@ii#1[#2]#3{%
% Do stuff
\def\bpl@osurname{#3}
\ifx\@empty#1\else\def\bpl@ofirstname{#1}\fi
@@ -124,6 +142,12 @@
\raggedleft\small\textbf{#1}%
}
+%
+% Highlighting auf publist author with plauthorhandling=highlight
+\providecommand*\plauthorhl[1]{%
+ \mkbibbold{#1}%
+}
+
%
% Field format definitions
@@ -267,14 +291,48 @@
\defbibfilter{mine}{category=filtered}
-
%
-% Remove omitted name from author and editor lists
+% Remove or embolden omitted name in author and editor lists
%
\newtoggle{myselfprec}
\newtoggle{hadmyself}
-
+\newtoggle{ismyself}
\DeclareNameFormat{author}{%
+ \if@hlauthor
+ % Embolden omitted author
+ \bpl@normalize{\namepartfamily}{\bpl@tsurname}%
+ \bpl@normalize{\namepartgiven}{\bpl@tfirstname}%
+ \bpl@normalize{\namepartprefix}{\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}{} })
+ and
+ ( test { \ifdefstrequal{\bpl@evonpart}{\bpl@tvonpart} } or test { \ifdefstring{\bpl@ovonpart}{} }) }
+ {\toggletrue{ismyself}}{\togglefalse{ismyself}}
+ \ifthenelse{\value{listcount}=1}{}{%
+ \ifnumless{\value{listcount}}{\value{liststop}-1}%
+ {\addcomma\addspace}%
+ {\addspace\bibstring{and}\addspace}%
+ }%
+ \iftoggle{ismyself}{\plauthorhl{%
+ \ifdefvoid{\namepartprefix}{}{\namepartprefix\addspace}%
+ \namepartfamily%
+ \ifgiveninits
+ {\ifdefvoid{\namepartgiveni}{}{\addcomma\addspace\namepartgiveni\addspace}}%
+ {\ifdefvoid{\namepartgiven}{}{\addcomma\addspace\namepartgiven\addspace}}%
+ }}{%
+ \ifdefvoid{\namepartprefix}{}{\namepartprefix\addspace}%
+ \namepartfamily%
+ \ifgiveninits
+ {\ifdefvoid{\namepartgiveni}{}{\addcomma\addspace\namepartgiveni\addspace}}%
+ {\ifdefvoid{\namepartgiven}{}{\addcomma\addspace\namepartgiven\addspace}}%
+ }%
+ \usebibmacro{name:andothers}%
+ \else% \if@hlauthor false
\ifthenelse{\value{listcount}=1}{\ifthenelse{\value{author}>1}{\bibopenparen\bibstring{with}\addspace}{}}{}%
% Exclude omitted author
\bpl@normalize{\namepartfamily}{\bpl@tsurname}%
@@ -315,9 +373,43 @@
\namepartfamily}%
\usebibmacro{name:andothers}%
\ifthenelse{\value{listcount}=\value{liststop}\AND\value{author}>1}{\unspace\bibcloseparen}{}%
+ \fi% end of \if@hlauthor else condition
}
\DeclareNameFormat{editor}{%
+ \if@hlauthor
+ % Embolden omitted editor
+ \bpl@normalize{\namepartfamily}{\bpl@tsurname}%
+ \bpl@normalize{\namepartgiven}{\bpl@tfirstname}%
+ \bpl@normalize{\bpl@osurname}{\bpl@esurname}%
+ \bpl@normalize{\bpl@ofirstname}{\bpl@efirstname}%
+ \ifboolexpr{
+ test { \ifdefstrequal{\bpl@esurname}{\bpl@tsurname} }
+ and
+ ( test { \ifdefstrequal{\bpl@efirstname}{\bpl@tfirstname} } or test { \ifdefstring{\bpl@ofirstname}{} })
+ and
+ ( test { \ifdefstrequal{\bpl@evonpart}{\bpl@tvonpart} } or test { \ifdefstring{\bpl@ovonpart}{} }) }
+ {\toggletrue{ismyself}}{\togglefalse{ismyself}}
+ \ifthenelse{\value{listcount}=1}{}{%
+ \ifnumless{\value{listcount}}{\value{liststop}-1}%
+ {\addcomma\addspace}%
+ {\addspace\bibstring{and}\addspace}%
+ }%
+ \iftoggle{ismyself}{\plauthorhl{%
+ \ifdefvoid{\namepartprefix}{}{\namepartprefix\addspace}%
+ \namepartfamily%
+ \ifgiveninits
+ {\ifdefvoid{\namepartgiveni}{}{\addcomma\addspace\namepartgiveni\addspace}}%
+ {\ifdefvoid{\namepartgiven}{}{\addcomma\addspace\namepartgiven\addspace}}%
+ }}{%
+ \ifdefvoid{\namepartprefix}{}{\namepartprefix\addspace}%
+ \namepartfamily%
+ \ifgiveninits
+ {\ifdefvoid{\namepartgiveni}{}{\addcomma\addspace\namepartgiveni\addspace}}%
+ {\ifdefvoid{\namepartgiven}{}{\addcomma\addspace\namepartgiven\addspace}}%
+ }%
+ \usebibmacro{name:andothers}%
+ \else% \if@hlauthor false
\ifthenelse{\value{listcount}=1}{\ifthenelse{\value{editor}>1}{\bibopenparen\bibstring{with}\addspace}{}}{}%
% Exclude omitted author
\bpl@normalize{\namepartfamily}{\bpl@tsurname}%
@@ -356,6 +448,7 @@
\namepartfamily}%
\usebibmacro{name:andothers}%
\ifthenelse{\value{listcount}=\value{liststop}\AND\value{editor}>1}{\unspace\bibcloseparen}{}%
+ \fi% end of \if@hlauthor else condition
}
\DeclareNameFormat{bookauthor}{%
@@ -369,19 +462,23 @@
{}%
\usebibmacro{name:andothers}}
-\renewbibmacro*{name:andothers}{%
- \ifthenelse{\value{listcount}=\value{liststop}\AND
- \ifmorenames}
- {\ifnum\value{liststop}>1 \finalandcomma\fi
- \andothersdelim\biblcstring{andothers}}
- {}}
-
%
% Macros
%
\renewbibmacro*{author}{%
+ \if@hlauthor
+ \ifnameundef{author}
+ {}
+ {\printnames{author}%
+ \setunit{\addspace}%
+ \iffieldundef{nameaddon}
+ {}
+ {\mkbibbrackets{\bibstring{alias}%
+ \addspace\printfield{nameaddon}}}}
+ \addspace\usebibmacro{year+labelyear}%
+ \else% \if@hlauthor false
\ifnameundef{author}
{}
{\usebibmacro{year+labelyear}\addspace%
@@ -390,18 +487,45 @@
\iffieldundef{nameaddon}
{}
{\mkbibbrackets{\bibstring{alias}%
- \addspace\printfield{nameaddon}}}}}
+ \addspace\printfield{nameaddon}}}}
+ \fi% end of \if@hlauthor else condition
+}
\renewbibmacro*{editor}{%
+ \if@hlauthor
+ \ifnameundef{editor}
+ {}
+ {\printnames{editor}%
+ \setunit{\addspace}%
+ \usebibmacro{editorstrg}}
+ \addspace%
+ \usebibmacro{year+labelyear}%
+ \else% \if@hlauthor false
\ifnameundef{editor}
{}
{\usebibmacro{year+labelyear}%
\addspace%
\printnames{editor}%
\setunit{\addspace}%
- \usebibmacro{editorstrg}}}
+ \usebibmacro{editorstrg}}
+ \fi% end of \if@hlauthor else condition
+}
\renewbibmacro*{editor+others}{%
+\if@hlauthor
+ \ifboolexpr{
+ test \ifuseeditor
+ and
+ not test {\ifnameundef{editor}}
+ }
+ {\printnames{editor}%
+ \setunit{\addcomma\space}%
+ \usebibmacro{editor+othersstrg}%
+ \addspace%
+ \usebibmacro{year+labelyear}%
+ \clearname{editor}}
+ {}%
+\else% \if@hlauthor false
\ifboolexpr{
test \ifuseeditor
and
@@ -413,6 +537,15 @@
\setunit{\addcomma\space}%
\usebibmacro{editor+othersstrg}%
\clearname{editor}}
+ {}%
+\fi% end of \if@hlauthor else condition
+}
+
+\renewbibmacro*{name:andothers}{%
+ \ifthenelse{\value{listcount}=\value{liststop}\AND
+ \ifmorenames}
+ {\ifnum\value{liststop}>1 \finalandcomma\fi
+ \andothersdelim\biblcstring{andothers}}
{}}
\newbibmacro*{date:makedate}{%
@@ -457,7 +590,7 @@
\usebibmacro{date:labelyear+extrayear}%
\if@marginyear%
\iffieldequals{labelyear}{\bbx@lasthash}{}{%
- \printtext{\marginpar{\small\plmarginyear{\printfield{labelyear}}}}%
+ \printtext{\marginpar{\small\plmarginyear{\bibsentence\printfield{labelyear}}}}%
}%
\fi
\savefield{labelyear}{\bbx@lasthash}%
@@ -682,4 +815,26 @@
}
+%
+% Deprecated stuff
+%
+
+% DEPRECATED as of v.1.4
+% Issue a warning if used.
+\newtoggle{bpl:omitname}
+\def\omitname{%
+ \toggletrue{bpl:omitname}%
+ \@ifnextchar[%
+ {\plauthorname@i}
+ {\plauthorname@i[]}%
+}
+
+\AtEndPreamble{%
+ \iftoggle{bpl:omitname}{
+ \PackageWarning{biblatex-publist}{The \protect\omitname\space macro is deprecated!\MessageBreak
+ Please use \protect\plauthorname\space instead.}{}%
+ }
+}
+
+
\endinput