0

This question already has an answer here:

Problem:

I want to sort my bib entries by author (a...z), year (ascending), month (ascending), day (ascending), title (a...z).

I customized my bib style with the help of @moewe and I think we broke the sorting thing.

I used the style=authortitle option of the biblatex package because I thought it was almost the output that I desire despite the sorting...

MWE:

\documentclass{article}

\usepackage[backend=biber,style=authortitle,citestyle=authortitle,hyperref=true,autocite=footnote,dashed=false,maxnames=3,sorting=nyt,sortlocale=de_DE]{biblatex}
\addbibresource{\jobname.bib}
\usepackage{filecontents}
\usepackage{array}
\usepackage{longtable}

\begin{filecontents}{\jobname.bib}
@online{chickenlittle,
    author      = {Jesus Bisbal and Deirdre Lawless and Bing Wu and Jane Grimson and Vincent Wade and Ray Richardson and Donie O'Sullivan},
    title       = {A Survey of Research into Legacy System Migration},
    shorttitle  = {Legacy Migration},
    institution = {Trinity College},
    publisher   = {Trinity College},
    year        = {1997},
    url         = {http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.50.9051},
    urldate     = {2018-07-11}
}

@online{incmigration,
    author      = {Michael L. Brodie and Michael Stonebraker},
    title       = {DARWIN: On the Incremental Migration of Legacy Information Systems 1},
    shorttitle  = {Incremental Migration},
    year        = {1993},
    institution = {University of California},
    publisher   = {University of California},
    month       = {3},
    urldate     = {2018-07-11},
    url         = {http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.70.2950}
}

@online{porting,
    author      = "{Microsoft Corporation}",
    title       = {Porting to .NET Core from .NET Framework},
    shorttitle  = {Porting in .NET},
    date        = {2016-06-20},
    url         = {https://docs.microsoft.com/en-us/dotnet/core/porting/},
    urldate     = {2018-06-26}
}
@online{netframeworkfirstrelease,
    author      = "{Microsoft Corporation}",
    title       = {.NET Framework Versions and Dependencies},
    shorttitle  = {.NET Framework Initial Release},
    date        = {2018-05-31},
    urldate     = {2018-07-09},
    url         = {https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/versions-and-dependencies}
}

@online{whatisdotnet,
    author      = "{Microsoft Corporation}",
    title       = {What is .NET?},
    shorttitle  = {What is .NET?},
    date        = {2018-07-06},
    urldate     = {2018-07-06},
    url         = {https://www.microsoft.com/net/learn/what-is-dotnet}
}

@online{azureiotedge,
    author      = "{Microsoft Corporation}",
    title       = {What is Azure IoT Edge},
    shorttitle  = {Azure IoT Edge},
    date        = {2018-06-12},
    urldate     = {2018-07-02},
    url         = {https://docs.microsoft.com/de-de/azure/iot-edge/about-iot-edge}
}

@online{netapianal,
    author      = "{Microsoft Corporation}",
    title       = {.NET API analyzer},
    shorttitle  = {.NET API analyzer},
    date        = {2018-07-02},
    urldate     = {2018-05-31},
    url         = {https://docs.microsoft.com/de-de/dotnet/standard/analyzers/api-analyzer}
}
\end{filecontents}



%**************************************************************
% Custom bibliography style
%
% This bibliography style only works because of the help of @moewe (https://tex.stackexchange.com/users/35864/moewe)
% Thank you @moewe!

% Delimitors
\DeclareDelimFormat[bib,biblist]{nametitledelim}{\addcolon\space}
\renewcommand{\newunitpunct}{\addcomma\space}
\DeclareDelimFormat{multinamedelim}{\addsemicolon\space}
\DeclareDelimAlias{finalnamedelim}{multinamedelim}

% Print always: authorlastname, authorfirstname
\DeclareNameAlias{sortname}{family-given}

% Shorttitle in parens
\DeclareFieldFormat*{shorttitle}{\mkbibparens{#1}}

% Removes url prefix
\DeclareFieldFormat{url}{\url{#1}}

% Adds o.J. if no date is given:
\newcommand{\noyear}{\addcomma \space o\adddot J\adddot}
\renewbibmacro*{date}{%
\iffieldundef{year}
    {\printtext{\noyear}}
    {\printdate}}

\makeatletter

% User-level command for printing tabular bibliography
\let\printbibtabular\printbibliography
\patchcmd{\printbibtabular}{\blx@printbibliography}{\bbx@printbibtabular}{}{}
\patchcmd{\printbibtabular}{\blx@printbibliography}{\bbx@printbibtabular}{}{}
\let\bbx@printbibtabular\blx@printbibliography
\patchcmd{\bbx@printbibtabular}{\blx@bibliography}{\bbx@bibtabular}{}{}
\patchcmd{\bbx@printbibtabular}
{\def\blx@theenv{bibliography}}{\def\blx@theenv{bibtabular}}{}{}


% Underlying macros
\def\bbx@bibtabular#1{%
\blx@langstrings
\blx@bibheading\blx@theheading\blx@thetitle
\blx@bibnote\blx@theprenote
\begingroup
\blx@bibinit
\let\@noitemerr\@empty
\let\blx@noitem\blx@warn@bibempty
\ifnum\bibinitsep=\z@
    \let\blx@initsep\relax
\fi
\ifnum\bibnamesep=\z@
    \let\blx@namesep\relax
\fi
\csuse{blx@hook@bibinit}%
\csuse{blx@hook@bibinit@next}%
% copy filtered list of entries to internal list macro
\def\blx@do##1{%
    \blx@ifdata{##1}{%
    \begingroup
    \blx@getdata{##1}%
    \blx@bibcheck
    \iftoggle{blx@skipentry}{}{%
        \global\let\blx@noitem\@empty
        \listadd\blx@tempa{##1}}%
    \endgroup}{}}%
\let\blx@done\relax
\blx@listloop{#1}%
% tabular output for each item in list macro
\def\do##1{\bbx@tab@label{##1} & \bbx@tab@item{##1}\\}%
\csuse{blx@env@\blx@theenv}%
\dolistloop{\blx@tempa}%
\csuse{blx@endenv@\blx@theenv}%
\blx@bibnote\blx@thepostnote
\endgroup
\endgroup% this closed a goup opened by \printbibtabular
}

\def\bbx@tab@label#1{%
\begingroup
\blx@getdata{#1}%
\blx@setdefaultrefcontext{#1}%
\blx@setoptions@type\abx@field@entrytype
\blx@setoptions@entry
\blx@thelabelnumber
\blx@initsep
\blx@namesep
\csuse{blx@hook@bibitem}%
\addtocounter{instcount}\@ne
\blx@anchor
\csuse{bbx@tabenv@\blx@theenv}\relax
\endgroup
}

\def\bbx@tab@item#1{%
\begingroup
\blx@getdata{#1}%
\blx@setoptions@type\abx@field@entrytype
\blx@setoptions@entry
\blx@thelabelnumber
\csuse{blx@hook@bibitem}%
\csuse{blx@item@\blx@theenv}\relax
\blx@execute
\blx@initunit
\blx@beglangbib
\bibsentence
\blx@pagetracker
\blx@driver\abx@field@entrytype
\blx@postpunct
\blx@endlangbib
\endgroup
}

% User-level command for defining tabular bibliography format
\newrobustcmd*{\defbibtabular}[5]{%
\long\csdef{blx@env@#1}{#2}%
\long\csdef{blx@endenv@#1}{#3}%
\long\csdef{bbx@tabenv@#1}{#4}%
\long\csdef{blx@item@#1}{#5}}

\makeatother

% Sortname labels (a robust style should add provision for missing labelnames)
\newbibmacro*{sortname}{%
\ifnameundef{labelname}
    {\printtext[bold]{No name given.}%
    \PackageWarning{biblatex}{No labelname for entry \thefield{entrykey},\MessageBreak
    we need to think of something else}}
    {\printnames[sortname]{labelname}%
    \iffieldequalstr{labelnamesource}{editor}
    {\setunit{\printdelim{editortypedelim}}%
        \usebibmacro{editor+othersstrg}}
    {\iffieldequalstr{labelnamesource}{translator}
        {\setunit{\printdelim{translatortypedelim}}%
        \usebibmacro{translator+othersstrg}}
        {}}}}

% Bibitem hook to suppress redundant sortname list
\newbibmacro*{omitsortname}{%
\ifnameundef{labelname}
    {}
    {\clearname{\thefield{labelnamesource}}}}

\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}p{#1}}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}p{#1}}
\newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}p{#1}}

% demo new tabular bibliography format
% I strongly prefer left-aligned with fixed width (L)
% over justified (p) here
% longtable for tables that break over pages
\defbibtabular{bibtabular}
{\def\arraystretch{2}%
\begin{longtable}{@{}L{\dimexpr0.25\textwidth-\tabcolsep\relax}L{\dimexpr0.75\textwidth-\tabcolsep\relax}@{}}}
{\end{longtable}}
{\usebibmacro{sortname}}
{\usebibmacro{omitsortname}}

\renewbibmacro*{begentry}{%
\printfield{shorttitle}%
\printunit*{\addspace}}
\begin{document}

\cite{porting,netframeworkfirstrelease,whatisdotnet,azureiotedge,netapianal}

\printbibtabular[title=Literaturverzeichnis]

\end{document}

Output:

Output

marked as duplicate by moewe biblatex Jul 14 '18 at 14:43

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • biblatex's standard sort schemes all sort only by year and do not consider month and day. See tex.stackexchange.com/q/46868/35864 please – moewe Jul 14 '18 at 14:16
  • @moewe I already tested this solution. It didn't work. – Skyfreak Jul 14 '18 at 14:18
  • @moewe Oops. It works. I made a mistake copying it into my project. Sorry for the inconvenience. – Skyfreak Jul 14 '18 at 14:24
  • I have just edited the answer to the linked question to conform with the syntax of the new biblatex versions. – moewe Jul 14 '18 at 14:42

Browse other questions tagged or ask your own question.