!額外的 },或忘記了 \endgroup。在我的 bbl 檔案中

!額外的 },或忘記了 \endgroup。在我的 bbl 檔案中

這是我的.tex文件:

\documentclass[a4paper, oneside, 12pt]{article}

\usepackage[style=nature, url=true]{biblatex}
\usepackage{hyperref}
\addbibresource{C:/library.bib}

\begin{document}
\cite{Kaplan2005}

\printbibliography

\end{document}

這是我的.bbl文件:

% $ biblatex auxiliary file $
% $ biblatex bbl format version 3.0 $
% Do not modify the above lines!
%
% This is an auxiliary file used by the 'biblatex' package.
% This file may safely be deleted. It will be recreated by
% biber as required.
%
\begingroup
\makeatletter
\@ifundefined{[email protected]}
  {\@latex@error
     {Missing 'biblatex' package}
     {The bibliography requires the 'biblatex' package.}
      \aftergroup\endinput}
  {}
\endgroup


\refsection{0}
  \datalist[entry]{none/global//global/global}
    \entry{Kaplan2005}{incollection}{}
      \name{author}{2}{}{%
        {{hash=d7aa6cd4dd81f6a39f9e4ed67f086e5b}{%
           family={Kaplan},
           familyi={K\bibinitperiod},
           given={H.},
           giveni={H\bibinitperiod}}}%
        {{hash=5b840a8b71b2be7ce05d995becdf0667}{%
           family={Gurven},
           familyi={G\bibinitperiod},
           given={M.},
           giveni={M\bibinitperiod}}}%
      }
      \name{editor}{1}{}{%
        {{hash=7a12290827e9d3657d5103137b676795}{%
           family={{H. Gintis, S. Bowles}},
           familyi={H\bibinitperiod},
           given={R.\bibnamedelimi Boyd\bibnamedelimb {\&}\bibnamedelimb E.\bibnamedelimi Fehrs},
           giveni={R\bibinitperiod\bibinitdelim B\bibinitperiod\bibinitdelim \&}\bibinitperiod\bibinitdelim E\bibinitperiod\bibinitdelim F\bibinitperiod}}}%
      }
      \list{publisher}{1}{%
        {MIT Press}%
      }
      \strng{namehash}{481ebb51e63e034bd84329e6d6525632}
      \strng{fullhash}{481ebb51e63e034bd84329e6d6525632}
      \strng{bibnamehash}{481ebb51e63e034bd84329e6d6525632}
      \strng{authorbibnamehash}{481ebb51e63e034bd84329e6d6525632}
      \strng{authornamehash}{481ebb51e63e034bd84329e6d6525632}
      \strng{authorfullhash}{481ebb51e63e034bd84329e6d6525632}
      \strng{editorbibnamehash}{7a12290827e9d3657d5103137b676795}
      \strng{editornamehash}{7a12290827e9d3657d5103137b676795}
      \strng{editorfullhash}{7a12290827e9d3657d5103137b676795}
      \field{sortinit}{1}
      \field{sortinithash}{2174f786c6195e7fe2ee1c229b416e29}
      \field{labelnamesource}{author}
      \field{labeltitlesource}{shorttitle}
      \field{annotation}{From Duplicate 2 ( The natural history of human food sharing and cooperation: a review and a new multi-individual approach to the negotiation of norms - Kaplan, H.; Gurven, M. )}
      \field{booktitle}{Moral sentiments and material interests: The foundations of cooperation in economic life}
      \field{shorttitle}{The natural history of human food sharing and coop}
      \field{title}{{The Natural History of Human Food Sharing and Cooperation : A Review and a New Multi-Individual Approach to the Negotiation of Norms}}
      \field{year}{2005}
      \field{pages}{75\bibrangedash 113}
      \range{pages}{39}
      \verb{file}
      \verb :C$\backslash$:/Users/Kaplan, Gurven - 2005 - The Natural History of Human Food Sharing and Cooperation A Review and a New Multi-Individual Approach to the N.pdf:pdf
      \endverb
      \verb{urlraw}
      \verb http://www.anth.ucsb.edu/faculty/gurven/papers/kaplangurven.pdf
      \endverb
      \verb{url}
      \verb http://www.anth.ucsb.edu/faculty/gurven/papers/kaplangurven.pdf
      \endverb
    \endentry
  \enddatalist
\endrefsection
\endinput

當我嘗試編譯時,它給了我錯誤

! Extra }, or forgotten \endgroup.` on line 41.

我認為它正在談論文件的第 41 行,即上面程式碼中的.bbl上面一行。\list{publisher}{1}{%

那為什麼還有一個額外的東西}呢?我的檔案是由 Mendeley 應用程式自動產生的,我在 Mendeley 的參考資料中.bib沒有看到任何額外的細節。}然後.bblTeXmaker 使用指令產生該檔案biber %

答案1

LaTeX 在第 41 行報告錯誤,但這只是錯誤變得明顯的地方。真正的問題在於之前的那一行。第 40 行.bbl包含

giveni={R\bibinitperiod\bibinitdelim B\bibinitperiod\bibinitdelim \&}\bibinitperiod\bibinitdelim E\bibinitperiod\bibinitdelim F\bibinitperiod}}}%

如果你數一下大括號,你會發現後面的括號\&關閉了 中的左括號giveni={。該行中的以下右括號比預期更早關閉了一組,這意味著第 41 行中的右大括號沒有剩餘要關閉的群組。

文件的內容.bbl表明您的.bib條目Kaplan2005包含editor類似於以下內容的字段

editor = {{H. Gintis, S. Bowles}, R. Boyd {\&} E. Fehrs},

這是在名稱欄位中給予多個名稱的錯誤格式。名稱必須以 分隔and,因此正確的輸入是

editor = {H. Gintis and S. Bowles and R. Boyd and E. Fehrs},

參見例如如何在bibtex檔案中正確寫入多位作者?


我還注意到title條目字段.bib看起來大致如下

title = {{The Natural History of Human Food Sharing and Cooperation :
          A Review and a New Multi-Individual Approach to the Negotiation of Norms}}

據推測,雙大括號的作用是對標題應用所見即所得的大小寫保護。我認為這是不好的做法。如果您不想將標題轉換為句首字母大寫,請使用不應用句首字母大寫的樣式,或告訴您的樣式停止它

\DeclareFieldFormat{titlecase}{#1}

只有那些即使在句子大小寫中也絕不能小寫的單字(專有名稱等)才應該受到保護。也可以看看BibTeX 在建立 .bbl 檔案時遺失大寫字母在參考書目資料庫中儲存標題時使用的正確大小寫是什麼?

冒號之前的空格在英文排版中也不常見(但在法語中則不然,但即使在那裡,也應該確保換行不會顯得奇怪,目前您允許在冒號之前換行)。

相關內容