In my bibliography I have some standards for which I have modified the declaration given here according to the suggested way of citing given here (sorry, this site is not available in English).
The problem now is, that the entries in the bibliography are sorted wrong in the default nty
style, because the author is always the same and next comes the title (as can be seen in the picture below, which is the result of the given code as is).
So the question is, how can I convince biblatex
/biber
to sort the entries correct, i.e. they have to be sorted after the number
field?
What I have found out so far is that I can define a new sorting scheme with \DeclareSortingScheme
(inspired by this answer), but I haven't found out, if there is a possibility to apply it only to specified entrytype
s.
What I have found is that there is a possibility of removing fields for sorting for specified entrytype
s using the \DeclareSortExclusion
command. Combining this with an extended version of \DeclareSortingScheme{nty}{...}
gives the desired result (have a look at the commented part of the code before \begin{document}
).
But maybe there is a more elegant way to achieve the desired result.?
\begin{filecontents}{test1.bib}
@STANDARD{ISO2240,
author = {{International Organization for Standardization}},
title = {Photography -- Colour reversal camera films -- Determination
of ISO speed},
year = {2003},
number = {ISO 2240:2003-10},
langid = {english},
}
@STANDARD{ISO9660,
author = {{International Organization for Standardization}},
title = {Information processing; volume and file structure of CD-ROM
for information interchange},
year = {1988},
number = {ISO 9660:1988-04},
langid = {english},
}
\end{filecontents}
\documentclass{article}
\usepackage[
style=numeric,
% sorting=nty, <-- default
]{biblatex}
\addbibresource{test1.bib}
% -------------------------------------------------------------------------------------------------
%%% define own style for standards
%%% at <https://tex.stackexchange.com/questions/65637/how-to-cite-a-standard-iso-etc-in-biblatex>
%% it was given as ...
%\DeclareDatamodelEntrytypes{standard}
%\DeclareDatamodelEntryfields[standard]{type,number}
%\DeclareBibliographyDriver{standard}{%
% \usebibmacro{bibindex}%
% \usebibmacro{begentry}%
% \usebibmacro{author}%
% \setunit{\labelnamepunct}\newblock
% \usebibmacro{title}%
% \newunit\newblock
% \printfield{number}%
% \setunit{\addspace}\newblock
% \printfield[parens]{type}%
% \newunit\newblock
% \usebibmacro{location+date}%
% \newunit\newblock
% \iftoggle{bbx:url}
% {\usebibmacro{url+urldate}}
% {}%
% \newunit\newblock
% \usebibmacro{addendum+pubstate}%
% \setunit{\bibpagerefpunct}\newblock
% \usebibmacro{pageref}%
% \newunit\newblock
% \usebibmacro{related}%
% \usebibmacro{finentry}
%}
% ... but according to <http://www.beuth.de/de/hilfe/hilfezitierenvonnormen>
% much less fields are required
\DeclareDatamodelEntrytypes{standard}
\DeclareDatamodelEntryfields[standard]{type,number}
\DeclareBibliographyDriver{standard}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\printfield{number}%
\setunit{\addspace}\newblock
\printfield[parens]{type}%
\newunit\newblock
\setunit{\labelnamepunct}\newblock
\usebibmacro{title}
\usebibmacro{finentry}
}
%% unfortunately then the entries are not sorted as one likes, because they are
%% sorted as "nty", so after "author, title, year" and not after the `number'
%% field
%% (have a look at section 4.5.5 "Sorting" (on page 183 of v3.4 of the manual))
%
%% this is the way how they should be sorted
%\DeclareSortingScheme{sortStandard}{
% \sort{
% \field{presort}
% }
% \sort[final]{
% \field{sortkey}
% }
% \sort{
% \field{number}
% }
% \sort{
% \field{sorttitle}
% \field{title}
% }
%}
%% ----- uncomment the following block which brings up the desired result -----
% but because there seems to be no way of applying this scheme to an `entrytype'
% the "standard" `nty' sorting scheme has to be modified and the fields which
% should not be used for `@standard' are excluded from sorting
%\DeclareSortingScheme{nty}{
% \sort{
% \field{presort}
% }
% \sort[final]{
% \field{sortkey}
% }
% \sort{
% \field{sortname}
% \field{author}
% \field{editor}
% \field{translator}
% \field{sorttitle}
% \field{title}
% % ----- addition(s) -----
% \field{number}
% % ---------------------
% }
% \sort{
% \field{sorttitle}
% \field{title}
% }
% \sort{
% \field{sortyear}
% \field{year}
% }
%}
%\DeclareSortExclusion{standard}{
% sortname,
% author,
% editor,
% translator,
% sorttitle,
% title,
% sortyear,
% year,
%}
%% ----------------------------------------------------------------------------
\begin{document}
\cite{ISO2240,ISO9660}
\printbibliography
\end{document}
number
fields in other entries which are not standards, then call the field something else likestandardnumber
and sort on that first.