I am trying to make a more automatic latex CV. I'd like my reference section to lead with: "Refereed Publications (N first author, M total):"
For the M total, I have found a solution based on this post:
\usepackage{totcount}
\newtotcounter{citnum} %From the package documentation
\def\oldbibitem{} \let\oldbibitem=\bibitem
\def\bibitem{\stepcounter{citnum}\oldbibitem}
\renewcommand{\refname}{Refereed Publications [N first author, \total{citnum} total]:}
This results in the heading for the Bibliography section being changed to Refereed Publications [9 first author, 45 total]:, where the number 9 in this example is hard-coded and the number 45 has been counted by latex.
How can I do the same sort of counting, but only for the N publications on which I am the first author?
MWE added as per Johannes_B's request:
\documentclass{article}
\usepackage{natbib}
\usepackage{totcount}
\newtotcounter{citnum} %From the package documentation
\def\oldbibitem{} \let\oldbibitem=\bibitem
\def\bibitem{\stepcounter{citnum}\oldbibitem}
\renewcommand{\refname}{Refereed Publications [2 first author, \total{citnum} total]:}
\begin{document}
\nocite{*}
\bibliographystyle{apj_revchron}
\bibliography{mwe}
\end{document}
With the bib file mwe.bib:
@article{one,
author = {{me}, a. and {you}, b.},
title = {one},
journal = {one},
year = {2015},
}
@article{two,
author = {{you}, a. and {me}, b.},
title = {two},
journal = {two},
year = {2015},
}
@article{three,
author = {{me}, a. and {you}, b. and {them}},
title = {three},
journal = {three},
year = {2015},
}
This will result in the heading:
Refereed Publications [2 first author, 3 total]:
My question is, how can the 2 here be automatically determined?
