2

I need to meet my university's requirements for a thesis. What I need seems to be simple but I haven't found a direct way to do it.

What I need

  • In the text, the citation must have the first three letters of the author's last name in capitals, followed by the year in four-digits format, all enclosed in square parentheses.

  • In case the same author has two works in the same year, they must add a letter starting by a (useful whenever the combination "ABCYYYY" is repeated).

  • In the bibliography, the references must show the same label followed by its definition indicating:
    Last name, First name, "Document title in quotes and italic", publisher, year

Example (bold only for visualization):

Text:

Lorem ipsum dolor sit amet, consectetur adipiscing elit
[JON2003]. Vivamus eget ipsum eget eros tempor malesuada
[WIN2001a]. Pellentesque ullamcorper sit amet neque a 
viverra [WIN2001b].

Bibliography:

[**JON**2003]      **Jon**es, Eric S.,*"How to use LaTeX"*,
               Prentice-Hall, 1990.
[**WIN**2001a]     **Win**g, Alice B., *"Some book about citations"*,
               Ra-Ma,2001.
[**WIN**2001b]     **Win**g, Alice B., *"Citations for dummies"*,
               Ra-Ma,2001.

What I have

My .tex with this:

\usepackage{natbib}
...
\begin{document}
...
\cite{label_1}
...
\bibliographystyle{alpha}
\bibliography{bib_file}

and a bib_file.bib file with this format

@book{label_1,  
  title = {Book title},
  author = {LName,FName},
  series = {series name},
  publisher = {publisher name},
  year = {some year in yyyy format}
}

What I get

Citations like [ABC...YY] where A, B, C... are the last name initials of the authors, and YY is the year in two digits format.

Finally, thanks for your time.

1 Answer 1

5

This is not very simple to do with natbib, I think, but it's easy to do with biblatex and using Biber to process the .bib file. Here's a sample document:

\documentclass{article}
\usepackage[style=alphabetic]{biblatex}
\addbibresource{biblatex-examples.bib}


\DeclareLabelalphaTemplate{
 \labelelement{
    \field[final]{shorthand}
    \field{label}
    \field[strwidth=3,strside=left,ifnames=1,uppercase=true]{labelname}
    \field[strwidth=1,strside=left]{labelname}
          }
 \labelelement{
    \field[strwidth=4,strside=right]{year}
          }
}
% Author names Last, First
\DeclareNameAlias{author}{sortname}
\DeclareNameAlias{editor}{sortname}
\DeclareNameAlias{translator}{sortname}
\begin{document}
\cite{knuth:ct:a,knuth:ct:b,knuth:ct:c,baez/article,baez/online}
\printbibliography
\end{document}

The alphabetic style produces labels based on the first three letters of single author names or the first letter of each author for multiple author names. The number of authors from which the key is built is set by the package option maxalphanames. If set this to 1 then only the first three letters of the first author will appear in the key.

Note also that the alphabetic style uses a + sign to indicate that a citation contains multiple authors. This allows you to distinguish in the citations between e.g. [AUT2001] (a single authored work) and [AUT+2001] (a multi-authored work). If you set maxalphanames=1 then all multi-authored works will appear with the plus sign.

To remove the plus sign, redefine the macro \labelalphaothers in your preamble after loading biblatex.

\renewcommand{\labelalphaothers}{}

To display all author names in full in the bibliography, add maxnames=99 to your package options.

This solution requires using biber to process the bibliography not bibtex so you may need to find out how to get your editor to do that for you, but it should not be hard. See the following for instructions for many popular editors.

output of code

10
  • 1
    First first things: you are my hero, thanks a lot, you made me happy. Second, I was using Gummi IDE, it is practical and tiny, but it was preventing me to run biber, so now I use TeXWorks and following this guide I was able to run biber from the editor. I am very grateful for your help.
    – onlycparra
    Commented Dec 28, 2015 at 5:14
  • I have noticed a little issue, if I have multiple authors like author = {LUQUE, IRENE and GÓMEZ, MIGUEL} then the cite is shown like this [LUQ+2001]. How can I remove that plus sign?. Also, in the bibliography, instead of IRENE LUKE, MIGUEL GÓMEZ it shows IRENE LUKE and col.. How can I show all authors?. Thanks
    – onlycparra
    Commented Dec 28, 2015 at 6:40
  • 1
    To show all authors, set maxnames=99 as an option on loading biblatex. For the first question, how do you make the difference between LUQ2001 (several authors) and LUQ2001 (only Luque is an author)?
    – Bernard
    Commented Dec 28, 2015 at 11:12
  • That is a good question, they don't actually specify it! Probably the notation generated by latex is right, for me, it is done just like you did, but I need to meet that format. :/
    – onlycparra
    Commented Dec 28, 2015 at 23:03
  • I hate to reopen this, but I have seen that the solution you present me has a little difference with the one I need: what we have: author: Noël Novelli y Rosine Cicchetti, label [NC2001]. What I need: Noël Novelli y Rosine Cicchetti, label [NOV2001]. Thanks again for your time
    – onlycparra
    Commented Jan 2, 2016 at 16:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .