1

I am using the following override of "thebibliography" command:

\makeatletter
\renewenvironment{thebibliography}[1]
     {\section*{\bibname}% <-- this line was changed from \chapter* to \section*
      \@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

I am trying to add indentation from a number when wrapping to the next line. So that all lines are indented evenly:

enter image description here

I am trying to achieve this result:

enter image description here

Please tell me what needs to be added for this?

  • 2
    This indent is controlled by the mandatory argument of thebibliography. In theory your BibTeX style (or you) should put the longest label there and then the indentation should look good. How do you generate your bibliography? – moewe Dec 18 '21 at 17:37
  • I just use thebibliography command. For example: \renewcommand{\bibname}{Список литературы} \bibliographystyle{gost2008} \begin{thebibliography}{3}

    \bibitem{AB_pmpu} example \end{thebibliography}

    – chel_random Dec 18 '21 at 17:45
  • 1
    @user259920 So you have only the width of 3 left for the labels. Please try, say \begin{thebibliography}{99} if you have less than 100 entries, – Przemysław Scherwentke Dec 18 '21 at 20:18
  • Thank you so much! – chel_random Dec 19 '21 at 08:32

1 Answers1

1

The standard implementation of thebibliography in LaTeX is a bit rudimentary in the sense that in order to get nicely aligned lines in multi-line entries you (or your bibliography style) need to specify the widest/longest label in advance in the mandatory argument of thebibliography.

\begin{thebibliography}{<longest label>}

\bibitem{sigfridsson} Sigfridsson and Ryde, 1998. etc. etc.

\end{thebibliography}

With the standard font setup all digits are equally wide and so for numeric labels you only need to know the number of entries to determine the widest label. Many people just go for

  • 9 if they have between one and nine entries,
  • 99 if they have between 10 and 99 entries,
  • 999 if they have between 100 and 999 entries,
  • etc. etc.

So if you have entries numbered "67" and "68", you do not want 3 as the argument of thebibliography, you need at least something like 68

\begin{thebibliography}{68}

\bibitem{sigfridsson} Sigfridsson and Ryde, 1998. etc. etc.

\end{thebibliography}

See also What does the number in {} for Bibilography actually do? and Argument in "thebibliography" for examples and more explanations.

moewe
  • 175,683