summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/biblatex-software/software.bbx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/biblatex-software/software.bbx')
-rw-r--r--Master/texmf-dist/tex/latex/biblatex-software/software.bbx76
1 files changed, 71 insertions, 5 deletions
diff --git a/Master/texmf-dist/tex/latex/biblatex-software/software.bbx b/Master/texmf-dist/tex/latex/biblatex-software/software.bbx
index 3b7f8d07360..007d6e83250 100644
--- a/Master/texmf-dist/tex/latex/biblatex-software/software.bbx
+++ b/Master/texmf-dist/tex/latex/biblatex-software/software.bbx
@@ -41,17 +41,27 @@
\DeclareLanguageMapping{french}{french-software}
%
+% Macros
+%
+
+\newbibmacro*{swurl+urldate}{%
+ \mkbibacro{URL}\addcolon\addspace%
+ \ifhyperref%
+ {\href{\strfield{url}}{\nolinkurl{\strfield{url}}}}%
+ {\nolinkurl{\strfield{url}}}%
+ \iffieldundef{urlyear}%
+ {}%
+ {\setunit*{\addspace}%
+ \usebibmacro{urldate}}}
+
+%
% Formatting fields for the software entries
%
\DeclareFieldFormat[softwaremodule,codefragment]{subtitle}{\mkbibquote{#1\isdot}}
\DeclareFieldFormat[software,softwareversion,softwaremodule,codefragment]{url}{
\iftoggle{bbx:url}%
- {\mkbibacro{URL}\addcolon\addspace%
- \ifhyperref%
- {\href{#1}{\nolinkurl{#1}}}%
- {\nolinkurl{#1}}%
- }%
+ {\usebibmacro{swurl+urldate}}
{}%
}
\DeclareFieldFormat[software,softwareversion,softwaremodule,codefragment]{hal_id}{
@@ -87,6 +97,22 @@
\usebibmacro{list:andothers}}
%
+% Add here special eprint formats
+%
+\DeclareFieldFormat{eprint:ascl}{%
+ ascl\addcolon\space
+ \ifhyperref
+ {\href{https://ascl.net/#1}{%
+ \nolinkurl{#1}%
+ \iffieldundef{eprintclass}
+ {}
+ {\addspace\texttt{\mkbibbrackets{\thefield{eprintclass}}}}}}
+ {\nolinkurl{#1}%
+ \iffieldundef{eprintclass}
+ {}
+ {\addspace\texttt{\mkbibbrackets{\thefield{eprintclass}}}}}}
+
+%
% Macros to format output
%
\newbibmacro*{swtitleauthoreditoryear}{%
@@ -161,11 +187,35 @@
\setunit*{\addcomma\addspace}%
\printfield{hal_id}%
\setunit*{\addcomma\addspace}%
+ \iftoggle{bbx:eprint}
+ {\usebibmacro{eprint}}
+ {}%
+ \setunit*{\addcomma\addspace}%
\printfield{url}%
\setunit*{\addcomma\addspace}%
\printfield{repository}%
\setunit*{\addcomma\addspace}%
\printfield{swhid}%
+ %
+ % If only the url is present, output it regardless of bbx:url directive
+ %
+ \ifboolexpr{%
+ not test {\iftoggle{bbx:url}}%
+ and
+ not test {\iffieldundef{url}}%
+ and
+ test {\iffieldundef{doi}}%
+ and
+ test {\iffieldundef{eprint}}%
+ and
+ test {\iffieldundef{hal_id}}%
+ and
+ test {\iffieldundef{swhid}}%
+ and
+ test {\iffieldundef{repository}}%
+ }%
+ {\usebibmacro{swurl+urldate}}%
+ {}%
}
\newbibmacro*{swrelated}{%
@@ -184,6 +234,10 @@
\iftoggle{bbx:swlabels}{\bibstring{software}{\addspace}}{}%
\usebibmacro{swtitleauthoreditoryear}%
\newunit\newblock%
+ \printlist{institution}
+ \newunit\newblock%
+ \printlist{organization}
+ \newunit\newblock%
\usebibmacro{licenses}%
\newunit\newblock%
\usebibmacro{swids}%
@@ -197,6 +251,10 @@
\iftoggle{bbx:swlabels}{\bibstring{swversion}\addspace}{}%
\usebibmacro{swsubtitleauthoreditoryear}%
\newunit\newblock%
+ \printlist{institution}
+ \newunit\newblock%
+ \printlist{organization}
+ \newunit\newblock%
\usebibmacro{licenses}%
\newunit\newblock%
\usebibmacro{swids}%
@@ -210,6 +268,10 @@
\iftoggle{bbx:swlabels}{\bibstring{swmodule}\addspace}{}%
\usebibmacro{swsubtitleauthoreditoryear}%
\newblock\newblock%
+ \printlist{institution}
+ \newunit\newblock%
+ \printlist{organization}
+ \newunit\newblock%
\usebibmacro{licenses}%
\newunit\newblock%
\usebibmacro{swids}%
@@ -223,6 +285,10 @@
\iftoggle{bbx:swlabels}{\bibstring{swexcerpt}\addspace}{}%
\usebibmacro{codefragmenttitleauthoreditoryear}%
\newunit\newblock%
+ \printlist{institution}
+ \newunit\newblock%
+ \printlist{organization}
+ \newunit\newblock%
\usebibmacro{licenses}%
\newunit\newblock%
\usebibmacro{swids}%