我預計在編譯參考書目時會出現“,”或“}”錯誤

我預計在編譯參考書目時會出現“,”或“}”錯誤

我正在嘗試編譯以下 bib 檔案:

   @article {Conway10612,
    author = {Conway, J. H. and Torquato, S.},
    title = {Packing, tiling, and covering with tetrahedra},
    volume = {103},
    number = {28},
    pages = {10612--10617},
    year = {2006},
    doi = {10.1073/pnas.0601389103},
    publisher = {National Academy of Sciences},
    abstract = {It is well known that three-dimensional Euclidean space cannot be tiled by regular tetrahedra. But how well can we do? In this work, we give several constructions that may answer the various senses of this question. In so doing, we provide some solutions to packing, tiling, and covering problems of tetrahedra. Our results suggest that the regular tetrahedron may not be able to pack as densely as the sphere, which would contradict a conjecture of Ulam. The regular tetrahedron might even be the convex body having the smallest possible packing density.},
    issn = {0027-8424},
    URL = {https://www.pnas.org/content/103/28/10612},
    eprint = {https://www.pnas.org/content/103/28/10612.full.pdf},
    journal = {Proceedings of the National Academy of Sciences}
}

@book{cite-key,
    Address = {New York},
    Annote = {Bibliography: p. {$[$}335{$]$}-336.},
    Author = {Rudin, Walter},
    Date-Added = {2020-11-10 00:19:08 -0500},
    Date-Modified = {2020-11-10 00:19:08 -0500},
    Et = {3d ed..},
    Id = {01HOLLINS{\_}ALMA2160070510003751},
    Keywords = {Mathematical analysis},
    Publisher = {New York : McGraw-Hill},
    Title = {Principles of mathematical analysis},
    Ty = {BOOK},
    Year = {1976}
    }

@misc{wolfram blog, 
    title={Tetrahedra Packing}, url={https://blog.wolfram.com/2010/08/30/tetrahedra-packing/}, 
    journal={Wolfram Blog}
    }

@misc{my geometry project, 
    title={Polyhedrons Lesson}, url={https://reginageomfinproj.weebly.com/polyhedrons-lesson.html}, 
    journal={My geometry project}
    }
    
@misc{american mathematical society, 
    title={AMS :: Feature Column :: Packing Tetrahedra}, 
    url={http://www.ams.org/publicoutreach/feature-column/fc-2012-11}, 
    journal={American Mathematical Society}
    } 

@misc{madeel_madeelmadeel15166 bronze badges_crococroco5_1966, 
    title={Drawing 3D lattice using TikZ}, 
    url={https://tex.stackexchange.com/questions/380828/drawing-3d-lattice-using-tikz}, 
    journal={TeX}, 
    author={Madeel and madeelmadeel15166 bronze badges and CroCoCroCo5}, 
    year={1966}, 
    month={Oct}
    } 

@misc{how do you translate a function?, 
    title={How Do You Translate a Function?: Printable Summary: Virtual Nerd},
    url={https://virtualnerd.com/worksheetHelper.php?tutID=Alg2_02_01_0006}, 
    journal={How Do You Translate a Function? | Printable Summary | Virtual Nerd}
    } 

當我嘗試編譯文件時,除了前兩個引用之外,所有引用都出現以下錯誤:

I was expecting a ',' or a '}'

我在 bib 文件中找不到錯誤。有人可以建議如何修復此錯誤嗎?

答案1

如果您查看檔案中的錯誤訊息\jobname.blg(其中\jobname是主 tex 檔案的名稱),您會注意到所有錯誤都與條目鍵中存在空格有關。例如,對於 bib 檔案中的第三個項目,我們會發現以下錯誤訊息:

  I was expecting a `,' or a `}'---line 36 of file mybib.bib
     : @misc{wolfram 
     :               blog,
  I'm skipping whatever remains of this entry

(旁白:在您的貼文中,您僅顯示了錯誤訊息的連續四行中的第一行。)

BibTeX 確實如此不是條目的鍵中允許有空格。這就是wolfram blog拋出錯誤的原因。 BibTeX 處理完wolfram空格後,預計會遇到逗號(正常情況)或字元}(這將完全終止條目);大概不常見,但從文法上來說仍然有效。相反,它遇到了“blog”,它別無選擇,只能拋出錯誤訊息。

補救措施?做不是在條目的鍵中使用空格。

相關內容