我正在尝试使用LaTeX 模板在这里。
我正在尝试使用变体 A:外部参考书目样式,如下所示:
%=====================================
% References, variant A: external bibliography
%=====================================
\externalbibliography{yes}
\bibliography{MDPI_1_Refs}
%=====================================
% References, variant B: internal bibliography
%=====================================
%\begin{thebibliography}{999}
%% Reference 1
我已经创建了名为 MDPI_1_Refs.bib 的 .bib 文件:
@article{Harries,
author = {Harries, Keith},
title = {Property Crimes and Violence in United States: An Analysis of the Influence of Population Density},
journal = {Int J Criminal Justice Sci},
volume = {1},
year = {2007},
type = {Journal Article}
}
@article{Battin,
author = {Battin, Joshua R. and Crowl, Justin N.},
title = {Urban sprawl, population density, and crime: an examination of contemporary migration trends and crime in suburban and rural neighborhoods},
journal = {Crime Prevention and Community Safety},
volume = {19},
number = {2},
pages = {136-150},
ISSN = {1743-4629},
DOI = {10.1057/s41300-017-0020-9},
url = {https://doi.org/10.1057/s41300-017-0020-9},
year = {2017},
type = {Journal Article}
}
我正在使用 WinEdt 和 PDFLaTeXify
我读过一些论坛帖子,例如这和这,但我仍然无法生成参考文献。您能帮助我如何使用外部文件正确生成此期刊模板的参考文献.bib
吗?
当我查看该'blg
文件时,我得到了以下信息:
[0] Config.pm:311> INFO - This is Biber 2.16
[0] Config.pm:314> INFO - Logfile is 'Paper_MDPI_PlasticDatabase1.blg'
[279] biber-MSWIN64:340> INFO - ===
[1060] Utils.pm:411> ERROR - Cannot find 'Paper_PlasticDatabase1.bcf'!
[1061] Biber.pm:132> INFO - ERRORS: 1
PDFLaTeX
这是WinEdt 中执行模式窗口的屏幕截图:
答案1
我假设您下载了模板并将其放在新目录中。它应该有一个文件template.tex
和一个Definitions
子目录。
我没有使用模板,而是新建了一个文件TestingMDPI.tex
。将它和你的 MDPI_1_Refs.bib
文件放在同一个目录中。
TestingMDPI.tex
只有引言加上短语 Citing two journal papers \cite{Harries,Battin}.
现在使用TestingMDPI
进行编译pdflatex
。如果处理链已经biber
合并,现在不用担心。经过几次构建后,您应该得到如下输出
请注意,没有一个部分参考并且还说Citing two journal papers [?,?]
。
现在运行bibtex TestingMDPI
。(无扩展名)我不使用 WinEdt,所以我无法提供帮助。您始终可以从命令窗口运行它。(bibtex
是.exe
路径中的文件)
在控制台中你应该得到
Process started: bibtex.exe "TestingMDPI"
bibtex: security risk: running with elevated privileges
This is BibTeX, Version 0.99d (MiKTeX 21.3)
The top-level auxiliary file: TestingMDPI.aux
The style file: Definitions/mdpi.bst
Database file #1: MDPI_1_Refs.bib
Process exited normally
再次运行pdflatex
。这次参考文献部分将出现两篇论文(未编号),并且仍然
Citing two journal papers [?,?]
再做一次。现在你应该有最终版本了:
Citing two journal papers [1,2]
(有时需要多次运行直到一切稳定)
如果一切顺利,下一步就是配置 WinEdt 处理链,用 替换biber
,bibtex
以便整个过程自行运行。
% !TeX TS-program = pdflatex
%=================================================================
\documentclass[journal,article,submit,moreauthors,pdftex]{Definitions/mdpi}
%=================================================================
% MDPI internal commands
\firstpage{1}
\makeatletter
\setcounter{page}{\@firstpage}
\makeatother
\pubvolume{1}
\issuenum{1}
\articlenumber{0}
%\doinum{}
\pubyear{2021}
\copyrightyear{2020}
%\externaleditor{Academic Editor: Firstname Lastname} % For journal Automation, please change Academic Editor to "Communicated by"
\datereceived{}
\dateaccepted{}
\datepublished{}
\hreflink{https://doi.org/} % If needed use \linebreak
%------------------------------------------------------------------
% Full title of the paper (Capitalized)
\Title{Title}
% MDPI internal command: Title for citation in the left column
\TitleCitation{Title}
% Author Orchid ID: enter ID or remove command
\newcommand{\orcidauthorA}{0000-0000-0000-000X} % Add \orcidA{} behind the author's name
% Authors, for the paper (add full first names)
\Author{Firstname Lastname $^{1,\dagger,\ddagger}$\orcidA{}, Firstname Lastname $^{1,\ddagger}$ and Firstname Lastname $^{2,}$*}
% MDPI internal command: Authors, for metadata in PDF
\AuthorNames{Firstname Lastname, Firstname Lastname and Firstname Lastname}
% MDPI internal command: Authors, for citation in the left column
\AuthorCitation{Lastname, F.; Lastname, F.; Lastname, F.}
% If this is a Chicago style journal: Lastname, Firstname, Firstname Lastname, and Firstname Lastname.
% Affiliations / Addresses (Add [1] after \address if there is only one affiliation.)
\address{%
$^{1}$ \quad Affiliation 1; [email protected]\\
$^{2}$ \quad Affiliation 2; [email protected]}
% Contact information of the corresponding author
\corres{Correspondence: [email protected]; Tel.: (optional; include country code; if there are multiple corresponding authors, add author initials) +xx-xxxx-xxx-xxxx (F.L.)}
% Current address and/or shared authorship
\firstnote{Current address: Affiliation 3}
\secondnote{These authors contributed equally to this work.}
% Abstract (Do not insert blank lines, i.e. \\)
\abstract{A single paragraph of about 200 words maximum. For research articles, abstracts should give a pertinent overview of the work. We strongly encourage authors to use the following style of structured abstracts, but without headings: (1) Background: place the question addressed in a broad context and highlight the purpose of the study; (2) Methods: describe briefly the main methods or treatments applied; (3) Results: summarize the article's main findings; (4) Conclusion: indicate the main conclusions or interpretations. The abstract should be an objective representation of the article, it must not contain results which are not presented and substantiated in the main text and should not exaggerate the main conclusions.}
% Keywords
\keyword{keyword 1; keyword 2; keyword 3 (List three to ten pertinent keywords specific to the article; yet reasonably common within the subject discipline.)}
\begin{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setcounter{section}{-1} %% Remove this when starting to work on the template.
\section{How to Use this Template}
The template details the sections that can be used in a manuscript. Note that the order and names of article sections may differ from the requirements of the journal (e.g., the positioning of the Materials and Methods section). Please check the instructions on the authors' page of the journal to verify the correct order and names. For any questions, please contact the editorial office of the journal or [email protected]. For LaTeX-related questions please contact [email protected].
\section{Introduction}
The introduction should briefly place the study in a broad context and highlight why it is important. It should define the purpose of the work and its significance. The current state of the research field should be reviewed carefully and key publications cited. Please highlight controversial and diverging hypotheses when necessary. Finally, briefly mention the main aim of the work and highlight the principal conclusions. As far as possible, please keep the introduction comprehensible to scientists outside your particular field of research.
Citing two journal papers \cite{Harries,Battin}. %<<<<<<<<<<<<<<<<<<<<<<< needed
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{paracol}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\reftitle{References}
%=====================================
% References, variant A: external bibliography
%=====================================
\externalbibliography{yes}
\bibliography{MDPI_1_Refs.bib}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{document}
添加自在 WinEdt 中使用 LaTeX2e 的 BibTex未经测试,可能比较旧。
按下以下组合键:
CTL-SHIFT-L CTL-SHIFT-B CTL-SHIFT-L CTL-SHIFT-L
你完成了!以下是发生的事情:
CTL-SHIFT-L 运行 LaTeX2e。由于该程序设计用于 BibTeX,并且您已在 TeX 文件中使用了代码,因此它会生成一个名为“example.aux”的文件,其中包含您在文档中使用的所有引文。
CTL-SHIFT-B 运行 BibTeX。这会搜索“.aux”文件,在 BibTeX 文件中搜索相关引用,并创建一个名为“example.bbl”的文件。此文件包含您在 TeX 文件中引用的作品所需的所有信息。
再次运行 LaTeX2e。有了目录中的参考书目文件(example.bbl),LaTeX 就可以正确地在文档中创建参考书目。
再次运行 LaTeX2e 以确保所有参考资料匹配。
答案2
我想指出这一点,以防有人遇到同样的问题。我很难用新的(2022)mdpi 的 LateX 模板运行 bibtex。卸载并重新安装所有内容后,我在第 250 行中将注释 mdpi.bst 的重复函数放入注释中,它对我来说工作正常
FUNCTION {format.key}
{ empty$
{ key field.or.null }
{ "" }
if$
}
答案3
我遇到了类似的问题,当我尝试加载外部 bib 文件时,我的日志文件显示此错误。
INFO texify.core - start process: miktex-bibtex.exe template FATAL texify.core - BibTeX failed for some reason. FATAL texify.core - Data: FATAL texify.core - Source: Programs\MiKTeX\texify\mcd.cpp:1363 FATAL texify - BibTeX failed for some reason. FATAL texify - Info: FATAL texify - Source: Programs\MiKTeX\texify\mcd.cpp FATAL texify - Line: 1363
我刚刚从 mdpi.bst 中删除了第 250 行的这段代码
FUNCTION {format.key} { empty$ { key field.or.null } { "" } if$ }
所以它起作用了