Biblatex / 第二作者姓名已初始化

Biblatex / 第二作者姓名已初始化

有没有办法自动初始化作者的第二个名字?在我的例子中:不是“Peter Eli”而是“Peter E.”。(显然我知道我可以在 bibtex 文件中初始化)。

\RequirePackage{filecontents}
\begin{filecontents}{mybib.bib}
@article{gordon2004,
  title = {Continental divide: {{Ernst Cassirer}} and {{Martin Heidegger}} at {{Davos}}, 1929 -- an allegory of intellectual history},
  author = {Gordon, Peter Eli},
  date = {2004},
  journaltitle = {Modern Intellectual History},
  shortjournal = {Modern Intellectual History},
  volume = {1},
  number = {2},
  pages = {219--248},
  publisher = {{Cambridge University Press}},
  issn = {1479-2451}
}
@article{gordon2005,
  title = {Myth and modernity: {{Cassirer}}'s critique of {{Heidegger}}},
  author = {Gordon, Peter Eli},
  date = {2005},
  journaltitle = {New German Critique},
  number = {94},
  pages = {127--168}
}
\end{filecontents}

\documentclass{book}
\usepackage[style=philosophy-verbose, maxbibnames=2, minbibnames=1, maxsortnames=2, scauthorsbib=false, doi=false, isbn=false,url=false,eprint=false, citepages=suppress]{biblatex}
\bibliography{Mybib.bib}
\begin{document}
\cite{gordon2004} e \cite{gordon2005}.
\printbibliography
\end{document}

答案1

biblatex 和 biber 允许您自定义数据模型名称部分,以添加您需要的任何名称部分。因此,要实现真正的中间名,以便您可以正确控制其首字母:

% First add middle name as a real name part in the data model
\begin{filecontents}[force]{\jobname.dbx}
\DeclareDatamodelConstant[type=list]{nameparts}{prefix,family,suffix,given,middle}
\end{filecontents}
  
% Use the biber extended name format to specify the middle name explicltly
\begin{filecontents}[force]{\jobname.bib}
@article{gordon2004,
  title = {Continental divide: {{Ernst Cassirer}} and {{Martin Heidegger}} at {{Davos}}, 1929 -- an allegory of intellectual history},
  author = {family=Gordon, given=Peter, middle=Eli},
  date = {2004},
  journaltitle = {Modern Intellectual History},
  shortjournal = {Modern Intellectual History},
  volume = {1},
  number = {2},
  pages = {219--248},
  publisher = {{Cambridge University Press}},
  issn = {1479-2451}
}
@article{gordon2005,
  title = {Myth and modernity: {{Cassirer}}'s critique of {{Heidegger}}},
  author = {family=Gordon, given=Peter, middle=Eli},
  date = {2005},
  journaltitle = {New German Critique},
  number = {94},
  pages = {127--168}
}
\end{filecontents}

\documentclass{book}
% Adding a namepart to the datamodel automatically creates the relevant
% <part>inits package option:
\usepackage[style=philosophy-verbose, maxbibnames=2, minbibnames=1, maxsortnames=2, scauthorsbib=false, doi=false, isbn=false,url=false,eprint=false, citepages=suppress,datamodel=\jobname,middleinits=true]{biblatex}
\addbibresource{\jobname.bib}

% Expand the name printing macro so that middle name is now a separate argument
\newcommand{\mkbibcompletenamegivenmiddlefamily}{\mkbibcompletename}
\newbibmacro*{name:given-middle-family}[5]{%
  \usebibmacro{name:delim}{#2#4#1}%
  \usebibmacro{name:hook}{#2#4#1}%
  \mkbibcompletenamegivenmiddlefamily{%
    \ifdefvoid{#2}
      {}
      {\mkbibnamegiven{#2}\isdot\bibnamedelimd}%
    \ifdefvoid{#3}
      {}
      {\mkbibnamemiddle{#3}\isdot\bibnamedelimd}%
    \ifdefvoid{#4}
      {}
      {\mkbibnameprefix{#4}\isdot
       \ifprefchar
         {}
         {\ifuseprefix{\bibnamedelimc}{\bibnamedelimd}}}%
    \mkbibnamefamily{#1}\isdot
    \ifdefvoid{#5}{}{\bibnamedelimd\mkbibnamesuffix{#5}\isdot}}}


% Adjust the name format to pass the correct middle name format depending
% on package options. \if<namepart>inits is automatically created when
% adding a name part to the datamodel.
\DeclareNameAlias{author}{given-middle-family}
\DeclareNameFormat{given-middle-family}{%
  \ifgiveninits
    {\ifmiddleinits
      {\usebibmacro{name:given-middle-family}
        {\namepartfamily}
        {\namepartgiveni}
        {\namepartmiddlei}
        {\namepartprefix}
        {\namepartsuffix}}
      {\usebibmacro{name:given-middle-family}
        {\namepartfamily}
        {\namepartgiveni}
        {\namepartmiddle}
        {\namepartprefix}
        {\namepartsuffix}}
      }
    {\ifmiddleinits
      {\usebibmacro{name:given-middle-family}
        {\namepartfamily}
        {\namepartgiven}
        {\namepartmiddlei}
        {\namepartprefix}
        {\namepartsuffix}}
      {\usebibmacro{name:given-middle-family}
        {\namepartfamily}
        {\namepartgiven}
        {\namepartmiddle}
        {\namepartprefix}
        {\namepartsuffix}}}%
  \usebibmacro{name:andothers}}

\begin{document}
\cite{gordon2004}\\
\cite{gordon2005}
\printbibliography
\end{document}

在此处输入图片描述

相关内容