summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/biblatex-publist
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-07-10 21:20:39 +0000
committerKarl Berry <karl@freefriends.org>2020-07-10 21:20:39 +0000
commita87f83a050d1400a678c4572f2c3b7753c3b6d21 (patch)
tree935fb43efb29e06beecc4c02b30770470d3c4952 /Master/texmf-dist/tex/latex/biblatex-publist
parent8f752dc83b467977bce87564b376d22a8580b0fa (diff)
biblatex-publist (10jul20)
git-svn-id: svn://tug.org/texlive/trunk@55801 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.bbx100
-rw-r--r--Master/texmf-dist/tex/latex/biblatex-publist/publist.cbx4
2 files changed, 100 insertions, 4 deletions
diff --git a/Master/texmf-dist/tex/latex/biblatex-publist/publist.bbx b/Master/texmf-dist/tex/latex/biblatex-publist/publist.bbx
index 7ba7be52cee..4c8f91ff625 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.16}
-\def\bpl@rdate{2019/04/16}
+\def\bpl@version{1.17}
+\def\bpl@rdate{2020/07/10}
\ProvidesFile{publist.bbx}[\bpl@rdate\space v.\bpl@version\space
biblatex bibliography style (JSP)]
@@ -127,6 +127,59 @@
}
}
+\newtoggle{bpl@linktitle}
+\newtoggle{bpl@linktitleisbn}
+\newtoggle{bpl@linktitleissn}
+\newtoggle{bpl@linktitleurl}
+\newtoggle{bpl@linktitledoi}
+\DeclareBibliographyOption{linktitleall}[true]{%
+ \ifstrequal{#1}{true}{
+ \toggletrue{bpl@linktitleisbn}
+ \toggletrue{bpl@linktitleissn}
+ \toggletrue{bpl@linktitleurl}
+ \toggletrue{bpl@linktitledoi}
+ \toggletrue{bpl@linktitle}
+ }{%
+ \togglefalse{bpl@linktitleisbn}
+ \togglefalse{bpl@linktitleissn}
+ \togglefalse{bpl@linktitleurl}
+ \togglefalse{bpl@linktitledoi}
+ \togglefalse{bpl@linktitle}
+ }%
+}
+\DeclareBibliographyOption{linktitleurl}[true]{%
+ \ifstrequal{#1}{true}{%
+ \toggletrue{bpl@linktitleurl}
+ \toggletrue{bpl@linktitle}
+ }{%
+ \togglefalse{bpl@linktitleurl}
+ }%
+}
+\DeclareBibliographyOption{linktitledoi}[true]{%
+ \ifstrequal{#1}{true}{%
+ \toggletrue{bpl@linktitledoi}
+ \toggletrue{bpl@linktitle}
+ }{%
+ \togglefalse{bpl@linktitledoi}
+ }%
+}
+\DeclareBibliographyOption{linktitleisbn}[true]{%
+ \ifstrequal{#1}{true}{%
+ \toggletrue{bpl@linktitleisbn}
+ \toggletrue{bpl@linktitle}
+ }{%
+ \togglefalse{bpl@linktitleisbn}
+ }%
+}
+\DeclareBibliographyOption{linktitleissn}[true]{%
+ \ifstrequal{#1}{true}{%
+ \toggletrue{bpl@linktitleissn}
+ \toggletrue{bpl@linktitle}
+ }{%
+ \togglefalse{bpl@linktitleissn}
+ }%
+}
+
% Check if users have defined different base styles
% If not, use authoryear.
\newif\ifbpl@standardbasestyle\bpl@standardbasestylefalse
@@ -1096,6 +1149,27 @@
}
+% Define bibmacro that applies a hypertext reference
+% Inspired by https://tex.stackexchange.com/a/48506/19291
+\newbibmacro*{bpl:linked}[1]{%
+ \ifboolexpr{ test {\ifhyperref} and not test {\ifentrytype{online}} }
+ {\iffieldundef{doi}
+ {\iffieldundef{url}
+ {\iffieldundef{isbn}
+ {\iffieldundef{issn}
+ {#1}
+ {\iftoggle{bpl@linktitleissn}{\href{\plissnlink{\thefield{issn}}}{#1}}{#1}}}
+ {\iftoggle{bpl@linktitleisbn}{\href{\plisbnlink{\thefield{isbn}}}{#1}}{#1}}}
+ {\iftoggle{bpl@linktitleurl}{\href{\thefield{url}}{#1}}{#1}}}
+ {\iftoggle{bpl@linktitledoi}{\href{https://doi.org/\thefield{doi}}{#1}}{#1}}}
+ {#1}%
+}
+
+% URL for ISBN/ISSN queries
+\newcommand*\plisbnlink[1]{https://www.worldcat.org/search?qt=worldcat_org_all&q=#1}
+\newcommand*\plissnlink[1]{https://www.worldcat.org/search?qt=worldcat_org_all&q=#1}
+
+
%
% Mappings (biber)
%
@@ -1139,6 +1213,28 @@
}
}
+% Link titles if so requested
+\AtBeginDocument{%
+\iftoggle{bpl@linktitle}{%
+ \DeclareStyleSourcemap{
+ \maps[datatype=bibtex]{
+ \map[overwrite=true]{
+ \step[fieldsource=title,
+ match=\regexp{(.*)},
+ replace=\regexp{\\usebibmacro{bpl:linked}{$1}},
+ final=true]
+ }
+ \map[overwrite=true]{
+ \step[fieldsource=subtitle,
+ match=\regexp{(.*)},
+ replace=\regexp{\\usebibmacro{bpl:linked}{$1}},
+ final=true]
+ }
+ }
+ }
+}{}
+}
+
%
% Deprecated stuff
diff --git a/Master/texmf-dist/tex/latex/biblatex-publist/publist.cbx b/Master/texmf-dist/tex/latex/biblatex-publist/publist.cbx
index 2a18c9e50d8..d70ac4dbf5a 100644
--- a/Master/texmf-dist/tex/latex/biblatex-publist/publist.cbx
+++ b/Master/texmf-dist/tex/latex/biblatex-publist/publist.cbx
@@ -26,8 +26,8 @@
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\def\bpl@version{1.16}
-\def\bpl@rdate{2019/04/16}
+\def\bpl@version{1.17}
+\def\bpl@rdate{2020/07/10}
\ProvidesFile{publist.cbx}[\bpl@rdate\space v.\bpl@version\space
biblatex citation style (JSP)]