3

I'm using a \chapterstyle{tandh} because I want my chapters numbered. In order to get a References chapter numbered as well I used the following code:

\renewcommand{\bibsection}{%
\chapter{\bibname}}

That worked fine, I got my References chapter numbered!!

But now, in order to get my references in a author-year style I'm using the natbib package. Seems like the package ignores my code and the References chapter is not numbered anymore.

Can someone help me?

6
  • 3
    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. Accepting and upvoting answers is the preferred way here to say “thank you” to users who helped you – Mario S. E. May 28 '13 at 0:23
  • 1
    oops.. sorry... first time :P – Ana Nascimento May 28 '13 at 0:43
  • 1
    I solved it! I've placed the code inside of \begin{document} {was in preamble} and worked. – Ana Nascimento May 29 '13 at 23:18
  • @Ana: Hi Ana, welcome to TeX.sx! :) You can either write your comment as an answer (self-answers are welcome!), or we could close the question as localized (it means, in this case, the cause was a simple misplacement). :) By the way, Brazilian? :) – Paulo Cereda May 29 '13 at 23:34
  • @PauloCereda Hi. I just commented in case of anyone having the same trouble. You can close for sure! And yes, I'm from Brazil. Does my bad english betrayed me? :P – Ana Nascimento May 30 '13 at 2:02
2

The natbib package redefines \bibsection at begin document, in order to override other possible settings.

\begin{filecontents*}{\jobname.bib}
@article{duck,
 author={Duck, Donald},
 title={Ducks and friends},
 journal={J. Ducks},
 year={2012},
 pages={1-20}
}
\end{filecontents*}

\documentclass{memoir}
\chapterstyle{tandh}

\usepackage[authoryear]{natbib}

\AtBeginDocument{
  \renewcommand{\bibsection}{\chapter{\bibname}}
}


\begin{document}
\mainmatter

\chapter{Ducks}

\cite{duck}

\bibliographystyle{plainnat}
\bibliography{\jobname}

\end{document}

Use \AtBeginDocument as indicated.

Note: the filecontents* environment is only for having a self contained example. Use normally your own bib file.

enter image description here

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.