%22%20se%20uma%20entrada%20.bib%20contiver%20mais%20de%202%20autores%3F.png)
Esta questão está muito relacionada com a questão aqui:
Citação "et al." apenas para quatro e mais autores com natbib e jf.bst
Na resposta a essa pergunta, Mico mostrou como substituir a função format.lab.names no jf.str para que uma entrada .bib seja exibida como "Autor et al. (ano)" sempre que mais de 4 autores estiverem presentes em a entrada. No entanto, isso é feito para a versão jf.str encontrada no site do nyu.edu. Quero conseguir o mesmo comportamento com o arquivo .str encontrado aqui
http://pages.stern.nyu.edu/~dbackus/GE_asset_pricing/BGTZ/jf.bst
que embora tenha o mesmo nome possui algumas modificações para se adequar às exigências bibliográficas da Econometrica.
Então a questão é: alguém pode me explicar por que quando substituo FUNCTION {format.lab.names} por
FUNCTION {format.lab.names}
{'s :=
"" 't :=
#1 'nameptr :=
s num.names$ 'numnames :=
numnames 'namesleft :=
{ namesleft #0 > }
{ s nameptr
"{vv~}{ll}" format.name$
't :=
nameptr #1 >
{
nameptr #2 =
numnames #2 > and
{ "others" 't :=
#1 'namesleft := }
'skip$
if$
namesleft #1 >
{ ", " * t * }
{
s nameptr "{ll}" format.name$ duplicate$ "others" =
{ 't := }
{ pop$ }
if$
t "others" =
{ " et~al." * }
{
numnames #2 >
{ "," * }
'skip$
if$
bbl.and
space.word * t *
}
if$
}
if$
}
't
if$
nameptr #1 + 'nameptr :=
namesleft #1 - 'namesleft :=
}
while$
}
Não recebo "Autor et al. (ano)" sempre que uma entrada .bib tem mais de 2 autores. (Eu percebo que isso pode ser algo muito simples e comecei a ler Tame the Beast emhttp://www.lsv.ens-cachan.fr/~markey/BibTeX/doc/ttb_en.pdf). Obrigado.
Aqui está um arquivo .tex para fins de teste:
\documentclass{article}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@article{abd:2007,
author = "Torben G. Andersen and Tim Bollerslev and Francis X. Diebold",
title = "Roughing it up: {Including} jump components in the
measurement, modeling and forecasting of return volatility",
journal = "Review of Economics and Statistics",
year = 2007,
volume = 89,
number = 4,
month = "November",
pages = "701--720",
}
@article{abde:2001,
author = "Torben G. Andersen and Tim Bollerslev and Francis X. Diebold
and Heiko Ebens",
title = "The distribution of realized stock return volatility",
journal = "Journal of Financial Economics",
year = 2001,
volume = 61,
number = 1,
month = "July",
pages = "43--76",
}
@unpublished{gavazzoni-santacreu-2015,
Author = {Gavazzoni, Federico and Ana Maria Santacreu},
Note = {manuscript, December},
Title = {International R\&D spillovers and Asset prices},
Year = {2015}
}
@article{segal-shaliastovich-yaron-2013,
Author = {Gill, Segal and Ivan Shaliastovich and Amir Yaron},
Journal = {Journal of Financial Economics},
Title = {Good and bad uncertainty: macroeconomic and financial market implications},
Volume={117},
Pages={369-397},
Year = {2015}
}
\end{filecontents*}
\usepackage[round,authoryear,comma]{natbib}
\bibliographystyle{jf_nyu} % or: jf3
\begin{document}
Here's the output \\
\cite{abd:2007}\\
\cite{abde:2001}\\
\cite{gavazzoni-santacreu-2015}\\
\cite{segal-shaliastovich-yaron-2013}\\
\bibliography{\jobname}
\end{document}
Responder1
Agora que você nos indicou o bib
estilo correto para modificar, aqui está um substituto muito mais curto para format.lab.names
:
FUNCTION {format.lab.names}
{ 's :=
s num.names$ 'numnames :=
s #1 "{vv~}{ll}" format.name$
numnames #1 >
{ s #2 "{vv~}{ll}" format.name$ 't :=
numnames #2 >
t "others" =
or
{ " et~al." * }
{ " and " * t * }
if$
}
'skip$
if$
}
No seu arquivo de amostra (ligeiramente arrumado, veja abaixo) ele produz
A função funciona da seguinte maneira. Primeiro armazene a lista de autores em formato s
. Armazene o número de autores em numnames
. Formate a primeira #1
entrada ( ) e produza-a. Então, se houver mais de um nome, formate o próximo nome e atribua-o a t
. Se t
houve "others"
ou realmente há mais de dois autores, et al.
outros produzem o segundo autor (final) precedido por and
.
\documentclass{article}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@article{abd:2007,
author = "Torben G. Andersen and Tim Bollerslev and Francis X. Diebold",
title = "Roughing it up: {Including} jump components in the
measurement, modeling and forecasting of return volatility",
journal = "Review of Economics and Statistics",
year = 2007,
volume = 89,
number = 4,
month = "November",
pages = "701--720",
}
@article{abde:2001,
author = "Torben G. Andersen and Tim Bollerslev and Francis X. Diebold
and Heiko Ebens",
title = "The distribution of realized stock return volatility",
journal = "Journal of Financial Economics",
year = 2001,
volume = 61,
number = 1,
month = "July",
pages = "43--76",
}
@unpublished{gavazzoni-santacreu-2015,
Author = {Gavazzoni, Federico and Ana Maria Santacreu},
Note = {manuscript, December},
Title = {International R\&D spillovers and Asset prices},
Year = {2015}
}
@article{segal-shaliastovich-yaron-2013,
Author = {Gill, Segal and Ivan Shaliastovich and Amir Yaron},
Journal = {Journal of Financial Economics},
Title = {Good and bad uncertainty: macroeconomic and financial market implications},
Volume={117},
Pages={369-397},
Year = {2015}
}
\end{filecontents*}
\usepackage[round,authoryear,comma]{natbib}
\bibliographystyle{jf1} % or: jf3
\begin{document}
Here's the output
\cite{abd:2007}
\cite{abde:2001}
\cite{gavazzoni-santacreu-2015}
\cite{segal-shaliastovich-yaron-2013}
\bibliography{\jobname}
\end{document}