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.



%Set page margins

\renewcommand\thesection{25.\arabic{section}}   %Add "25." before section numbering
\setcounter{section}{6}   %Set first section number to "7" for this MWE

\usepackage{etoolbox} %Patch bibliography style to it doesn't go to the next page

\setlength\parindent{0pt}   %no indent for all paragraphs



\renewcommand{\bibname}{} %Remove "Bibliography" header

\renewcommand\bibitem{25.\arabic{section}. }   %Add section number before reference numbering


    \bibitem{Reference 1}

    \bibitem{Reference 2}



enter image description here

  • I assume you're interested in using some kind of numeric style for citation call-outs. Should the citation call-outs continue to appear as [1], [2], etc. in the body of the document, or should they appear as [25.7.1], [25.7.2], etc? – Mico Apr 6 '17 at 20:59
  • Citations should appear 25.7.1 in the text, no brackets. – grfrazee Apr 6 '17 at 21:01
  • And if cited material is used twice in different sections, I guess it should get the number of the first section it was used in?! – Skillmon likes topanswers.xyz Apr 6 '17 at 21:05
  • Not entirely sure what you mean, but there is only one References section in the entire document. – grfrazee Apr 6 '17 at 21:07
  • Oh. Now I think I get it... You just want them all to be 25.7.xx (where 25.7 is the section 'REFERENCES'). First I thought you wanted them to be numbered after the section they were cited in. – Skillmon likes topanswers.xyz Apr 6 '17 at 21:18

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:

\patchcmd{\@bibitem}{\the\value{\@listctr}}{\thesection.\the\value{\@listctr}}{}{Bib patch failed}

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 added hyperref to show it works with this (you just need to be careful about the execution order) and have added further adjustments to the bibliography environment and \@biblabel so the labels are printed in the margin.

Sample output




\patchcmd{\@bibitem}{\the\value{\@listctr}}{\thesection.\the\value{\@listctr}}{}{Bib patch failed}
\def\@biblabel#1{\llap{[\thesection.#1]\ }}




\cite{R1} and \cite{R2}


\bibitem{R1} Reference 1

\bibitem{R2} Reference 2

\section{More text}


\section{More references}

\bibitem{S1} Reference 3


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:

  • This does work, but I realized that it conflicts with the hyperref package that I'm using if I don't load hyperref after your additions for the bib numbering. However, it doesn't account for the margin spacing concerns I brought up via reference to my previous question. Any thoughts on that? – grfrazee Apr 11 '17 at 13:36
  • Thanks for the update. Where you have \labelwidth as the width of the left margin, how would one change this to be 0.75in? I have the section numbers in a 0.75in-wide margin in the rest of the document, and having the reference numbers align left with these is the desired effect. – grfrazee Apr 13 '17 at 15:29
  • You misunderstand, the \labelwidth is in code that is being deleted from the standard definition. Anyway all you need is a different definition of \@biblabel now added to my answer at the end. – Andrew Swann Apr 16 '17 at 12:59

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.