更改參考書目條目和 babel 問題的格式

更改參考書目條目和 babel 問題的格式

我想更改參考書目條目的顯示格式。我嘗試過重新定義宏,但由於我也在babel包中使用愛沙尼亞語,它會覆蓋我的定義。目前,該條目

@inproceedings{gan,
  author    = {Ian Goodfellow and Jean Pouget-Abadie and Mehdi Mirza and Bing Xu and David Warde-Farley and Sherjil Ozair and Aaron Courville Yoshua Bengio},
  title     = {Generative adversarial networks},
  booktitle = {{NIPS}},
  editor    = {Z. Ghahramani and M. Welling and C. Cortes and N. D. Lawrence and K. Q. Weinberger},
  pages     = {2672--2680},
  year      = {2014},
  publisher = {Curran Associates, Inc.},
  location  = {New York},
}

顯示為

古德費洛(Ian Goodfellow)、讓·普熱-阿巴迪(Jean Pouget-Abadie)、邁赫迪·米爾扎(Mehdi Mirza)、徐兵(Bing Xu)、大衛·沃德·法利(David Warde-Farley)、謝爾吉爾·奧扎爾(Sherjil Ozair) 和亞倫·考維爾(Aaron Courville) 約書亞·本吉奧(Yoshua Bengio)。生成對抗網路。泰西斯:國家資訊處理計劃。托伊姆。 Z. Ghahramani、M. Welling、C. Cortes、ND Lawrence 和 KQ Weinberger。紐約:Curran Associates, Inc.,2014 年,lk。 2672–2680。

但希望它顯示為

Ian Goodfellow、Jean Pouget-Abadie、Mehdi Mirza、Bing Xu、David Warde-Farley、Sherjil Ozair 和 Aaron Courville Yoshua Bengio 2014。 -國家資訊處理計劃。埃德。 Z. Ghahramani、M. Welling、C. Cortes、ND Lawrence 和 KQ Weinberger。紐約:Curran Associates, Inc.,第 2672–2680 頁

應該booktitle是斜體。

例如,我嘗試重新定義in:bibmacro

\renewbibmacro*{in:}{%
  \setunit{\addperiod\space\textendash\space}}

但由於babel輸出沒有改變。

編輯,新增 MWEB

\documentclass{article}

\usepackage[estonian .notilde]{babel}

\usepackage[backend=biber, citestyle=authoryear, maxbibnames=99]{biblatex}
\DeclareFieldFormat{labelnumberwidth}{} % Doesn't print anything in the label
\setlength{\biblabelsep}{0pt} % Eliminates the spacing before the entries
\DeclareFieldFormat*{title}{#1} % No quotation marks

% This redefinition doesn't change anything due to babel
\renewbibmacro*{in:}{%
  \setunit{\addperiod\space\textendash\space}}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@inproceedings{gan,
  author    = {Ian Goodfellow and Jean Pouget-Abadie and Mehdi Mirza and Bing Xu and David Warde-Farley and Sherjil Ozair and Aaron Courville Yoshua Bengio},
  title     = {Generative adversarial networks},
  booktitle = {{NIPS}},
  editor    = {Z. Ghahramani and M. Welling and C. Cortes and N. D. Lawrence and K. Q. Weinberger},
  pages     = {2672--2680},
  year      = {2014},
  publisher = {Curran Associates, Inc.},
  location  = {New York},
}
\end{filecontents}

\addbibresource{\jobname.bib}

\begin{document}
    \parencite{gan}
    \printbibliography
\end{document}

答案1

estonain.lbx重新定義了bibmacro in:\DeclareBibliographyExtras以一種與分離風格和本地化的想法相悖的方式,但有時這被認為是必要的;類似的效果可以在英語中看到)如何去除三個或更多作者列表中的“牛津逗號”?, 法語:在 biblatex 中保持小寫, 義大利語:Biblatex 中的自訂破折號,一個更極端的例子是magyar.lbx)。如果您想覆蓋該定義,則需要將其放在\DefineBibliographyExtras{estonian}.

我還根據您的範例條目更改了一些bibstrings(我不認識任何愛沙尼亞語,我只是採用了英文字串)。

請注意,我切換到完整authoryear樣式,style=authoryear,而不是偽造它citestyle=authoryear,並抑制數字標籤。

\documentclass{article}
\usepackage[estonian.notilde]{babel}
\usepackage{csquotes}

\usepackage[backend=biber, style=authoryear, maxbibnames=99]{biblatex}

\DeclareFieldFormat*{title}{#1}

\DefineBibliographyExtras{estonian}{%
  \renewbibmacro*{in:}{%
    \setunit{\addperiod\space\textendash\space}}}

\DefineBibliographyStrings{estonian}{
  editor           = {ed\adddot},
  editors          = {ed\adddot},
  byeditor         = {ed\adddot},
  page             = {p\adddot},
  pages            = {pp\adddot},
}

\begin{filecontents}{\jobname.bib}
@inproceedings{gan,
  author    = {Ian Goodfellow and Jean Pouget-Abadie and Mehdi Mirza
               and Bing Xu and David Warde-Farley and Sherjil Ozair
               and Aaron Courville Yoshua Bengio},
  title     = {Generative adversarial networks},
  booktitle = {{NIPS}},
  editor    = {Z. Ghahramani and M. Welling and C. Cortes
               and N. D. Lawrence and K. Q. Weinberger},
  pages     = {2672--2680},
  year      = {2014},
  publisher = {Curran Associates, Inc.},
  location  = {New York},
}
\end{filecontents}

\addbibresource{\jobname.bib}

\begin{document}
  \parencite{gan}
  \printbibliography
\end{document}

Goodfellow、Ian、Jean Pouget-Abadie、Mehdi Mirza、Bing Xu、David Warde-Farley、Sherjil Ozair 和 Aaron Courville Yoshua Bengio (2014)。生成對抗網路。 – NIPS。埃德。 Z. Ghahramani、M. Welling、C. Cortes、ND Lawrence 和 KQ Weinberger。紐約:Curran Associates, Inc.,第 2672–2680 頁。

相關內容