重新定义的 \printbibliography 样式中不需要的空间

重新定义的 \printbibliography 样式中不需要的空间

此主题我询问了如何制作与脚注风格不同的参考书目。在处理过程中,我注意到在同一个编辑者第二次出现时,空格出现了问题(在参考书目中,而不是在脚注中)。在我的 MWE 中,我在 ID 和 bibstring“editor”之间漏了一个空格。

这是我在 ATM 上得到的:

Id.(Hrsg.),Photius。 De Spiritus Sancti Mystagogia,GJ Manz,Ratisbonae 1857(Patrologia Series Graeca 102),收藏。 279-401。

但我想要的是:

ID。 (Hrsg.),Photius。 De Spiritus Sancti Mystagogia,GJ Manz,Ratisbonae 1857(Patrologia Series Graeca 102),收藏。 279-401。

关于如何解决此问题有什么想法吗?

梅威瑟:

% !BIB TS-program = biber
% !BIB program = biber
% !TEX encoding = UTF-8 Unicode
% !TeX TS-program = xelatexmk

\begin{filecontents}{archivio.bib}


@book{Her:Mon,
    Address = {Ratisbonae},
    Editor = {Joseph Hergenröther},
    Langid = {german},
    Publisher = {Manz},
    Title = {Monumenta graeca ad Photium},
    Year = {1869}}

@book{Foz:Mys,
    Address = {Ratisbonae},
    Editor = {Joseph Hergenröther},
    Langid = {german},
    Pages = {coll. 279-401},
    Publisher = {G. J. Manz},
    Series = {Patrologia Series Graeca},
    Title = {Photius. De Spiritus Sancti Mystagogia},
    Number = {102},
    Year = {1857}}


\end{filecontents}

\documentclass[11pt, openany]{book}
\usepackage{polyglossia}
\setmainlanguage[babelshorthands=true]{italian}
\setotherlanguages{latin, english, french, german}

\usepackage[]{csquotes}
\usepackage{xpatch}
\usepackage[style=verbose-trad2,
            language=auto,
            ibidpage=true,
            autolang=other,% use new option name
            useprefix=true,
            giveninits=true,
            indexing=true,% or cite?
            citepages=separate,%
            dateabbrev=false,
            backend=biber,
        ]{biblatex}

\DeclareFieldFormat[book, inbook, incollection, inproceedings]{volume}{#1}

% This is to kill a comma between Editor and (Ed.)
\DeclareDelimFormat{editortypedelim}{\addspace}
\DeclareFieldFormat{editortype}{\mkbibparens{#1}}
\DeclareDelimFormat{translatortypedelim}{\addspace}
\DeclareFieldFormat{translatortype}{\mkbibparens{#1}}
\renewcommand*{\newunitpunct}{\addcomma\space}
\xpatchbibmacro{name:andothers}{%
  \bibstring{andothers}%
}{%
  \bibstring[\emph]{andothers}%
}{}{}


\NewBibliographyString{ibidemloccit,ibidemnoloccit}

\newcommand*{\mklangidem}[1]{%
  \DefineBibliographyStrings{#1}{%   era \DefineBibliographyStrings{italian}{%
    idem   = {Id\adddot},
    idemsm = {Id\adddot},
    idemsf = {Ead\adddot},
    idemsn = {Id\adddot},
    idempm = {Id\adddot},
    idempf = {Id\adddot},
    idempn = {Id\adddot},
    idempp = {Id\adddot},
    ibidemloccit   = {\mkbibemph{\autocap{i}bid\adddot}},
    ibidemnoloccit = {Ivi},
    opcit  = {cit\adddot}, %tolto \nopunct per avere la virgola 30 mag 2018
    loccit = {loc\adddotspace cit\adddot},
  }}

\forcsvlist{\mklangidem}{english,italian, german}

%%%%%%%%%%%%%%%%%%%%%%%%%%%CAMPO EDITOR TRA PARENTESI CON EDD%%%%%%%%%%%

\DefineBibliographyStrings{german}{                 
    editor = {Hrsg\adddot},
    editors={Hrsg\adddot},
    byeditor = {Hrsg\adddot},
    page = {p\adddot},
    pages = {pp\adddot},
    andothers = {et al\adddot},
    opcit  = {cit\adddot} %tolto \nopunct per avere la virgola 30 mag 2018
}



\xpatchbibmacro{author}
  {\printnames{author}}
  {\ifcitation
     {\ifthenelse{\ifciteidem\AND\NOT\boolean{cbx:noidem}}
       {\usebibmacro{cite:idem}}
       {\printnames{author}}}
     {\printnames{author}}}
  {}{}
\xpatchbibmacro{bbx:editor}
  {\printnames{editor}}
  {\ifcitation
     {\ifthenelse{\ifciteidem\AND\NOT\boolean{cbx:noidem}}
        {\usebibmacro{cite:idem}}
        {\printnames{editor}}}
     {\printnames{editor}}}
  {}{}
\xpatchbibmacro{bbx:translator}
  {\printnames{translator}}
  {\ifcitation
     {\ifthenelse{\ifciteidem\AND\NOT\boolean{cbx:noidem}}
        {\usebibmacro{cite:idem}}
        {\printnames{translator}}}
     {\printnames{translator}}}
  {}{}

\renewbibmacro*{cite:ibid}{%
  \printtext{%
    \bibhyperlink{cite\csuse{cbx@lastcite@\thefield{entrykey}}}{%
      \ifloccit
        {\bibstring[\mkibid]{ibidemloccit}%
         \global\toggletrue{cbx:loccit}}
        {\bibstring[\mkibid]{ibidemnoloccit}}}}}



\renewbibmacro*{publisher+location+date}{%
  \printlist{publisher}%
  \setunit*{\addcomma\space}%
  \printlist{location}%
  \setunit*{\space}%
  \usebibmacro{date}%
  \newunit}

\renewbibmacro*{series+number}{%
  \iffieldundef{series}
    {}
    {\setunit{\addspace}%
     \printtext[parens]{%
       \printfield{series}%
       \setunit*{\addspace}%
       \printfield{number}}}%
  \newunit}




% modified driver
\DeclareBibliographyDriver{book}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{author/editor+others/translator+others}%
  \setunit{\labelnamepunct}\newblock
  \usebibmacro{maintitle+title}%
    \newunit
  \iffieldundef{maintitle}
    {\printfield{volume}%
     \printfield{part}}
    {}%
  \newunit
  \printlist{language}%
  \newunit\newblock
  \usebibmacro{byauthor}%
  \newunit\newblock
  \usebibmacro{byeditor+others}%
  \newunit\newblock
  \printfield{edition}%
  \newunit
  \printfield{volumes}%
  \newunit\newblock
  \printfield{note}%
  \newunit\newblock
  \usebibmacro{publisher+location+date}%
  \newunit\newblock
  \usebibmacro{series+number}%
  \newunit\newblock
  \usebibmacro{chapter+pages}%
  \newunit
  \printfield{pagetotal}%
  \newunit\newblock
  \iftoggle{bbx:isbn}
    {\printfield{isbn}}
    {}%
  \newunit\newblock
  \usebibmacro{doi+eprint+url}%
  \newunit\newblock
  \usebibmacro{addendum+pubstate}%
  \setunit{\bibpagerefpunct}\newblock
  \usebibmacro{pageref}%
  \newunit\newblock
  \iftoggle{bbx:related}
    {\usebibmacro{related:init}%
     \usebibmacro{related}}
    {}%
  \usebibmacro{finentry}}


%%%%%%%%%%%% SCHIZOFRENIA---> CAMBIO DI STILE QUANDO SI STAMPA LA BIBLIOGRAFIA%%%%%%%%%%%%%%%%

\AtBeginBibliography{\renewcommand*{\revsdnamepunct}{}}                                 % No virgola tra nome e cognome
\AtBeginBibliography{\renewcommand*{\bibnamedash}{\bibstring[\mkibid]{idem\thefield{gender}}}}

\DeclareNameFormat{sortname}{%                                                          %Nomi smallcaps, ma non editor!
  \renewcommand{\mkbibnamefamily}[1]{\textsc{\MakeLowercase{##1}}}%
  \renewcommand{\mkbibnamegiven}[1]{\textsc{\MakeLowercase{##1}}}%
  \ifgiveninits
    {\usebibmacro{name:given-family}
      {\namepartfamily}
      {\namepartgiveni}
      {\namepartprefix}
      {\namepartsuffix}}
    {\usebibmacro{name:given-family}
      {\namepartfamily}
      {\namepartgiven}
      {\namepartprefix}
      {\namepartsuffix}}%
  \usebibmacro{name:andothers}}


\addbibresource{archivio.bib}  

\begin{document}
First, I'm citing this\footcite{Her:Mon}\\
Then same editor\footcite{Foz:Mys}
\printbibliography
\end{document}

答案1

\bibnamedash通常不应该打印文本,它被假定为只是标点符号。由于这个假设,一些标点符号命令被移动,以便它们不会打印在后面,\bibnamedash以避免奇怪的双重标点符号。如果\bibnamedash应该打印文本,我们需要修改调用它的宏,以允许标点符号宏位于后面\bibnamedash

这些重新定义是基于这些宏的原始定义authortitle.bbxauthoryear样式需要不同的修改。

\makeatletter
\renewbibmacro*{author}{%
  \ifboolexpr{
    test \ifuseauthor
    and
    not test {\ifnameundef{author}}
  }
    {\usebibmacro{bbx:dashcheck}
       {\bibnamedash}
       {\printnames{author}%
        \usebibmacro{bbx:savehash}}%
     \setunit{\printdelim{authortypedelim}}%
     \usebibmacro{authorstrg}}
    {\global\undef\bbx@lasthash}}

\renewbibmacro*{bbx:editor}[1]{%
  \ifboolexpr{
    test \ifuseeditor
    and
    not test {\ifnameundef{editor}}
  }
    {\usebibmacro{bbx:dashcheck}
       {\bibnamedash}
       {\printnames{editor}%
        \usebibmacro{bbx:savehash}}%
     \setunit{\printdelim{editortypedelim}}%
     \usebibmacro{#1}%
     \clearname{editor}}
    {\global\undef\bbx@lasthash}}

\renewbibmacro*{bbx:translator}[1]{%
  \ifboolexpr{
    test \ifusetranslator
    and
    not test {\ifnameundef{translator}}
  }
    {\usebibmacro{bbx:dashcheck}
       {\bibnamedash}
       {\printnames{translator}%
        \usebibmacro{bbx:savehash}}%
     \setunit{\printdelim{translatortypedelim}}%   
     \usebibmacro{#1}%
     \clearname{translator}}
    {\global\undef\bbx@lasthash}}
\makeatother

\AtBeginBibliography{\renewcommand*{\bibnamedash}{\bibstring[\mkibid]{idem\thefield{gender}}}}据我所知,使用过多没有任何好处

\renewcommand*{\bibnamedash}{\bibstring[\mkibid]{idem\thefield{gender}}}

所以你可以把它放在\AtBeginBibliography这里。

在此处输入图片描述

相关内容