# Dates for unpublished papers in amsrefs

I've recently started using amsrefs to do my bibliographies, which I like to do in alphabetic style (e.g., [Abc12]). Now amsrefs seems to require a numeric date field for each entry, but the issue is that when these get cited in text, the last 2 digits of the year appear, giving these unpublished papers (what is in my mind) the appearance of published papers (and possibly that they appeared before other published works from which they derived). (I don't remember having this issue when I use bibtex, but for some documents I'd prefer using amsrefs.)

Right now, I am manually resetting the labels in each entry for the unpublished papers (e.g., label={Abc}), but my question is: is there a better (more automated) solution (with amsrefs)? Ideally, I'd like the year field not required (so the year for unpublished papers does not appear in the bibliographic entry either), but I would also be interested in a way to semi-automatically separate the citation labelling for unpublished papers versus published papers. Maybe a modified alphabetic bibliography style?

Edit Here is sample code for what I am doing.


\documentclass{article}
\usepackage{amsrefs}

\begin{document}

This essay will attempt to refute some claims made in \cite{potter}.

\begin{bibdiv}
\begin{biblist}*{labels={alphabetic}}

\bib{potter}{article}{
author={Potter, Harry},
title={A better approach to horocruxes},
status={preprint},
year={2014},
%   label={Pot} %to force label
}

\end{biblist}
\end{bibdiv}
\end{document}

• Welcome to TeX.SX! It is always a good idea to give a minimal working example (MWE) demonstrating the problem. – Andrew Swann Jan 27 '15 at 16:28
• @AndrewSwann Thanks for the comment. By the way, how do people usually insert multiple lines of code? When I clicked on the code button or hit <ctrl-k> in the edit window and tried to copy and paste, I could only get the first line in the code environment. I ended up typing the <pre><code> and </code></pre> tags manually, but it was unclear at first that I could do this. – Kimball Jan 27 '15 at 16:57
• Mark/highlight the pasted code and hit CTRL-k, that Is what I usually do. – daleif Jan 27 '15 at 16:58
• @daleif ah, thanks. I tried it and that worked. – Kimball Jan 28 '15 at 2:03

Here is a work around/fix. I have added a test in the code for generating the short year to check that the year is at least 10 so has at least 2 digits.

\documentclass{article}
\usepackage{amsrefs}

\makeatletter
\def\append@label@year@{%
\safe@set\@tempcnta\bib@year
\edef\bib@citeyear{\the\@tempcnta}%
\ifnum\bib@citeyear>9
\append@to@stem{%
\ifx\bib@year\@empty
\else
\@xp\year@short \bib@citeyear \@nil
\fi
}%
\fi
}
\makeatother

\begin{document}

This essay will attempt to refute some claims made in \cite{potter}.

\begin{bibdiv}
\begin{biblist}*{labels={alphabetic}}

\bib{potter}{article}{
author={Potter, Harry},
title={A better approach to horocruxes},
status={preprint},
}

\bib{author}{article}{
author={Author, X.},
title={Title},
journal={J. J.},
year={2005},
volume={10},
pages={5-6},
}

\end{biblist}
\end{bibdiv}
\end{document}