diff options
author | Karl Berry <karl@freefriends.org> | 2020-04-30 21:27:51 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2020-04-30 21:27:51 +0000 |
commit | a1cbf6d2c6f7847ae75d6eca30f61cf4512b2317 (patch) | |
tree | 7c6ce79e7700d65cd7e49b7976d1fa4247f15a51 /Master/texmf-dist/tex/latex | |
parent | 8731099968c37c17c6a916dcb3100922e73a70e1 (diff) |
biblatex-software (30apr20)
git-svn-id: svn://tug.org/texlive/trunk@54950 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r-- | Master/texmf-dist/tex/latex/biblatex-software/software.bbx | 76 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/biblatex-software/software.dbx | 12 |
2 files changed, 83 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}% diff --git a/Master/texmf-dist/tex/latex/biblatex-software/software.dbx b/Master/texmf-dist/tex/latex/biblatex-software/software.dbx index 05422738801..4d45bc7fcc0 100644 --- a/Master/texmf-dist/tex/latex/biblatex-software/software.dbx +++ b/Master/texmf-dist/tex/latex/biblatex-software/software.dbx @@ -28,6 +28,9 @@ date, doi, editor, + eprint, + eprintclass, + eprinttype, file, hal_id, hal_version, @@ -69,6 +72,9 @@ date, doi, editor, + eprint, + eprintclass, + eprinttype, file, hal_id, hal_version, @@ -114,6 +120,9 @@ date, doi, editor, + eprint, + eprintclass, + eprinttype, file, hal_id, hal_version, @@ -154,6 +163,9 @@ crossref, date, doi, + eprint, + eprintclass, + eprinttype, file, hal_id, hal_version, |