0

dear experts!

My setting is: XeLaTeX compiler, biblatex package for bibliography and document class is extarticle. I`m trying to achieve this style of indentation in my bibliography list:enter image description here

As you can see, I need the first line to be indented (I have solution for this), while the other lines should not be indented. I tried solution from this topic...

non-indentation of the second line of bibliograpy

...but that doesn't helped me. I don't know what is the problem with that solution.

Here is my .tex code:

\documentclass[a4paper,14pt]{extarticle}
\usepackage[sorting=none]{biblatex} %Imports biblatex package
\usepackage{enumitem}

\addbibresource{sample.bib} %Import the bibliography file

\DeclareFieldFormat{labelnumberwidth}{\hspace{9mm}#1.\hspace{-7pt}}
\setlength\bibitemsep{0mm}

\makeatletter
\renewenvironment{thebibliography}[1]
     {\chapter*{\bibname}%
      \setbox2\hbox{\@biblabel{#1}}
      \@mkboth{\MakeUppercase\bibname}{\MakeUppercase\bibname}%
      \begin{enumerate}[itemindent=!,leftmargin=0pt,label={\@biblabel{\@arabic\c@enumiv}\setbox2\hbox{\@biblabel{\@arabic\c@enumiv}}\hspace{\labelwidth}\hspace{-1mm}},labelwidth=1mm]
            \usecounter{enumiv}%
      \sloppy
      \clubpenalty4000
      \@clubpenalty \clubpenalty
      \widowpenalty4000%
      \sfcode`\.\@m}
     {\def\@noitemerr
       {\@latex@warning{Empty `thebibliography' environment}}%
      \end{enumerate}}
\makeatother

\begin{document}

Lets put some links in text. For example \cite{LINK1}. Secondly, this is another link \cite{LINK2}.

\printbibliography %Prints bibliography

\end{document}

And my .bib file is like:

@misc{LINK1,
    note   = "A. J. Krasznahorkay et al. Observation of anomalous internal pair creation in $\mathrm{^8Be}$: a possible indication of a light, neutral boson. Phys. Rev. Lett. PRL 116, 042501 (2016)"
}

@misc{LINK2,
    note   = "George D. Greenwade The {C}omprehensive {T}ex {A}rchive {N}etwork ({CTAN}) (2013)"
}

Could you please suggest any other solutions for my goal or propose some problems that I`ve probably missed?

2
  • Welcome to TeX.SE!
    – Zarko
    May 26, 2021 at 0:36
  • @Zarko, thank you! Hello.
    – Alexander
    May 26, 2021 at 0:53

1 Answer 1

0

The answer you found is for BibTeX, but you are using biblatex, which completely reimplements citations and bibliographies and does not use thebibliography.

You could try

\documentclass[a4paper,14pt]{extarticle}
\usepackage[sorting=none]{biblatex}

\DeclareFieldFormat{labelnumberwidth}{#1\adddot}
\setlength{\biblabelsep}{\labelsep}
\defbibenvironment{bibliography}
  {\list
     {\printtext[labelnumberwidth]{%
        \printfield{labelprefix}%
        \printfield{labelnumber}}}
     {\setlength{\labelwidth}{-\labelnumberwidth}%
      \setlength{\labelsep}{\biblabelsep}%
      \setlength{\leftmargin}{0pt}%
      \setlength{\itemindent}{\bibhang}%
      \setlength{\itemsep}{\bibitemsep}%
      \setlength{\parsep}{\bibparsep}}%
      \renewcommand*{\makelabel}[1]{\hss##1}}
  {\endlist}
  {\item}

\addbibresource{biblatex-examples.bib}

\begin{document}
Lets put some links in text. For example \cite{sigfridsson}.
Secondly, this is another link \cite{worman}.

\printbibliography
\end{document}

Bibliography with first line indented, subsequent lines not.

You may want to look into using gost-numeric of biblatex-gost. That comes closer to the overall bibliography style you show in the image.

\documentclass[a4paper,14pt]{extarticle}
\usepackage[style=gost-numeric]{biblatex}

\setlength{\biblabelsep}{\labelsep}
\defbibenvironment{bibliography}
  {\list
     {\printtext[labelnumberwidth]{%
        \printfield{labelprefix}%
        \printfield{labelnumber}}}
     {\setlength{\labelwidth}{-\labelnumberwidth}%
      \setlength{\labelsep}{\biblabelsep}%
      \setlength{\leftmargin}{0pt}%
      \setlength{\itemindent}{\bibhang}%
      \setlength{\itemsep}{\bibitemsep}%
      \setlength{\parsep}{\bibparsep}}%
      \renewcommand*{\makelabel}[1]{\hss##1}}
  {\endlist}
  {\item}

\addbibresource{biblatex-examples.bib}

\begin{document}
Lets put some links in text. For example \cite{sigfridsson}.
Secondly, this is another link \cite{worman}.

\printbibliography
\end{document}

GOST-style bibliography with first line indented

The .bib entries in the question with all data in the note entry look a bit like an attempt to manually control the bibliography style. This is against the spirit of BibTeX and biblatex, where the idea is that you'd give the data in semantically useful fields and let the style figure out how to typeset things.

1
  • Thank you very much for pointing out with this problem. It works as I needed. Yes, entries in .bib is actually attempt to manually control style. It is confusing me too, but I`ve done this for two reasons: 1) I have some specific requirements for my work (it is bachelor diploma in russian university), 2) It is my first experience of using bibliography in TeX and I have no enough time right now to find suitable style in the very broad list. So it is just temporary and ugly solution that I found)
    – Alexander
    May 26, 2021 at 11:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .