I'm attempting to make my bibliography numbering style begin with the section number followed by an arabic number for each entry. For example:
25.7 REFERENCES
25.7.1 First Reference
25.7.2 Second Reference
Similar to my previous question on aligning section headers, I would want the bibliography item numbers also in the left margin.
Here's my MWE, which has obvious issues. This is as close as I can get.
\documentclass[letterpage,10pt]{report}
\usepackage{chngcntr}
\usepackage{enumitem}
\usepackage[colorlinks=true,urlcolor=black,hypertexnames=false]{hyperref}
%Set page margins
\usepackage[left=1.75in,right=1in,headheight=1in,bottom=1.5in,footskip=0.5in,showframe]{geometry}
\usepackage{titlesec}
\renewcommand\thesection{25.\arabic{section}} %Add "25." before section numbering
\setcounter{section}{6} %Set first section number to "7" for this MWE
%https://tex.stackexchange.com/questions/361509/align-all-text-excluding-section-list-numbers
\titleformat{\section}{\normalfont\bfseries}{\llap{\makebox[0.75in][l]{\thesection}}}{0em}{\MakeUppercase}
\usepackage{etoolbox} %Patch bibliography style to it doesn't go to the next page
\patchcmd{\thebibliography}{\chapter*}{\section*}{}{}
\setlength\parindent{0pt} %no indent for all paragraphs
\begin{document}
\section{References}
\renewcommand{\bibname}{} %Remove "Bibliography" header
\renewcommand\bibitem{25.\arabic{section}. } %Add section number before reference numbering
\begin{thebibliography}{9}
\bibitem{Reference 1}
\bibitem{Reference 2}
\end{thebibliography}
\end{document}
Best Answer
You can do this by patching the internal command
\@bibitem
, which as standard uses only a simple list counter, and changing the\@biblabel
command as follows:Note that you have already loaded
etoolbox
and you have already set-up\thesection
to produce the information you wish. In the code below, I have removed much of your other formatting set-up that is not relevant to this problem. Further to your comment, I have now addedhyperref
to show it works with this (you just need to be careful about the execution order) and have added further adjustments to thebibliography
environment and\@biblabel
so the labels are printed in the margin.The above prints the labels right aligned followed by a space before the left margin. If you wished to copy your section labelling style exactly then use the following definition for
\@biblabel
instead: