3

I am trying to add abstracts to my bibliography, I found these questions for help:

  1. Bibliography Style with abstract and numbered references
  2. What is wrong with the "abstract" field?

But after trying, I noticed the paragraph is not indented or justified then I recurred to the questions:

  1. Indenting a whole paragraph
  2. How can one set full justification within left-justified (\raggedright) text?

However, after building it on my code, I got an extra dot appended at the end of each bibliography and the text still not justifying.

enter image description here

The bibliography entry should certainly NOT to be justified because it will certainly throw badboxes warnings, however, the abstract paragraph will certainly not, then they can be fully justified.

This is the minimal code which I build based on these others questions. It should be justifying the abstract and not producing and extra dot between bibliographies entries. Is it fixable?

\RequirePackage{filecontents}

\begin{filecontents*}{references.bib}
@book{koma-scrguien,
  author        = {Markus Kohm},
  edition       = {2017-04-13},
  howpublished  = {\url{http://mirrors.ibiblio.org/CTAN/.../scrguien.pdf}},
  publisher     = {Online Material; \url{https://www.ctan.org/pkg/koma-script}},
  title         = {The Guide KOMA -Script},
  urlaccessdate = {2017-08-28},
  year          = {2017},
  abstract      = {Software complexity is growing, so is the demand for software verification. Soon, perhaps within a decade, wide deployment of software verification tools will be indispensable or even mandatory to ensure software reliability in a large number of application domains, including but not restricted to safety and security critical systems. To adequately respond to the demand we need to eliminate tedious aspects of software verifier development, while providing support for the accomplishment of creative aspects.}
}

@inproceedings{annotationAssistant,
    title     = {An Annotation Assistant for Interactive Debugging of Programs with Common Synchronization Idioms},
    author    = {Elmas, Tayfun and Sezgin, Ali and Tasiran, Serdar and Qadeer, Shaz},
    booktitle = {Proceedings of the 7th Workshop on Parallel and Distributed Systems: Testing, Analysis, and Debugging},
    series    = {PADTAD '09},
    year      = {2009},
    isbn      = {978-1-60558-655-7},
    location  = {Chicago, Illinois},
    pages     = {10:1--10:11},
    articleno = {10},
    numpages  = {11},
    url       = {http://doi.acm.org/10.1145/1639622.1639632},
    doi       = {10.1145/1639622.1639632},
    acmid     = {1639632},
    publisher = {ACM},
    address   = {New York, NY, USA},
    keywords  = {atomicity, concurrent programs, synchronization idioms},
  abstract  = {Software complexity is growing, so is the demand for software verification. Soon, perhaps within a decade, wide deployment of software verification tools will be indispensable or even mandatory to ensure software reliability in a large number of application domains, including but not restricted to safety and security critical systems. To adequately respond to the demand we need to eliminate tedious aspects of software verifier development, while providing support for the accomplishment of creative aspects.}
}
\end{filecontents*}

\PassOptionsToPackage{brazil,main=english}{babel}
\documentclass[10pt,a5paper,twoside]{abntex2}
\pdfstringdefDisableCommands{\let\uppercase\relax}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage[style=abnt,language=english,backref=true,backend=biber,citecounter=true]{biblatex}
\addbibresource{references.bib}

\usepackage{changepage}
\usepackage{ragged2e}

\makeatletter
\newcommand{\justified}{%
  \rightskip\z@skip%
  \leftskip\z@skip}
\makeatother

\DeclareFieldFormat{abstract}{\begin{adjustwidth}{1cm}{}{\justified\textbf{Abstract:} #1}\par\end{adjustwidth}}
\renewbibmacro*{finentry}{\printfield{abstract}\finentry}

\usepackage{csquotes}
\hypersetup{colorlinks=true}

\begin{document}

    Citing \cite[p. 47-52 and 135]{koma-scrguien}

    Citing \cite{annotationAssistant}

    \printbibliography

\end{document}
user
  • 4,745

2 Answers2

5

A quick solution is

\DeclareFieldFormat{abstract}{%
  \par\justifying
  \begin{adjustwidth}{1cm}{}
    \textbf{\bibsentence\bibstring{abstract}:} #1
  \end{adjustwidth}}

\renewbibmacro*{finentry}{%
  \iffieldundef{abstract}
    {\finentry}
    {\finentrypunct
     \printfield{abstract}%
     \renewcommand*{\finentrypunct}{}%
     \finentry}}
moewe
  • 175,683
2

Only part of an answer. This deals with the justification of the abstract-field. For this I changed the definition inside \DeclareFieldFormat{abstract}.

\RequirePackage{filecontents}

\begin{filecontents*}{references.bib}
@book{koma-scrguien,
  author        = {Markus Kohm},
  edition       = {2017-04-13},
  howpublished  = {\url{http://mirrors.ibiblio.org/CTAN/.../scrguien.pdf}},
  publisher     = {Online Material; \url{https://www.ctan.org/pkg/koma-script}},
  title         = {The Guide KOMA -Script},
  urlaccessdate = {2017-08-28},
  year          = {2017},
  abstract      = {Software complexity is growing, so is the demand for software verification. Soon, perhaps within a decade, wide deployment of software verification tools will be indispensable or even mandatory to ensure software reliability in a large number of application domains, including but not restricted to safety and security critical systems. To adequately respond to the demand we need to eliminate tedious aspects of software verifier development, while providing support for the accomplishment of creative aspects.}
}

@inproceedings{annotationAssistant,
    title     = {An Annotation Assistant for Interactive Debugging of Programs with Common Synchronization Idioms},
    author    = {Elmas, Tayfun and Sezgin, Ali and Tasiran, Serdar and Qadeer, Shaz},
    booktitle = {Proceedings of the 7th Workshop on Parallel and Distributed Systems: Testing, Analysis, and Debugging},
    series    = {PADTAD '09},
    year      = {2009},
    isbn      = {978-1-60558-655-7},
    location  = {Chicago, Illinois},
    pages     = {10:1--10:11},
    articleno = {10},
    numpages  = {11},
    url       = {http://doi.acm.org/10.1145/1639622.1639632},
    doi       = {10.1145/1639622.1639632},
    acmid     = {1639632},
    publisher = {ACM},
    address   = {New York, NY, USA},
    keywords  = {atomicity, concurrent programs, synchronization idioms},
  abstract  = {Software complexity is growing, so is the demand for software verification. Soon, perhaps within a decade, wide deployment of software verification tools will be indispensable or even mandatory to ensure software reliability in a large number of application domains, including but not restricted to safety and security critical systems. To adequately respond to the demand we need to eliminate tedious aspects of software verifier development, while providing support for the accomplishment of creative aspects.}
}
\end{filecontents*}

\PassOptionsToPackage{brazil,main=english}{babel}
\documentclass[10pt,a5paper,twoside]{abntex2}
\pdfstringdefDisableCommands{\let\uppercase\relax}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage[style=abnt,language=english,backref=true,backend=biber,citecounter=true]{biblatex}
\addbibresource{references.bib}

\usepackage{changepage}
\usepackage{ragged2e}

\makeatletter
\newcommand{\justified}{%
  \rightskip\z@skip%
  \leftskip\z@skip}
\makeatother

\DeclareFieldFormat{abstract}{{\justify\begin{adjustwidth}{1cm}{}{\textbf{Abstract:}
#1}\par\end{adjustwidth}}}
\renewbibmacro*{finentry}{\printfield{abstract}\finentry}

\usepackage{csquotes}
\hypersetup{colorlinks=true}

\begin{document}

    Citing \cite[p. 47-52 and 135]{koma-scrguien}

    Citing \cite{annotationAssistant}

    \printbibliography

\end{document}
Skillmon
  • 60,462
  • I am here just warning about a problem I caused on this code by adding a \vspace*{-0.5mm} before \justify. Adding \vspace*{-0.5mm} caused this issue: How can I stop this useless empty line popping up in the middle of my lists?, except that here, it was happenig right before the Abstract: entry. – user Nov 11 '19 at 03:25
  • @user the question you reference to doesn't seem to use any of the code here. What exactly is failing where? Sorry, but I don't really understand what's going on. – Skillmon Nov 11 '19 at 07:33
  • The problem with that question is that a useless blank line is inserted when a line is completely filled/full at the end of an list item. That problem will also happen here if you add \vspace*{-0.5mm} just before \justify and the line before the Abstract: entry is completely filled. – user Nov 11 '19 at 22:01
  • 1
    @user then don't add \vspace*{-0.5mm}?! – Skillmon Nov 12 '19 at 08:40
  • Skillmon, that is exactly what I am saying here. Do not add \vspace*{-0.5mm} or it will break. I am just warning anyone else who can take this answer. – user Nov 12 '19 at 17:28
  • @user I don't see why you would want to add that in the first place, but ok... – Skillmon Nov 12 '19 at 18:47
  • Skilmon, I had added \vspace*{-0.5mm} because I would like to shorten the space between the Abstract: and the text before it. – user Nov 12 '19 at 18:51