Skip to content

Instantly share code, notes, and snippets.

@bjoseru
Last active August 29, 2015 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjoseru/2474626f727c3c87433b to your computer and use it in GitHub Desktop.
Save bjoseru/2474626f727c3c87433b to your computer and use it in GitHub Desktop.
A minimal working example of an alphabetically sorted bibliography (compatible with bibtex) that stops working once the babel package is included.
\ProvidesFile{bib.lco}
%
% Provide a bibliography for letters that is numbered alphabetically.
% This file is in the public domain and it can be included in letters
% written in the scrlttr2-class by stating it as an option. See
% `letter class options` in the KOMA guide.
%
% Some of the following is taken from
% http://tex.stackexchange.com/questions/18033/using-bibtex-with-letter-class
% but see also
% http://tex.stackexchange.com/questions/213453/custom-thebibliography-with-alphabetic-numbering-for-scrltt2-not-working-in-pre
% and
% http://bjoernstechblog.rueffer.info/posts/latex/letters/bibliography/2014/11/23/Alphabetically-numbered-references-in-latex-letters/
% for more discussions.
\makeatletter
\newenvironment{thebibliography}[1]
{\list{\@biblabel{\@Alph\c@enumiv}}% LATIN LETTERS AS REFERENCES
{\settowidth\labelwidth{\@biblabel{#1}}%
\leftmargin\labelwidth
\advance\leftmargin\labelsep
\usecounter{enumiv}%
\let\p@enumiv\@empty
\renewcommand\theenumiv{\@Alph\c@enumiv}}% SAME HERE
\sloppy
\clubpenalty4000
\@clubpenalty \clubpenalty
\widowpenalty4000%
\sfcode`\.\@m}
{\def\@noitemerr
{\@latex@warning{Empty `thebibliography' environment}}%
\endlist}
\newcommand\newblock{\hskip .11em\@plus.33em\@minus.07em}
\let\bibsection\relax
\def\section*#1{\relax}
\def\@cite@ofmt#1{\def\@safe@activesfalse{}%
\hbox{\@Alph{#1}}}
\makeatother
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment