使用 biblatex-ms 更改特定字段的语言

使用 biblatex-ms 更改特定字段的语言

我正在用法语编写文档,XeLaTeX并用它biblatex来管理包含其他语言的参考资料。当我需要更改某些字段的语言设置时,我通常会手动将文本封装在包otherlanguage提供的环境中babel。我最近发现了这一点,biblatex-msbiber-ms提供了一种使用注释和mslang标签的方法(请参阅https://github.com/plk/biblatex/issues/895)。但是,我无法让它工作。考虑这个 MWE:

\documentclass[a4paper,12pt]{article}

\usepackage{fontspec}
\usepackage[english, french]{babel}
\usepackage{csquotes}

\begin{filecontents}[force]{\jobname.bib}
@article{Coles59a,
    author = {Coles, John M.},
    date = {1959/1960},
    doi = {10.9750/psas.093.16.134},
    journal = {\begin{otherlanguage}{english}Proceedings of the Society of Antiquaries of Scotland\end{otherlanguage}},
    pages = {16-134},
    title = {\begin{otherlanguage}{english}Scottish Late Bronze Age Metalwork: Typology, Distribution and Chronology\end{otherlanguage}},
    volume = {93}}
}

@article{Coles59b,
    author = {Coles, John M.},
    date = {1959/1960},
    doi = {10.9750/psas.093.16.134},
    journal = {Proceedings of the Society of Antiquaries of Scotland},
    journal+an:mslang = {=en},
    pages = {16-134},
    title = {Scottish Late Bronze Age Metalwork: Typology, Distribution and Chronology},
    title+an:mslang = {=en},
    volume = {93}}
}
\end{filecontents}

\usepackage[style=authoryear, autofieldlang=other, dashed=false]{biblatex-ms}
        
\addbibresource{./\jobname.bib}

\begin{document}

\nocite{*}

\printbibliography

\end{document}

输出为:

MWE 的输出

第二篇参考文献的标题按照法国规则处理,在“Metalwork”后添加了一个额外的不间断空格。如何使用biblatex-ms注释系统避免这种情况?

我正在使用biblatex-ms4.0biber-ms和最新的 Tex Live 2024 发行版。

.bbl生成的文件如下biber-ms所示:

\refsection{0}
  \datalist[entry]{nyt/global//global/global}
    \entry{Coles59a}{article}{}
      \name[default][fr-fr]{author}{1}{}{%
        {{un=0,uniquepart=base,hash=c4358b6a0351f56cc2935f5f1b4a4b37}{%
           family={Coles},
           familyi={C\bibinitperiod},
           given={John\bibnamedelima M.},
           giveni={J\bibinitperiod\bibinitdelim M\bibinitperiod},
           givenun=0}}%
      }
      \namepartms{author}{1}{%
          familydefaultfr-fr={Coles},
          familydefaultfr-fri={C\bibinitperiod},
          givendefaultfr-fr={John\bibnamedelima M.},
          givendefaultfr-fri={J\bibinitperiod\bibinitdelim M\bibinitperiod}
      }
      \strng{namehash}{c4358b6a0351f56cc2935f5f1b4a4b37}
      \strng{fullhash}{c4358b6a0351f56cc2935f5f1b4a4b37}
      \strng{bibnamehash}{c4358b6a0351f56cc2935f5f1b4a4b37}
      \strng{authordefaultfr-frbibnamehash}{c4358b6a0351f56cc2935f5f1b4a4b37}
      \strng{authordefaultfr-frnamehash}{c4358b6a0351f56cc2935f5f1b4a4b37}
      \strng{authordefaultfr-frfullhash}{c4358b6a0351f56cc2935f5f1b4a4b37}
      \field{extraname}{1}
      \field{sortinit}{C}
      \strng{sortinithash}{4d103a86280481745c9c897c925753c0}
      \field{extradate}{1}
      \field{extradatescope}{labelyear}
      \field{labeldatesource}{}
      \fieldmssource{labelname}{author}{default}{fr-fr}
      \fieldmssource{labeltitle}{title}{default}{fr-fr}
      \field{endyear}{1960}
      \field[default][fr-fr]{journaltitle}{\begin{otherlanguage}{english}Proceedings of the Society of Antiquaries of Scotland\end{otherlanguage}}
      \field[default][fr-fr]{title}{\begin{otherlanguage}{english}Scottish Late Bronze Age Metalwork: Typology, Distribution and Chronology\end{otherlanguage}}
      \field{volume}{93}
      \field{year}{1959}
      \field{enddateera}{ce}
      \field{dateera}{ce}
      \true{nocite}
      \field{pages}{16\bibrangedash 134}
      \range{pages}{119}
      \verb{doi}
      \verb 10.9750/psas.093.16.134
      \endverb
    \endentry
    \entry{Coles59b}{article}{}
      \name[default][fr-fr]{author}{1}{}{%
        {{un=0,uniquepart=base,hash=c4358b6a0351f56cc2935f5f1b4a4b37}{%
           family={Coles},
           familyi={C\bibinitperiod},
           given={John\bibnamedelima M.},
           giveni={J\bibinitperiod\bibinitdelim M\bibinitperiod},
           givenun=0}}%
      }
      \namepartms{author}{1}{%
          familydefaultfr-fr={Coles},
          familydefaultfr-fri={C\bibinitperiod},
          givendefaultfr-fr={John\bibnamedelima M.},
          givendefaultfr-fri={J\bibinitperiod\bibinitdelim M\bibinitperiod}
      }
      \strng{namehash}{c4358b6a0351f56cc2935f5f1b4a4b37}
      \strng{fullhash}{c4358b6a0351f56cc2935f5f1b4a4b37}
      \strng{bibnamehash}{c4358b6a0351f56cc2935f5f1b4a4b37}
      \strng{authordefaultfr-frbibnamehash}{c4358b6a0351f56cc2935f5f1b4a4b37}
      \strng{authordefaultfr-frnamehash}{c4358b6a0351f56cc2935f5f1b4a4b37}
      \strng{authordefaultfr-frfullhash}{c4358b6a0351f56cc2935f5f1b4a4b37}
      \field{extraname}{2}
      \field{sortinit}{C}
      \strng{sortinithash}{4d103a86280481745c9c897c925753c0}
      \field{extradate}{2}
      \field{extradatescope}{labelyear}
      \field{labeldatesource}{}
      \fieldmssource{labelname}{author}{default}{fr-fr}
      \fieldmssource{labeltitle}{title}{default}{fr-fr}
      \field{endyear}{1960}
      \field[default][fr-fr]{journaltitle}{Proceedings of the Society of Antiquaries of Scotland}
      \field[default][fr-fr]{title}{Scottish Late Bronze Age Metalwork: Typology, Distribution and Chronology}
      \field{volume}{93}
      \field{year}{1959}
      \field{enddateera}{ce}
      \field{dateera}{ce}
      \true{nocite}
      \field{pages}{16\bibrangedash 134}
      \range{pages}{119}
      \verb{doi}
      \verb 10.9750/psas.093.16.134
      \endverb
      \annotation[default][fr-fr]{field}{journaltitle}{mslang}{}{}{0}{en}
      \annotation[default][fr-fr]{field}{title}{mslang}{}{}{0}{en}
    \endentry
  \enddatalist
\endrefsection
\msforms{default}
\msentrylangs{fr-fr}
\mslangs{fr-fr}

\endinput

相关内容