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.

I am LaTeX newbie so please bare with me. I would like to have citations in following format:

e.g. "Bauer et al. (1988) [1]" 
so "1st Author et al. (year of publishing) [number in references]".

Thus I would like to have both numbered references and also citations which contain the first author's name

e.g. [1] David S. Bauer and Michael E. Koblentz. NIDX-an expert system ...

As you can see from the code bellow I use macro

\DeclareRobustCommand{\citeext}[1]{\citeauthor{#1}~\citeyearpar{#1}~\cite{#1}}

according to Wiki LaTex Bibliography Management \citeauthor (without *) and \citeyearpar should work as I expect, but currently I get the citations in following format:

David S. Bauer and Michael E. Koblentz [1988] [2]

There are two main problems:

  1. Why are square brackets around the year of publishing instead of round brackets?
  2. Why are the full names of the authors displayed instead of just the name of the first author (other authors should be displayed like "et al.")?

MWE:

\documentclass[11pt]{article}

\usepackage[sort&compress,numbers,square,comma,numbers]{natbib}

% makro by which I can cite both author and year simultaneously
% ~ - tilde represent space
\DeclareRobustCommand{\citeext}[1]{\citeauthor{#1}~\citeyearpar{#1}~\cite{#1}}
% what is #1 argument
% this is an macro and I see that citep and citet have troubles so better not use but what is citep vs. citeauthor?

% makes color citations
\usepackage[dvips,dvipdfm,colorlinks=true,urlcolor=blue,citecolor=red,linkcolor=red,bookmarks=true]{hyperref}

% document begin
\begin{document}

% author and title
\title{Work}
\author{Author1 \and Author2\v{C}\'y}
\date{\today}
%\                  this adds empty page to beginning
\maketitle
\pagebreak
%\newline

Bauer (IV.) citation \citeext{Bauer1988}. Anderson (I.) citation \citeext{Anderson1980}. Landwehr (II.) citation \citeext{Landwehr1981}. Denning (III.) citation \citeext{Denning1987}. \citeext{Anderson1981}

% this must be set to use natbib (citep, citet) but requires BibTeX
\bibliographystyle{plainnat}
\bibliography{bibliography}

\end{document}

PS: I based my solution on this post: citet and citep behaves like cite.

share|improve this question
1  
The purpose of a author-year citation style is to get rid of the reference numbers. If you already see "author and year", then you know how to find it in the bibliography without the need for the number. –  egreg Nov 19 '12 at 17:22
    
Welcome to TeX.sx! Usually, we don't put a greeting or a "thank you" in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Upvoting is the preferred way here to say "thank you" to users who helped you. –  Guido Nov 19 '12 at 17:52
add comment

1 Answer 1

Finally I figured it out, nearly immediately after posting :)

\DeclareRobustCommand{\citeext}[1]{\citeauthor{#1}~(\citeyear{#1})~\cite{#1}}

does the magic. Before I had tried some hacking with \setcitestyle but it did not work. One question remains: Why are the names of all authors displayed in the citation?

share|improve this answer
    
If you don't show an extract from the bibliography.bib file it's impossible to answer. –  egreg Nov 19 '12 at 17:39
    
here is content of bibliography.bib file pastebin. Forgive my ignorance but as I am writing this comment I have left only 600 characters, is it OK or does it have something common with karma (reputation) etc. that newbies cannot wwrite more ? –  Wakan Tanka Nov 19 '12 at 19:58
    
@WakanTanka: Comments are that short for everyone here, but you could edit your question to contain a) your answer and b) the bibliography.bib. –  Stephen Nov 19 '12 at 20:15
    
Here's what I get: Bauer (IV.) citation Bauer and Koblentz (1988) [3]. Anderson (I.) citation Anderson (1980) [1]. Landwehr (II.) citation Landwehr (1981) [5]. Denning (III.) citation Denning (1987) [4]. Anderson (1980) [2] –  egreg Nov 19 '12 at 20:29
    
@egreg I apologize guys my mistake. Did not realized that there must be more than 2 authors to use "et al. notation". When I edited the citation like this ` author = {Bauer, David S. and Koblentz, Michael E. and ThirdSurname, ThirdForename},` Finnaly I get "Bauer et al." @Stephen when I will edit my original post wont be there such a mess in posts ? Sorry again guys. –  Wakan Tanka Nov 19 '12 at 20:58
show 1 more comment

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.