von Gast » Di 14. Mär 2017, 16:10
Oh, interessant. Ich dachte irgendwie, dass beim Sortieren den Shorthands Vorrang gegeben würde. Dem ist aber nicht so.
Wenn ich mir das so ansehe, solltest Du auf das folgende umsteigen. Mit dem neuen Sortierschema wird das Literaturverzeichnis nach Autor/Jahr bzw. dem Shorthand sortiert, das entspricht (meist) der Ausgabe bei \cite.
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{csquotes}
\usepackage{filecontents}
\usepackage[backend=biber,citestyle=authoryear,bibstyle=authortitle, sorting=cnyt, dashed=false,%
maxcitenames=2,maxbibnames=99,uniquelist=false, uniquename=false, natbib=true, urldate=comp]{biblatex}
\AtBeginBibliography{\renewcommand*{\mkbibnamefamily}[1]{\textsc{#1}}}
\DeclareNameAlias{sortname}{family-given}
\setlength{\bibhang}{0pt}% wirklich nur wenns denn sein muss
\AtBeginBibliography{%
\renewcommand*{\multinamedelim}{\addsemicolon\space}%
\renewcommand*{\finalnamedelim}{\multinamedelim}}
% Siehe http://tex.stackexchange.com/q/11827/35864, plus ein paar Modifikationen
\newcounter{mymaxcitenames}
\AtBeginDocument{%
\setcounter{mymaxcitenames}{\value{maxnames}}%
}
\makeatletter
\renewbibmacro*{begentry}{%
\printtext[brackets]{\printtext[bold]{%
\begingroup
\renewcommand*{\multinamedelim}{\addcomma\space}%
\renewcommand*{\finalnamedelim}{%
\ifnumgreater{\value{liststop}}{2}{\finalandcomma}{}%
\addspace\bibstring{and}\space}%
\csuse{blx@hook@cite}%
\csuse{blx@hook@citekey}%
\citetrackerfalse\pagetrackerfalse\backtrackerfalse
\defcounter{maxnames}{\value{mymaxcitenames}}%
\usebibmacro{cite}%
\endgroup
}}%
\newline
}
\makeatother
\DefineBibliographyStrings{ngerman}{%
andothers = {et\addabbrvspace al\adddot},
urlseen = {Zugriff am},
urlfrom = {verfügbar unter},
}
\renewbibmacro*{issue+date}{%
\setunit{\addcomma\space}%
\printfield{issue}%
\setunit*{\addspace}%
\usebibmacro{date}%
\newunit}
\DeclareFieldFormat{urldate}{\mkbibbrackets{\bibstring{urlseen}\addcolon\space#1}}
\renewbibmacro*{date}{%
\printdate
\setunit{\addspace}%
\usebibmacro{urldate}}
\DeclareFieldFormat{url}{\bibstring{urlfrom}\addcolon\space\url{#1}}
\renewbibmacro*{url+urldate}{%
\usebibmacro{url}%
\iffieldundef{urlyear}}
\begin{filecontents}{\jobname.bib}
@misc{A01,
author = {Schmidt, A. and Schneider, B.},
year = {2001},
title = {Alpha},
}
@misc{A02,
author = {Meier, A. and Mueller, B. and J, Kurt},
year = {2001},
title = {Alpha},
}
@misc{A03,
author = {Lens,Markus},
year = {2001},
title = {Alpha},
}
@article{wenz,
author = {Karin Wenz},
title = {Formen der Mündlichkeit und Schriftlichkeit in digitalen Medien},
journal = {Linguistik Online},
volume = {1},
number = {1},
date = {1998-11-19},
% issn = {1615-3014},
url = {https://bop.unibe.ch/linguistik-online/article/view/1085},
urldate = {2017-03-09},
% doi = {10.13092/lo.1.10850},
}
@standard{DIN66001,
title = {Informationsverarbeitung; Sinnbilder und ihre Anwendung},
date = {1983-12},
institution = {DIN},
type={Norm},
number = {66001},
}
@standard{VDI2860,
title = {Montage- und Handhabungstechnik; Handhabungsfunktionen, Handhabungseinrichtungen; Begriffe, Definitionen, Symbole},
date = {1990-05},
institution = {VDI},
type={Richtlinie},
number = {2860},
}
\end{filecontents}
\DeclareSourcemap{
\maps[datatype=bibtex]{
\map[overwrite=true]{
\pertype{standard}
\step[fieldsource=institution, match=\regexp{\ADIN\Z}, final]
\step[fieldset=shorthand, origfieldval]
\step[fieldsource=number, final]
\step[fieldset=shorthand, origfieldval, append]
\step[fieldset=shorthand, fieldvalue={:}, append]
\step[fieldsource=date, match=\regexp{\A[0-9]{2}([0-9]{2})}]
\step[fieldset=shorthand, fieldvalue={$1}, append]
}
\map[overwrite=true]{
\pertype{standard}
\step[fieldsource=institution, match=\regexp{\AVDI\Z}, final]
\step[fieldset=shorthand, origfieldval]
\step[fieldset=shorthand, fieldvalue={~}, append]
\step[fieldsource=number, final]
\step[fieldset=shorthand, origfieldval, append]
}
}
}
\DeclareSortingScheme{cnyt}{
\sort{
\field{presort}
}
\sort[final]{
\field{sortkey}
\field{shorthand}
}
\sort{
\field{sortname}
\field{author}
\field{editor}
\field{translator}
\field{sorttitle}
\field{title}
}
\sort{
\field{sortyear}
\field{year}
}
\sort{
\field{sorttitle}
\field{title}
}
\sort{
\field{volume}
\literal{0}
}
}
\DeclareBibliographyDriver{standard}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\printfield{type}%
\setunit{\addspace}\newblock
\printlist{institution}%
\setunit{\addspace}
\printfield{number}%
\setunit{\addspace}\newblock
\printfield{month}%
\setunit{\addspace}
\printfield{year}%
\newunit\newblock
\usebibmacro{title}%
\usebibmacro{finentry}}
\addbibresource{\jobname.bib}
\begin{document}
\cite{A01,A02,A03,wenz,DIN66001,VDI2860}
\printbibliography[title=Literaturverzeichnis]
\end{document}
Beachte das sorting=cnyt und \DeclareSortingScheme{cnyt}.
Alternativ geht mit dem alten Code auch nur
\DeclareSourcemap{
\maps[datatype=bibtex]{
\map[overwrite=true]{
\pertype{standard}
\step[fieldsource=institution, match=\regexp{\ADIN\Z}, final]
\step[fieldset=shorthand, origfieldval]
\step[fieldsource=number, final]
\step[fieldset=shorthand, origfieldval, append]
\step[fieldset=shorthand, fieldvalue={:}, append]
\step[fieldsource=date, match=\regexp{\A[0-9]{2}([0-9]{2})}]
\step[fieldset=shorthand, fieldvalue={$1}, append]
\step[fieldsource=shorthand]
\step[fieldset=sortkey, origfieldval]
}
\map[overwrite=true]{
\pertype{standard}
\step[fieldsource=institution, match=\regexp{\AVDI\Z}, final]
\step[fieldset=shorthand, origfieldval]
\step[fieldset=shorthand, fieldvalue={~}, append]
\step[fieldsource=number, final]
\step[fieldset=shorthand, origfieldval, append]
\step[fieldsource=shorthand]
\step[fieldset=sortkey, origfieldval]
}
}
}
Da wird einfach das Shorthand in Sortkey kopiert, was dann zum Sortieren genutzt wird. Das löst das Problem mit shorthand, nicht aber, dass Du 'Name->Titel->Jahr' sortierst, obwohl Deine Bibliographie auf 'Name->Jahr->Titel' ausgelegt ist.
Oh, interessant. Ich dachte irgendwie, dass beim Sortieren den Shorthands Vorrang gegeben würde. Dem ist aber nicht so.
Wenn ich mir das so ansehe, solltest Du auf das folgende umsteigen. Mit dem neuen Sortierschema wird das Literaturverzeichnis nach Autor/Jahr bzw. dem Shorthand sortiert, das entspricht (meist) der Ausgabe bei [tt]\cite[/tt].
[code]\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{csquotes}
\usepackage{filecontents}
\usepackage[backend=biber,citestyle=authoryear,bibstyle=authortitle, sorting=cnyt, dashed=false,%
maxcitenames=2,maxbibnames=99,uniquelist=false, uniquename=false, natbib=true, urldate=comp]{biblatex}
\AtBeginBibliography{\renewcommand*{\mkbibnamefamily}[1]{\textsc{#1}}}
\DeclareNameAlias{sortname}{family-given}
\setlength{\bibhang}{0pt}% wirklich nur wenns denn sein muss
\AtBeginBibliography{%
\renewcommand*{\multinamedelim}{\addsemicolon\space}%
\renewcommand*{\finalnamedelim}{\multinamedelim}}
% Siehe http://tex.stackexchange.com/q/11827/35864, plus ein paar Modifikationen
\newcounter{mymaxcitenames}
\AtBeginDocument{%
\setcounter{mymaxcitenames}{\value{maxnames}}%
}
\makeatletter
\renewbibmacro*{begentry}{%
\printtext[brackets]{\printtext[bold]{%
\begingroup
\renewcommand*{\multinamedelim}{\addcomma\space}%
\renewcommand*{\finalnamedelim}{%
\ifnumgreater{\value{liststop}}{2}{\finalandcomma}{}%
\addspace\bibstring{and}\space}%
\csuse{blx@hook@cite}%
\csuse{blx@hook@citekey}%
\citetrackerfalse\pagetrackerfalse\backtrackerfalse
\defcounter{maxnames}{\value{mymaxcitenames}}%
\usebibmacro{cite}%
\endgroup
}}%
\newline
}
\makeatother
\DefineBibliographyStrings{ngerman}{%
andothers = {et\addabbrvspace al\adddot},
urlseen = {Zugriff am},
urlfrom = {verfügbar unter},
}
\renewbibmacro*{issue+date}{%
\setunit{\addcomma\space}%
\printfield{issue}%
\setunit*{\addspace}%
\usebibmacro{date}%
\newunit}
\DeclareFieldFormat{urldate}{\mkbibbrackets{\bibstring{urlseen}\addcolon\space#1}}
\renewbibmacro*{date}{%
\printdate
\setunit{\addspace}%
\usebibmacro{urldate}}
\DeclareFieldFormat{url}{\bibstring{urlfrom}\addcolon\space\url{#1}}
\renewbibmacro*{url+urldate}{%
\usebibmacro{url}%
\iffieldundef{urlyear}}
\begin{filecontents}{\jobname.bib}
@misc{A01,
author = {Schmidt, A. and Schneider, B.},
year = {2001},
title = {Alpha},
}
@misc{A02,
author = {Meier, A. and Mueller, B. and J, Kurt},
year = {2001},
title = {Alpha},
}
@misc{A03,
author = {Lens,Markus},
year = {2001},
title = {Alpha},
}
@article{wenz,
author = {Karin Wenz},
title = {Formen der Mündlichkeit und Schriftlichkeit in digitalen Medien},
journal = {Linguistik Online},
volume = {1},
number = {1},
date = {1998-11-19},
% issn = {1615-3014},
url = {https://bop.unibe.ch/linguistik-online/article/view/1085},
urldate = {2017-03-09},
% doi = {10.13092/lo.1.10850},
}
@standard{DIN66001,
title = {Informationsverarbeitung; Sinnbilder und ihre Anwendung},
date = {1983-12},
institution = {DIN},
type={Norm},
number = {66001},
}
@standard{VDI2860,
title = {Montage- und Handhabungstechnik; Handhabungsfunktionen, Handhabungseinrichtungen; Begriffe, Definitionen, Symbole},
date = {1990-05},
institution = {VDI},
type={Richtlinie},
number = {2860},
}
\end{filecontents}
\DeclareSourcemap{
\maps[datatype=bibtex]{
\map[overwrite=true]{
\pertype{standard}
\step[fieldsource=institution, match=\regexp{\ADIN\Z}, final]
\step[fieldset=shorthand, origfieldval]
\step[fieldsource=number, final]
\step[fieldset=shorthand, origfieldval, append]
\step[fieldset=shorthand, fieldvalue={:}, append]
\step[fieldsource=date, match=\regexp{\A[0-9]{2}([0-9]{2})}]
\step[fieldset=shorthand, fieldvalue={$1}, append]
}
\map[overwrite=true]{
\pertype{standard}
\step[fieldsource=institution, match=\regexp{\AVDI\Z}, final]
\step[fieldset=shorthand, origfieldval]
\step[fieldset=shorthand, fieldvalue={~}, append]
\step[fieldsource=number, final]
\step[fieldset=shorthand, origfieldval, append]
}
}
}
\DeclareSortingScheme{cnyt}{
\sort{
\field{presort}
}
\sort[final]{
\field{sortkey}
\field{shorthand}
}
\sort{
\field{sortname}
\field{author}
\field{editor}
\field{translator}
\field{sorttitle}
\field{title}
}
\sort{
\field{sortyear}
\field{year}
}
\sort{
\field{sorttitle}
\field{title}
}
\sort{
\field{volume}
\literal{0}
}
}
\DeclareBibliographyDriver{standard}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\printfield{type}%
\setunit{\addspace}\newblock
\printlist{institution}%
\setunit{\addspace}
\printfield{number}%
\setunit{\addspace}\newblock
\printfield{month}%
\setunit{\addspace}
\printfield{year}%
\newunit\newblock
\usebibmacro{title}%
\usebibmacro{finentry}}
\addbibresource{\jobname.bib}
\begin{document}
\cite{A01,A02,A03,wenz,DIN66001,VDI2860}
\printbibliography[title=Literaturverzeichnis]
\end{document}[/code]
Beachte das [tt]sorting=cnyt[/tt] und [tt]\DeclareSortingScheme{cnyt}[/tt].
Alternativ geht mit dem alten Code auch nur
[code]\DeclareSourcemap{
\maps[datatype=bibtex]{
\map[overwrite=true]{
\pertype{standard}
\step[fieldsource=institution, match=\regexp{\ADIN\Z}, final]
\step[fieldset=shorthand, origfieldval]
\step[fieldsource=number, final]
\step[fieldset=shorthand, origfieldval, append]
\step[fieldset=shorthand, fieldvalue={:}, append]
\step[fieldsource=date, match=\regexp{\A[0-9]{2}([0-9]{2})}]
\step[fieldset=shorthand, fieldvalue={$1}, append]
\step[fieldsource=shorthand]
\step[fieldset=sortkey, origfieldval]
}
\map[overwrite=true]{
\pertype{standard}
\step[fieldsource=institution, match=\regexp{\AVDI\Z}, final]
\step[fieldset=shorthand, origfieldval]
\step[fieldset=shorthand, fieldvalue={~}, append]
\step[fieldsource=number, final]
\step[fieldset=shorthand, origfieldval, append]
\step[fieldsource=shorthand]
\step[fieldset=sortkey, origfieldval]
}
}
}[/code]
Da wird einfach das Shorthand in Sortkey kopiert, was dann zum Sortieren genutzt wird. Das löst das Problem mit shorthand, nicht aber, dass Du 'Name->Titel->Jahr' sortierst, obwohl Deine Bibliographie auf 'Name->Jahr->Titel' ausgelegt ist.