# BibLaTeX Superfluous punctuation and spacing in gost-inline (and gost-footnote) style

Sometimes the output of biblatex in gost-inline style (the same is for style=gost-footnote) has unnecessary space after a title of a citation and double punctuation between the author's name and the title (see MWE).

Is it a bug? How can I fix it?

I use the following versions: Package: biblatex 2018/11/02 v3.12 File: gost-inline.dbx 2018/02/20 v1.17

\documentclass{article}
\usepackage[backend=biber,style=gost-inline]{biblatex}

\begin{filecontents}{TEST-biblatex-gost.bib}
@Book{Millimetron,
author     = {John Millimetron},
title      = {A title of the first book},
}
@Book{Ilusive,
author     = {Joe Elusive},
location   = {Lipsiae},
title      = {A title of the second book},
year       = {1871},
}
\end{filecontents}

\begin{document}
Here \autocite{Millimetron} is some \autocite{Ilusive} text \autocite{Millimetron}.

\printbibliography
\end{document}


## Update. Related Problem

The answer by moewe solved the two aforecited problems. But in my document I have a last one, which is related to the first above-mentioned one. So, I have the following entry:

@Unpublished{Antonin,
author    = {Antonin Kapustin},
title     = {Katalog of manuscripts of the Sinai monastery},
year      = {1870},
location  = {Sinai},
}


and the citation of it (Text \autocite[12]{Antonin}. ) still (with the moewe's code applied) gives a result with the superfluous spacing between the year and the page number:

The superfluous space comes from an uncommented line end in the bibmacro maintitle+volumes+parts+. The double punctuation comes from a bare \bibsentence in cite:opcit. The first is easily fixed by adding a % (What is the use of percent signs (%) at the end of lines? (Why is my macro creating extra space?)), for the second issue I'm not sure why the \bibsentence is there in the first place, so the output with my workaround probably needs some careful scrutiny.

\documentclass{article}
\usepackage[backend=biber,style=gost-inline]{biblatex}

\renewbibmacro*{maintitle+volumes+parts+}[1]{%
\iffieldsequal{maintitle}{#1}
{\clearfield{maintitle}%
\clearfield{mainsubtitle}%
{\iffieldundef{maintitle}
{\usebibmacro{#1}%
\newunit
\usebibmacro{volume+parts}{\newunit}}
{\usebibmacro{maintitle}%
\newunit
\newunit
\usebibmacro{volume+parts}{\newunit}%
\newunit
\usebibmacro{#1}}}%
\newunit}

\renewbibmacro*{cite:opcit}{%
\ifnameundef{labelname}
{\printfield{label}}
{\printnames{labelname}}%
\setunit*{\labelnamepunct}%
\bibstring[\mkibid]{opcit}}}

\begin{filecontents}{\jobname.bib}
@book{Millimetron,
author     = {John Millimetron},
title      = {A title of the first book},
}
@book{Ilusive,
author     = {Joe Elusive},
location   = {Lipsiae},
title      = {A title of the second book},
year       = {1871},
}
\end{filecontents}

\begin{document}
Here \autocite{Millimetron} is some \autocite{Ilusive} text \autocite{Millimetron}.

\printbibliography
\end{document}


I reported the issues at https://github.com/odomanov/biblatex-gost/issues/29 and https://github.com/odomanov/biblatex-gost/issues/30.

## Update

The biblatex-gost maintainer has quickly resolved the two issues above and released version 1.20 of the style bundle.

The problem with your new entry is another missing %, this time in the driver for @unpublished. It has already been added (https://github.com/odomanov/biblatex-gost/commit/8d829bfcb854655f4ee7a3eb622bd422d50083a8), but in the meantime you can add the following to your preamble.

\documentclass{article}
\usepackage[backend=biber,style=gost-inline]{biblatex}

\renewbibmacro*{maintitle+volumes+parts+}[1]{%
\iffieldsequal{maintitle}{#1}
{\clearfield{maintitle}%
\clearfield{mainsubtitle}%
{\iffieldundef{maintitle}
{\usebibmacro{#1}%
\newunit
\usebibmacro{volume+parts}{\newunit}}
{\usebibmacro{maintitle}%
\newunit
\newunit
\usebibmacro{volume+parts}{\newunit}%
\newunit
\usebibmacro{#1}}}%
\newunit}

\renewbibmacro*{cite:opcit}{%
\ifnameundef{labelname}
{\printfield{label}}
{\printnames{labelname}}%
\setunit*{\labelnamepunct}%
\bibstring[\mkibid]{opcit}}}

\DeclareBibliographyDriver{unpublished}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\newunit
\usebibmacro{author}%
\setunit*{\labelnamepunct}%
\usebibmacro{title}%
\usebibmacro{translation}%
\def\bbx@gost@respdelim{\setunit{\respdelim}}% ----- Resp starts -----
\usebibmacro{byauthor}%
\setunit*{\resppunct}%
\usebibmacro{credits}%
\newunit\newblock
\printlist[semicolondelim]{specdata}%
\newunit\newblock
\usebibmacro{location+date}%
\newunit\newblock
\usebibmacro{isbn}%
\newunit\newblock
\usebibmacro{url+urldate+note}%
\newunit
\printfield{howpublished}%
\newunit\newblock
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock
\usebibmacro{relatedblock}%
\usebibmacro{finentry}}

\begin{filecontents}{\jobname.bib}
@book{Millimetron,
author     = {John Millimetron},
title      = {A title of the first book},
}
@book{Ilusive,
author     = {Joe Elusive},
location   = {Lipsiae},
title      = {A title of the second book},
year       = {1871},
}
@Unpublished{Antonin,
author    = {Antonin Kapustin},
title     = {Katalog of manuscripts of the Sinai monastery},
year      = {1870},
location  = {Sinai},
}
\end{filecontents}

\begin{document}
Here \autocite{Millimetron} is some \autocite{Antonin} text \autocite{Millimetron}.

\printbibliography
\end{document}

• moewe, thanks a lot for the solution! It resolves these two problems. But in my document I have an another one, which is related to the first one. Please, see the addition info in my initial question.
– m.E
Oct 27 '20 at 17:11
• Sorry, this is another missing %. Line 1305 of gost-standard.bbx. The change is on GitHub. Oct 27 '20 at 18:13
• million thanks, guys, my problem is totally solved!
– m.E
Oct 28 '20 at 9:41