Capital names for author names in citation call-out, normal letters in bibliography
If you switch to BibLaTeX, you will be able to do both things very easily:
\documentclass[12pt,a4paper]{report}
\usepackage[latin1]{inputenc}
\usepackage[style=authoryear, backend=biber]{biblatex}
\addbibresource{bibfile.bib}
%Authors in upper case in citations, normal font in bibliography
\renewcommand{\mkbibnamefamily}[1]{\ifcitation{\MakeUppercase{#1}}{#1}}
\renewcommand{\mkbibnameprefix}[1]{\ifcitation{\MakeUppercase{#1}}{#1}}
%Hyphen between author names
\renewcommand{\multinamedelim}{\space--\space}
\renewcommand{\finalnamedelim}{\space--\space}
\begin{document}
blablabalbal \textcite{aas2004modelling}
\printbibliography
\end{document}
EDIT: Author name formatting streamlined. Thanks to Marco Daniel for pointing out the existence of the ifcitation
command.
You can do it with macros, without changing apalike.bst
.
\begin{filecontents*}{\jobname.bib}
@article{one,
author={A. Uthor},
title={Title},
journal={Journal},
year=2001,
}
@article{two,
author={W. Riter and P. Enman},
title={Title},
journal={Journal},
year=2002,
}
@article{three,
author={A. Uthor and W. Riter and P. Enman},
title={Title},
journal={Journal},
year=2003,
}
\end{filecontents*}
\documentclass{article}
\usepackage{etoolbox}
\usepackage{expl3}
\usepackage[authoryear]{natbib}
\bibliographystyle{apalike}
\ExplSyntaxOn
\cs_new_protected:Npn \panniuppercase #1
{
\tl_set:Nx #1 { \tl_upper_case:V #1 }
}
\cs_generate_variant:Nn \tl_upper_case:n { V }
\cs_new_protected:Npn \pannihyphen #1 #2
{
\tl_gset:Nn #1 #2
\tl_greplace_once:Nnn #1 { ~ AND ~ } { - }
\tl_gset:Nx #1 { { \exp_not:V #1 } }
}
\ExplSyntaxOff
\makeatletter
\patchcmd{\NAT@split}
{\gdef\NAT@name}
{\pannihyphen\NAT@name}
{}{}
\patchcmd{\NAT@parse}
{\aftergroup}
{\panniuppercase\NAT@temp\aftergroup}
{}{\ddt}
\makeatother
\begin{document}
\citet{one} \citet{two} \citet{three}
\bibliography{\jobname}
\end{document}
The filecontents*
environment is just for making the example self-contained. Use your own bib file.
If you want to stick with BibTeX, I suggest you proceed as follows:
Find the file
apalike.bst
in your TeX distribution, make a copy of this file, and name the copy (say)apalikeCAPS.tex
. (Don't edit an original file of the TEX distribution directly.)Open the tile
apalikeCAPS.bst
in a text editor. The program you use to edit your tex files will do fine.In this file, locate the function called
emphasize
. (The function starts on line 200 in my copy of the bst file.)After this function, insert the following code:
FUNCTION {makeuppercase} { duplicate$ empty$ { pop$ "" } { "\MakeUppercase{" swap$ * "}" * } if$ }
As you can probably guess, this function uppercases its argument.
Find the function
format.lab.names
. (It should start around line 848, allowing for the 5 or 6 new lines you created when you inserted the new function.) In this function, change the lines #1 "{vv~}{ll}" format.name$
to
s #1 "{vv~}{ll}" format.name$ makeuppercase
In addition, change the line
{ " and " * s #2 "{vv~}{ll}" format.name$ * }
to
{ "--" * s #2 "{vv~}{ll}" format.name$ * makeuppercase }
Note that the second line has undergone two changes:
" and "
has been replaced with"--"
(an "en-dash"), andmakeuppercase
has been inserted afterformat.name$ *
.Save the file
apalikeCAPS.bst
either in the directory that contains your main tex file or in a directory that's searched by BibTeX. If you choose the second option, be sure to also update the filaname database of your TeX distribution.- In your main tex file, change the directive
\bibliographystyle{apalike}
to\bibliographystyle{apalikeCAPS}
and do a full recompile (latex-bibtex-latex-latex) to fully propagate all changes.
- In your main tex file, change the directive
Happy BibTeXing!
Aside: As @MarcoDaniel has pointed out in a comment, quite a few of natbib
s capabilities aren't available if apalike
(or apalikeCAPS
) is used as the bibliography style. For instance, the package's longnamesfirst
option doesn't work, and neither do the "starred" variants (\citet*
, \citep*
, etc) of the citation-generating macros. (More precisely, \citet*
produces the same output as \citet
does, etc.)
The output of a full MWE:
\RequirePackage{filecontents}
\begin{filecontents}{mybib.bib}
@misc{uno,
author = "Anna Author",
title = "Thoughts",
year = 3001,
}
@misc{due,
author = "Anne Author and Bertha Buthor",
title = "Further Thoughts",
year = 3002,
}
@misc{tre,
author = "Anne Author and Bertha Buthor and Carla Cuthor",
title = "Final Thoughts",
year = 3003,
}
\end{filecontents}
\documentclass{article}
\usepackage[authoryear]{natbib}
\bibliographystyle{apalikeCAPS}
\begin{document}
\citep{uno}, \citep{due}, \citep{tre}
\bibliography{mybib}
\end{document}