Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

In some academic circles, such as theoretical physics, during a presentation it is customary for the talking author to cite himself using only his initials, while leaving the remaining author names unchanged as per the citation style.

For instance, if my initials are DCG and I cite a paper that has me as an author, it should show up as:

[Lima, DCG, Horvath, 2010]

Is there any way to make this automatic in LaTeX? I use powerdot for presentations and natbib for references, and I have found nothing of the sort in their documentations. Maybe there is a way to replace the strings generated by BibTeX in the second LaTeX run, but I have no idea how to do it.

share|improve this question
1  
The easiest method is to modify the .bbl file when the presentation is complete and the .bbl file is in its definitive form. Otherwise it would be necessary to act on the .bib file. –  egreg Feb 11 '12 at 15:06
    
Yes, that would work, but I would like a more automatic method, such as a command to be introduced somewhere in the source code, so I don't have to worry about it later. –  Sir Whiteout Feb 11 '12 at 15:38
3  
This should easily be done with biblatex, which is easier to customize due to its use of LaTeX macros rather than the awkward bibtex language. –  Timothée Poisot Feb 11 '12 at 16:17
    
Some Biblatex solutions: tex.stackexchange.com/q/22135/10119, and I am sure it can be done with biber too… I just can't find the question where this was implemented. –  ienissei Apr 15 '12 at 7:03
add comment

1 Answer

up vote 6 down vote accepted

In relation to the comments I want to provide an approach using biblatex.

First of all I changed the definition of the output of authors and replace the name stored in \highlightname with the initials saved in the macro \shortform.

The main idea is inspired by P. Lehmann.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@Book{test1,
  author          = {Goossens, Michel and Mittelbach, Frank
                     and Samarin, Alexander},
  title           = {The LaTeX Companion},
  publisher       = {Addison-Wesley},
  location        = {Reading, Mass.},
  year            = {1994},

}

@Book{test2,
  author          = {Mittelbach, Frank and Goossens, Michel
                     and Samarin, Alexander},
  title           = {The LaTeX Companion},
  publisher       = {Addison-Wesley},
  location        = {Reading, Mass.},
  year            = {1994},

}

@Book{test3,
  author          = {Mittelbach, Frank and Samarin, Alexander
                     and Goossens, Michel},
  title           = {The LaTeX Companion},
  publisher       = {Addison-Wesley},
  location        = {Reading, Mass.},
  year            = {1994},
} 
\end{filecontents}
\usepackage[style=authoryear,minnames=8,maxnames=10]{biblatex}

\addbibresource{\jobname.bib}
\newcommand*{\mknamesignature}[5]{\def#1{#2|#3|#4|#5}}
\mknamesignature{\highlightname}{Goossens}{Michel}{}{}
\def\shortform{MG}
\makeatletter
\DeclareNameFormat{labelname}{%
  \begingroup
  \mknamesignature{\currentsignature}{#1}{#3}{#5}{#7}%
  \ifdefequal{\highlightname}{\currentsignature}%
    {\let\mkbibnamefirst=\@gobble%
     \def\mkbibnamelast{\shortform\@gobble}%
     \let\mkbibnameprefix=\@gobble%
     \let\mkbibnameaffix=\@gobble}%
    {}%
  \ifnum\value{listcount}=1\relax
    \usebibmacro{name:last-first}{#1}{#3}{#5}{#7}%
    \ifblank{#3#5}
      {}
      {\usebibmacro{name:revsdelim}}%
  \else
    \usebibmacro{name:first-last}{#1}{#3}{#5}{#7}%
  \fi
  % Ende der Gruppe
  \endgroup
  \usebibmacro{name:andothers}}
\makeatother
\begin{document}
Test

\cite{test1}

\cite{test2}

\cite{test3}

\printbibliography
\end{document}

enter image description here

EDIT 1: Fixed spacing problem

share|improve this answer
    
Nice solution. But it looks like there is a trailing white-space before MG on the first line. –  ienissei Apr 15 '12 at 6:56
    
@ienissei: Thanks. Fixed –  Marco Daniel Apr 15 '12 at 11:44
    
Great solution indeed. But how does it account for middle names? –  Sir Whiteout Sep 26 '12 at 17:40
    
@SirWhiteout: What do you mean? –  Marco Daniel Sep 27 '12 at 16:03
    
The above solution does not work if the name to be shortened includes a middle initial. Is there a specific field to put it, or does the code have to be changed further to be able to deal with it? –  Sir Whiteout Oct 1 '12 at 14:03
show 2 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.