3

I'm not sure on how to list a piece of software in my bibliography. Seems like bibs are made in a time when licences didn't bother anybody yet. ;-) What I by now do is this:

@misc{ref2,
    Author = {xceedsoftware},
    Title = {wpftoolkit},
    Note = {\url{https://github.com/xceedsoftware/wpftoolkit}},
    Version = {Ms-PL}
    },

But this does not really match what I need because it lists the licence as Version Ms-PL. Whats the correct way of handling licences in softwarepackages I have to reference?

MWE solution:

\documentclass{article}
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[sfdefault,light]{FiraSans}

\begin{filecontents}{license.dbx}
\DeclareDatamodelFields[type=field,datatype=literal]{license}
\DeclareDatamodelEntryfields[software]{license}
\end{filecontents}
\usepackage[backend=biber, style=numeric, defernumbers, datamodel=license]{biblatex}
\DeclareBibliographyCategory{skipbibliography}
\DeclareCiteCommand{\cite}[\mkbibfootnote]
  {\usebibmacro{prenote}}
  {\addtocategory{skipbibliography}{\thefield{entrykey}}%
   \usedriver
     {\DeclareNameAlias{sortname}{default}}
     {\thefield{entrytype}}}
  {\multicitedelim}
  {\usebibmacro{postnote}}
\usepackage{csquotes}
\appto{\bibsetup}{\emergencystretch=1em}

\NewBibliographyString{license}
\DefineBibliographyStrings{english}{license = {license},}
\DefineBibliographyStrings{german}{license = {Lizenz},}

\DeclareFieldFormat{license}{\bibstring{license}\addcolon\space#1}
\renewbibmacro{addendum+pubstate}{%
  \printfield{license}%
  \newunit\newblock
  \printfield{addendum}%
  \newunit\newblock
  \printfield{pubstate}}


\begin{filecontents}{\jobname.bib}
@software{wpf,
  author  = {{Xceed}},
  title   = {Extended WPF Toolkit},
  url     = {https://github.com/xceedsoftware/wpftoolkit},
  license = {Ms-PL},
}
\end{filecontents}

\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}

\begin{document}
\cite{sigfridsson,wpf}
\printbibliography
\end{document}
novski
  • 1,039
  • 2
    As you are using biblatex (according to your tags) you could have a try and use addendum (its like a second note field). Whether it is displayed or not depends on your bibliography style. – TeXnician Sep 17 '18 at 06:24
  • 1
    Do you really use biblatex? What style do you use? Can you show us a minimal example document that shows this entry in action, please? (If you really use biblatex don't use the note field to display the URL, use the dedicated url field) – moewe Sep 17 '18 at 06:24
  • Im cirrently experimenting with different styles so share me yours and i will likely adopt... also if you paste me a sample of one of your cites with url field i would apreciate. – novski Sep 17 '18 at 06:52
  • 1
    Use code like this and make it an example: https://tex.stackexchange.com/a/451178/120578 – koleygr Sep 17 '18 at 07:13
  • i added a MWE and wold apreciate a help in changeing the full Bib to normal text nothing bold and all with the default Font. – novski Sep 17 '18 at 18:43
  • The MWE as posted works brilliantly for me and produces https://i.stack.imgur.com/8OkgW.png. (1) Does that not work for you? (2) What output do you get instead? Please show a screenshot of the result. (3) Do you get any errors or warnings in the .log or .blg file after the LaTeX, Biber, LaTeX, LaTeX compilation cycle? (4) What version of biblatex and Biber are you running? – moewe Sep 17 '18 at 19:00
  • ah, you are right. add this: \usepackage[ngerman]{babel} then its bold as i wrote... – novski Sep 17 '18 at 20:31
  • Well, you need something like \DefineBibliographyStrings{german}{license = {Lizenz},} if you want a German translation as well. – moewe Sep 18 '18 at 04:42
  • Ideally you would not post solutions in the question as that can confuse and bypasses the Q&A scheme. I'll be happy to add the line to my MWE below. – moewe Sep 18 '18 at 06:38

1 Answers1

5

Your question is tagged with biblatex, so I strongly suggest you use the dedicated url field instead of note.

I know of no style that has an explicit license field, so you can either use a different generic field (note works for almost all styles, biblatex or BibTeX alike; or addendum or titleaddon for biblatex)

@software{wpf,
  author  = {{Xceed}},
  title   = {Extended WPF Toolkit},
  url     = {https://github.com/xceedsoftware/wpftoolkit},
  note    = {License: Ms-PL}
}

Or you can use biblatex's dynamic data model to add a license field (see Add field "tome" to biblatex entries), in that case you also need to find a way to inject the license field into a suitable place in the bibliography (in the example below we patch into addendum+pubstate because that seemed a suitable place and because it is fairly simple to do so for @software entries, other places would have been more code-intensive).

The solution works with bibstrings to print "license", so you need to define the string for every language you intend to use, the MWE shows this for English and German.

\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}

\usepackage{filecontents}
\begin{filecontents}{license.dbx}
\DeclareDatamodelFields[type=field,datatype=literal]{license}
\DeclareDatamodelEntryfields[software]{license}
\end{filecontents}

\usepackage[style=authoryear, backend=biber, datamodel=license]{biblatex}

\NewBibliographyString{license}
\DefineBibliographyStrings{english}{%
  license = {license},
}
\DefineBibliographyStrings{german}{%
  license = {Lizenz},
}

\DeclareFieldFormat{license}{\bibstring{license}\addcolon\space#1}
\renewbibmacro{addendum+pubstate}{%
  \printfield{license}%
  \newunit\newblock
  \printfield{addendum}%
  \newunit\newblock
  \printfield{pubstate}}

\begin{filecontents}{\jobname.bib}
@software{wpf,
  author  = {{Xceed}},
  title   = {Extended WPF Toolkit},
  url     = {https://github.com/xceedsoftware/wpftoolkit},
  license = {Ms-PL},
}
\end{filecontents}

\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}


\begin{document}
\cite{sigfridsson,wpf}
\printbibliography
\end{document}

Sigfridsson, Emma and Ulf Ryde (1998). ‘Comparison of methods for deriving atomic charges from the electrostatic potential and moments’. In: *Journal of Computational Chemistry* 19.4, pp. 377–395. doi: 10.1002/(SICI)1096-987X(199803)19:4<377::AID-JCC1>3.0.CO;2-P.//Xceed (n.d.). *Extended WPF Toolkit.* url: https://github.com/xceedsoftware/wpftoolkit. License: Ms-PL.

moewe
  • 175,683
  • oh. @software was the thing i was searching for. Does there exist a list of such options and its entities like 'licence'? – novski Sep 17 '18 at 15:20
  • @novski The biblatex documentation has a full list of all supported entry types and fields (§2). – moewe Sep 17 '18 at 16:09
  • thanks @moewe i was supprized to read that software is untreated by the styles. Maybe thats why "licence" is writen bold in this MWE? how can i make it normal? – novski Sep 17 '18 at 18:39
  • i added a MWE and wold apreciate a help in changeing the full Bib to normal text nothing bold and all with the default Font. – novski Sep 17 '18 at 18:42
  • @novski I don't see "license", or "licence" for that matter, printed in bold in the MWE. What exactly do you mean? – moewe Sep 17 '18 at 19:02