# Abbreviate own name

I am using \usepackage[backend=biber, style=authoryear]{biblatex} but I would like my name to appear as a dash or even better would be the first initial of my surname. That is I would like to see (-, Leibniz and Newton 1661) or (C., Leibniz and Newton 1661) inline. I am happy to have the full version in the references section at the end. Is there a way to do this?

-
Could you not just use a copy of your .bib file where you search&replace'd your name with -- or maybe some macro? –  Martin Scharrer Jul 2 '11 at 14:59
Yes and I think the macro solution may be the simplest all round in the end. –  Raphael Jul 2 '11 at 15:33
Oh actually that's not quite so obvious as you don't want the abbreviated version in the references at the end. –  Raphael Jul 2 '11 at 15:57
Then simply change the macro before the reference list. –  Martin Scharrer Jul 2 '11 at 17:04
show 1 more comment

Biber 0.9.4/biblatex 1.6 are now released and this should now be possible as every single name has a name hash now, in addition to the name list as a whole having a hash. See the field "hash" in section 4.2.4.1 of the biblatex 1.6 manual.

Something like this seems to work. Use the commented lines instead of those immediately below them to use a dash instead of initials.

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[backend=biber,style=authoryear]{biblatex}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@BOOK{test1,
AUTHOR      = {Raphael Clifford and John Doe},
TITLE       = {Eliding My Self},
PUBLISHER   = {Publisher},
LOCATION    = {Elidington},
YEAR        = {1968},
}
@BOOK{test2,
AUTHOR      = {Brian Blinkers and Cecil Crenshaw and Raphael Clifford},
TITLE       = {Eliding My Self Again},
PUBLISHER   = {Publisher},
LOCATION    = {Elidington},
YEAR        = {1969},
}
@BOOK{test3,
AUTHOR      = {Brian Blinkers and Raphael Clifford and Cecil Crenshaw},
TITLE       = {Eliding My Self Once More},
PUBLISHER   = {Publisher},
LOCATION    = {Elidington},
YEAR        = {1970},
}
\end{filecontents}

\newbibmacro*{name:me}[1]{%
\usebibmacro{name:delim}{#1}%
\usebibmacro{name:hook}{#1}%
\mkbibnamelast{#1}}%

\DeclareNameFormat{labelname}{%
\iffieldequals{hash}{\mehash}%
%    {\usebibmacro{name:me}{\bibrangedash}}%
{\usebibmacro{name:me}{#2}}%
{\ifboolexpr{ test {\ifstrequal{#1}{Clifford}} and test {\ifstrequal{#3}{Raphael}}}
%      {\savefield{hash}{\mehash}\usebibmacro{name:me}{\bibrangedash}}%
{\savefield{hash}{\mehash}\usebibmacro{name:me}{#2}}%
{\ifcase\value{uniquename}%
\usebibmacro{name:last}{#1}{#3}{#5}{#7}%
\or
\ifuseprefix
{\usebibmacro{name:first-last}{#1}{#4}{#5}{#8}}
{\usebibmacro{name:first-last}{#1}{#4}{#6}{#8}}%
\or
\usebibmacro{name:first-last}{#1}{#3}{#5}{#7}%
\fi
\usebibmacro{name:andothers}}}}%

\begin{document}
\cite{test1}\\
\cite{test2}\\
\cite{test3}
\printbibliography
\end{document}

-
That's very interesting, thanks. –  Raphael Jul 4 '11 at 21:28
biblatex 1.6/biber 0.9.4 will be released shortly. In addition to a name list having a unique hash as is currently the case, every individual name in a name list will also have a unique hash which can be used to perform such tests as are required here. –  PLK Jul 24 '11 at 16:56
Thanks! Now Biber 0.9.4/biblatex 1.6 are out, would you be able to add an example of how to solve the problem using them to your answer? –  Raphael Aug 1 '11 at 14:33

Use the shortauthor field.

\documentclass{article}

\usepackage[style=authoryear]{biblatex}

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@misc{C11,
author = {Clifford, Raphael},
shortauthor = {{---}},
year = {2011},
title = {How to change one's own name to a dash},
}
\end{filecontents}

\begin{document}

Some text \autocite{C11}.

\printbibliography

\end{document}

-
How have you specified that the short form should be used? –  Raphael Jul 2 '11 at 13:50
shortauthor will always be used in citations if the field is defined. –  lockstep Jul 2 '11 at 13:57
Ah OK. I think this means two things. First that I need to write a program to go through my bib file and take every author line and add a duplicate shortauthor line just after it with my name changed to its abbreviated form. Second, it's going to be hard to share a bib file with lots of people after doing that and all be able to use the shorthand only for their own names when they write papers. Maybe there is nothing that can be done about this. I can imagine a hack where all author names are macros but this seems rather ugly, to say the least. –  Raphael Jul 2 '11 at 14:01
My solution wasn't meant for "shared" .bib files. It may be possible to come up with a bib-independent solution, but I can't promise anything. –  lockstep Jul 2 '11 at 14:04
BTW, should your name also be replaced with a dash if you're one of the authors of a multi-author-work? (This would make a bib-independent solution harder.) –  lockstep Jul 2 '11 at 14:13
show 1 more comment


-
Thanks. As you say, the problem with not being able to parse the name makes it a bit of a hack in the end. Hopefully 0.9.4 will make things easier as mentioned by PLK. –  Raphael Jul 4 '11 at 21:30