2

I use multibib which creates two families of citation commands: pri and sec. I would like to get rid of bibliography headings for the \bibliographypri and \bibliographysec commands while keeping the Bibliography heading for the main \bibliography at the end of the document. I also use tocbibind, as advised here, to include Bibliography in the TOC and have a correct PDF bookmark.

I renew thebibliography environment to remove the internal \chapter code before \newcites and then restore it to get the main bibliography right.

In the following MWE, using tocbibind modifies \bibliography in a way that it adds an empty PDF bookmark at the chapter level, which I don't want. Moreover, citations that should be on the same pages as sections Primary and Secondary are two pages farther than expected.

\documentclass{book}
\usepackage[resetlabels]{multibib}
\usepackage[nottoc]{tocbibind}

\makeatletter
\newenvironment{thebibliographynohead}[1]
     {%\chapter*{\bibname}%
      %\@mkboth{\MakeUppercase\bibname}{\MakeUppercase\bibname}%
      \list{\@biblabel{\@arabic\c@enumiv}}%
           {\settowidth\labelwidth{\@biblabel{#1}}%
            \leftmargin\labelwidth
            \advance\leftmargin\labelsep
            \@openbib@code
            \usecounter{enumiv}%
            \let\p@enumiv\@empty
            \renewcommand\theenumiv{\@arabic\c@enumiv}}%
      \sloppy
      \clubpenalty4000
      \@clubpenalty \clubpenalty
      \widowpenalty4000%
      \sfcode`\.\@m}
     {\def\@noitemerr
       {\@latex@warning{Empty `thebibliography' environment}}%
      \endlist}
\makeatother

\let\thebibliographyold\thebibliography
\let\thebibliography\thebibliographynohead
\newcites{pri,sec}{{},{}}
\let\thebibliography\thebibliographyold

\usepackage{bookmark}

\begin{document}

    \frontmatter
    \chapter{Abstract}
    \chapter{Sources}

        \section*{Primary}
            \addcontentsline{toc}{section}{Primary}
            \nocitepri{greenwade93}
            \bibliographystylepri{plain}
            \bibliographypri{bibliography}
            \clearpage

        \section*{Secondary}
            \addcontentsline{toc}{section}{Secondary}
            \nocitesec{greenwade93}
            \bibliographystylesec{plain}
            \bibliographysec{bibliography}
            \clearpage

    \cleardoublepage
    \pdfbookmark{\contentsname}{Contents}
    \tableofcontents %% Skip from TOC, only PDF bookmark

    \mainmatter
    \pagenumbering{arabic}
    \chapter{Chapter A}
    \section{Section A}
    Ref.~\cite{greenwade93}.

    \backmatter
    %\addcontentsline{toc}{chapter}{Bibliography}
    \bibliographystyle{plain}
    \bibliography{bibliography}
    \chapter{Acronyms}

\end{document}

Your Answer

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

Browse other questions tagged or ask your own question.