I would like to cite my references in a document alphabetically by author's last name. I am using BibTek and the plain bibliography style.
Here is a MWE using the plain bibliography style:
\documentclass [12pt]{report}
\usepackage{hyperref}
\begin{document}
\cite{CMR}
\cite{stacks}
\cite{CotComplex}
\cite{CTC}
\bibliographystyle{plain}
\bibliography{testbib}
\end{document}
@book{CMR,
author = {Jürgen H. Herzog and Bruns Winfried},
city = {Cambridge{,} UK},
edition = {1st},
month = {December},
publisher = {Cambridge University Press},
title = {Cohen-Macaulay Rings},
year = {2009}}
@misc{stacks,
author = {The Stacks Project authors},
title = {The {S}tacks {P}roject},
howpublished = {\url{https://stacks.math.columbia.edu}},
year = {2023}}
@misc{CTC,
author = {nLab authors},
title = {Cotangent complex},
howpublished = {\url{https://ncatlab.org/nlab/show/cotangent+complex}},
version = {21}
}
@article{CotComplex,
title={The cotangent complex of a morphism},
volume={128},
DOI={10.1090/s0002-9947-1967-0209339-1},
number={1},
journal={Transactions of the American Mathematical Society},
author={Stephen Lichtenbaum and Michael Schlessinger},
year={1967},
pages={41–70}}
This mostly works. The only problem is the exceptional entries (the Stacks Project and nLab). The Stacks Project entry seems to get sorted as if the author's last name was "author", while the nLab entry seems to get sorted as if the author's last name was "nLab". Ideally I would like these two citations to appear last. How can I create such exceptions? Thanks.

author = {{The Stacks Project authors}},andauthor = {{nLab authors}},. (On the other handauthor = {Jürgen H. Herzog and Bruns Winfried},is perfectly fine and should remain as-is.) See https://tex.stackexchange.com/q/10808/35864. If you had used a style that inverts names into "family, given" order, you'd have gotten nonsensical output, like "authors, nLab" from the versions without curly braces. – moewe May 30 '23 at 07:29