“我找不到 \citation 命令”,我使用了 backend=bibtex 并且配置了 bibtex.exe

“我找不到 \citation 命令”,我使用了 backend=bibtex 并且配置了 bibtex.exe

我之前的问题还没有解决。我遇到了 TexMaker 的问题,打开时提示“文件未找到” Thesis.tex。问题链接是 https://tex.stackexchange.com/questions/339701/file-not-found-which-i-have-ready-activated-pdflatex

我用记事本打开了我的 tex 文件,复制了脚本并创建了新的 tex 文件。现在,当我编译数据时,出现了以下错误:

This is BibTeX, Version 0.99d (MiKTeX 2.9) The top-level auxiliary file: Thesis.aux 
I found no \citation commands---while reading file Thesis.aux 
I found no \bibdata command---while reading file Thesis.aux 
I found no \bibstyle command---while reading file Thesis.aux 
(There were 3 error messages)

我该如何解决这个问题?更新后的脚本非常短,出现新错误:我无法打开文件名“test.aux”

谢谢

\documentclass{article}  
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{microtype}
\usepackage[backend=bibtex,
                style=authoryear,
                natbib=true, 
                style=numeric-comp
                ]{biblatex}    
\usepackage[english]{babel}
\usepackage{filecontents}
\begin{document}  
\begin{filecontents*}{\jobname.bib}
  @book{ASH,
    author = {Seiffert, U. & Wech, L.},
    year = {2003},
    title = {Automotive Safety Handbook},
  }
\end{filecontents*}
Test of bibliography: 
This comes from \cite{ASH}.
\printbibliography
\end{document} 

答案1

评论太长了,但是这是您问题中代码的有效版本:

变化:

  • 在条目中用and代替。作者应始终用关键字 分隔。单独使用和无论如何都会产生错误,因为它是用作表格等中的列分隔符的活动字符,因此您需要在文本中打印一个 & 符号。&authorand&\&

  • \Bib.bib-> \jobname.bib

  • 已添加\addbibresource{\jobname.bib}。请注意,它是在filecontents环境之后添加的,以确保在\addbibresource查找文件时该文件存在。

  • 对唯一条目添加了引用:\cite{ASH}

如果您收到有关文件或类似内容的错误.aux,请尝试删除.aux.bbl文件,然后再运行两次pdflatexbibtexpdflatex

\documentclass{article}  
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{microtype}
\usepackage[backend=bibtex,
                style=authoryear,
                natbib=true, 
                style=numeric-comp
                ]{biblatex}    
\usepackage[english]{babel}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
  @book{ASH,
    author = {Seiffert, U. and Wech, L.},
    year = {2003},
    title = {Automotive Safety Handbook},
  }
\end{filecontents*}
\addbibresource{\jobname.bib}
\begin{document}  
\cite{ASH}
\printbibliography
\end{document} 

相关内容