I would like to show citations in text in the order I add them and in the reference table in alphabetical order. I have tried \newrefcontext but I get an error. Is there any other solution?
Here is the code:
\documentclass{article}
\usepackage[backend=bibtex,maxbibnames=5,maxcitenames=2,style=authoryear,citestyle=authoryear-comp,sorting=nyt,natbib=true,firstinits=true]{biblatex}
\begin{filecontents}{name.bib}
@book{denhartog_mechanical_1956,
title = {Mechanical {{Vibrations}}, {{Fourth Edition}}},
author = {Den Hartog, J. P},
year = {1956},
publisher = {{McGraw-Hill}}
}
@book{clough_dynamics_1975,
title = {Dynamics of {{Structures}}},
author = {Clough, Ray W. and Penzien, Joseph},
year = {1975},
publisher = {{McGraw-Hill}}
}
\end{filecontents}
\addbibresource{name.bib}
\begin{document}
\section*{Body}
Citations \autocite[e.g.,][]{denhartog_mechanical_1956,clough_dynamics_1975}.
\printbibliography[heading=bibintoc,title={References}]
\end{document}
Here is the result:
The reference table is fine but the citation order in the text is wrong. If I use sorting=none then I get the opposite result.

