# Making Bibliography as a Subsection in TOC, but chapter in document

I have seen a few related questions, but I cannot get the answer to work for my situation. Maybe it's because it is the memoir documentclass, maybe it's the bibliography manager (natbib is embedded in the achemso package). In any case, my bibliography right now shows up as a chapter*. I would like it to be included in the toc as a subsection (not starred!).

I would still like it to retain chapter* formatting for in the document. I'm ok even if the solution is to shut off the automatic toc entry and add a manual entry in the toc

Bibliography as \section instead of \section*

Here is my MWE

\begin{filecontents*}{chapter1.bib}
@article{ref1,
author={Name, F.L},
journal={J. Am. Chem. Soc},
pages={1134--1145},
}
\end{filecontents*}
\documentclass[oneside,openany,openbib,11pt]{memoir}
\usepackage{etoolbox}
\usepackage{lipsum}
\usepackage{filecontents}
\usepackage{chapterbib}
\usepackage[super=true,journal=jacsat,maxauthors=0]{achemso} %for proper citation formatting

% tried this but it didn't work
%\renewcommand{\bibsection}{\subsection{References}}
% also tried this
%\patchcmd{\thebibliography}{\chapter*}{\section}{}{}

\begin{document}
\frontmatter
\tableofcontents\clearpage
\mainmatter
\begin{filecontents}{chapter1.tex}
\setsecnumdepth{subsection}
\maxsecnumdepth{subsection}
\settocdepth{subsection}
\chapter{Chapter 1}
\section{C1S1}
\subsection{C1-SubS1}
\lipsum[1]\cite{ref1}
\subsection{C1-SubS2}

\renewcommand{\bibname}{References}
\bibliographystyle{achemso}
\bibliography{chapter1}
\end{filecontents}

\include{chapter1}
\end{document}

\begin{filecontents*}{chapter1.bib}
@article{ref1,
author={Name, F.L},
journal={J. Am. Chem. Soc},
pages={1134--1145},
}
\end{filecontents*}
\documentclass[oneside,openany,openbib,11pt]{memoir}
\usepackage{etoolbox}
\usepackage{lipsum}
\usepackage{filecontents}
\usepackage{chapterbib}
\usepackage[super=true,journal=jacsat,maxauthors=0]{achemso} %for proper citation formatting

\begin{document}
\frontmatter
\tableofcontents\clearpage
\mainmatter

\setsecnumdepth{subsection}
\maxsecnumdepth{subsection}
\settocdepth{subsection}
\chapter{Chapter 1}
\section{C1S1}
\subsection{C1-SubS1}
\lipsum[1]\cite{ref1}
\subsection{C1-SubS2}

\renewcommand{\bibname}{References}
\makeatletter
\renewcommand{\@memb@bchap}{%
\chapter*{\bibname}%
\bibmark
\ifnobibintoc\else
\phantomsection
\fi
\prebibhook}
\makeatother
\bibliography{chapter1}

\end{document}
• Both your answers worked just perfectly! I wish I could mark them both as the solution
– J M
Jul 2, 2016 at 14:43
• Turns out in the larger document, only this one worked
– J M
Jul 2, 2016 at 15:16
• @JM: Well, you should give touhami the chance to improve his post if you think there's something wrong with it
– user31729
Jul 2, 2016 at 16:07

Here is a solution. We use this patch

\newcommand{\mtchaptoc}{%
\pretocmd{\bibliography}{\mtchaptoc}{}{}

MWE

\begin{filecontents*}{chapter1.bib}
@article{ref1,
author={Name, F.L},
journal={J. Am. Chem. Soc},
pages={1134--1145},
}
\end{filecontents*}
\documentclass[oneside,openany,openbib,11pt]{memoir}
\usepackage{etoolbox}
\usepackage{lipsum}
\usepackage{filecontents}
\usepackage{chapterbib}
\usepackage[super=true,journal=jacsat,maxauthors=0]{achemso} %for proper citation formatting

% tried this but it didn't work
%\renewcommand{\bibsection}{\subsection{References}}
% also tried this
%\patchcmd{\thebibliography}{\chapter*}{\section}{}{}

\newcommand{\mtchaptoc}{%
\pretocmd{\bibliography}{\mtchaptoc}{}{}

\begin{document}
\frontmatter
\tableofcontents\clearpage
\mainmatter
\begin{filecontents}{chapter1.tex}
\setsecnumdepth{subsection}
\maxsecnumdepth{subsection}
\settocdepth{subsection}
\chapter{Chapter 1}
\section{C1S1}
\subsection{C1-SubS1}
\lipsum[1]\cite{ref1}
\subsection{C1-SubS2}

\renewcommand{\bibname}{References}
\bibliographystyle{achemso}
\bibliography{chapter1}
\end{filecontents}

\include{chapter1}
\end{document}
• In the larger document, this ends up changing the formatting of subsequent chapter listings, everything becomes tabbed over to be at the subsection level, and I get an error as well ! Undefined control sequence. <argument> \@chapapp@head \@cftbsnum 3\@cftasnum l.63 ... of Small-Molecule Systems}{66}{chapter.3} ? ! Undefined control sequence. <argument> \@chapapp@head \@cftbsnum 4\@cftasnum l.84 ... Complex Organic Reactions}{98}{chapter.4}
– J M
Jul 2, 2016 at 15:17
• @JM I will see. Jul 2, 2016 at 15:45