BibLaTeX gost-inline(和 gost-footnote)样式中多余的标点和间距

BibLaTeX gost-inline(和 gost-footnote)样式中多余的标点和间距

有时 biblatex 样式的输出gost-inline(对于 也一样style=gost-footnote)在引用标题后有不必要的空格,并且在作者姓名和标题之间有双标点(参见 MWE)。

这是错误吗?我该如何修复它?

我使用以下版本: 软件包:biblatex 2018/11/02 v3.12 文件:gost-inline.dbx 2018/02/20 v1.17

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

\addbibresource{TEST-biblatex-gost.bib}

\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}

问题


更新。相关问题

答案是莫威解决了上述两个问题。但在我的文档中,还有最后一个问题,它与上述第一个问题有关。因此,我有以下条目:

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

并且对它的引用(Text \autocite[12]{Antonin}.)仍然(应用了 moewe 代码)给出了年份和页码之间多余的空格的结果:

问题2

答案1

多余的空格来自 bibmacro 中未注释的行尾maintitle+volumes+parts+。双标点符号来自一个空的\bibsentencein cite:opcit。第一个问题很容易通过添加%(行尾的百分号 (%) 有什么用?(为什么我的宏会产生额外的空间?)),对于第二个问题,我不确定为什么会\bibsentence出现这种情况,所以我的解决方法的输出可能需要仔细审查。

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

\renewbibmacro*{maintitle+volumes+parts+}[1]{%
  \iffieldsequal{maintitle}{#1}
    {\clearfield{maintitle}%
     \clearfield{mainsubtitle}%
     \clearfield{maintitleaddon}}
    {\iffieldundef{maintitle}
       {\usebibmacro{#1}%
        \setunit{\addcolondelim}%
        \usebibmacro{involumes+otherparts}{\setunit*{\addcomma\space}}%
        \newunit
        \usebibmacro{volume+parts}{\newunit}}
       {\usebibmacro{maintitle}%
        \newunit
        \usebibmacro{involumes+otherparts}{\setunit*{\addcomma\space}}%
        \newunit
        \usebibmacro{volume+parts}{\newunit}%
        \newunit
        \usebibmacro{#1}}}%
  \newunit}

\renewbibmacro*{cite:opcit}{%
  \ifnameundef{labelname}
    {\printfield{label}}
    {\printnames{labelname}}%
  \setunit*{\labelnamepunct}%
  \printtext[bibhyperlink]{%
    \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}
\addbibresource{\jobname.bib}

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

这里(Millimetron J. 第一本书的标题)是一些(Elusive J. 第二本书的标题。Lipsiae,1871)文本(Millimetron J. Op. cit.)。

我已向以下机构报告了此问题https://github.com/odomanov/biblatex-gost/issues/29https://github.com/odomanov/biblatex-gost/issues/30


更新

维护者biblatex-gost很快解决了上述两个问题,并发布了样式包的 1.20 版本。

新条目的问题在于缺少另一个%,这次是驱动程序@unpublished。它已被添加(https://github.com/odomanov/biblatex-gost/commit/8d829bfcb854655f4ee7a3eb622bd422d50083a8),但与此同时,你可以在你的序言中添加以下内容。

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

\renewbibmacro*{maintitle+volumes+parts+}[1]{%
  \iffieldsequal{maintitle}{#1}
    {\clearfield{maintitle}%
     \clearfield{mainsubtitle}%
     \clearfield{maintitleaddon}}
    {\iffieldundef{maintitle}
       {\usebibmacro{#1}%
        \setunit{\addcolondelim}%
        \usebibmacro{involumes+otherparts}{\setunit*{\addcomma\space}}%
        \newunit
        \usebibmacro{volume+parts}{\newunit}}
       {\usebibmacro{maintitle}%
        \newunit
        \usebibmacro{involumes+otherparts}{\setunit*{\addcomma\space}}%
        \newunit
        \usebibmacro{volume+parts}{\newunit}%
        \newunit
        \usebibmacro{#1}}}%
  \newunit}

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

\DeclareBibliographyDriver{unpublished}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{heading}%
  \newunit
  \usebibmacro{author}%
  \setunit*{\labelnamepunct}%
  \usebibmacro{title}%
  \setunit*{\addcolondelim}%
  \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
  \usebibmacro{addendum+pubstate}%
  \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}
\addbibresource{\jobname.bib}

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

\printbibliography
\end{document}

相关内容