无法添加引文

无法添加引文

我有一个 tex 文件,内容如下:

\documentclass[10pt,conference]{IEEEtran}
\input{preamble}
\usepackage{cite}
...
\begin{document}
...
\input{text/introduction.tex}
...
\bibliography{Bib/proj_name}

\end{document}

Bib/proj_name.bib:

@article{Snorkel2017,
  title =  {Snorkel: Rapid Training Data Creation with Weak Supervision},
  author =  {Alexander Ratner, Stephen H. Bach, Henry Ehrenberg, Jason Fries, Sen Wu, Christopher Ré},
  year =    {2017},
  note =    {\url{https://arxiv.org/abs/1711.10160}}
}

文本/介绍.tex:

\section{Introduction}
\label{sec::intro}
Recently, Snorkel \cite{Snorkel2017} ...

但是,我得到:

LaTeX Warning: Citation `Snorkel2017' on page 1 undefined on input line 4.

使用的 Makefile:

LATEX = TEXINPUTS=$(TEXINPUTS):packages pdflatex
PAPER = proj_name

# Run once, then re-run until it's happy
# Input redirected from /dev/null is like hitting ^C at first error
$(PAPER).pdf: $(wildcard *.tex) $(wildcard text/*.tex) $(wildcard *.bib)
    $(LATEX) $(PAPER).tex </dev/null
    bibtex $(PAPER)
    $(LATEX) $(PAPER).tex </dev/null
    $(LATEX) $(PAPER).tex </dev/null
    gs -q -dNOPAUSE -dBATCH -dPDFSETTINGS=/prepress -dEmbedAllFonts=true \
       -dDownsampleColorImages=false -dAutoFilterColorImages=false \
       -dColorImageFilter=/FlateEncode -sDEVICE=pdfwrite -sOutputFile=$(PAPER)-embed.pdf \
       $(PAPER).pdf
    cp $(PAPER)-embed.pdf $(PAPER).pdf

当然,我使用 来运行它make。我已经研究过可能的复制,但正如您在 makefile 中看到的,我已经完成了所有这些操作。有人可以帮我吗?谢谢...

编辑:

blg 文件:

This is BibTeX, Version 0.99d (TeX Live 2019/Debian)
Capacity: max_strings=200000, hash_size=200000, hash_prime=170003
The top-level auxiliary file: proj_name.aux
I found no \bibstyle command---while reading file proj_name.aux
You've used 1 entry,
            0 wiz_defined-function locations,
            86 strings with 524 characters,
and the built_in function-call counts, 0 in all, are:
= -- 0
> -- 0
< -- 0
+ -- 0
- -- 0
* -- 0
:= -- 0
add.period$ -- 0
call.type$ -- 0
change.case$ -- 0
chr.to.int$ -- 0
cite$ -- 0
duplicate$ -- 0
empty$ -- 0
format.name$ -- 0
if$ -- 0
int.to.chr$ -- 0
int.to.str$ -- 0
missing$ -- 0
newline$ -- 0
num.names$ -- 0
pop$ -- 0
preamble$ -- 0
purify$ -- 0
quote$ -- 0
skip$ -- 0
stack$ -- 0
substring$ -- 0
swap$ -- 0
text.length$ -- 0
text.prefix$ -- 0
top$ -- 0
type$ -- 0
warning$ -- 0
while$ -- 0
width$ -- 0
write$ -- 0
(There was 1 error message)

答案1

.blg文件中的错误信息

I found no \bibstyle command---while reading file proj_name.aux

\bibliographystyle意味着您的文档上没有命令。

如果您想使用 BibTeX,则文档中只需要一个\bibliographystyle{<style>}命令。将它放在哪里其实并不重要(它可以放在序言或文档正文中),但大多数人要么将它放在序言中其他参考书目/引文设置的旁边,要么直接放在\bibliography正文中的调用旁边。

对于IEEEtran文档类我可能会使用\bibliographystyle{IEEEtran}

\documentclass[10pt,conference]{IEEEtran}

\bibliographystyle{IEEEtran}
 
\begin{document}

\section{Introduction}
\label{sec::intro}
Recently, Snorkel \cite{Snorkel2017} ...

\bibliography{Bib/proj_name}

\end{document}

正如评论中提到的,您的.bib文件可能需要重写一点。authors 必须用 分隔,and并且非 ASCII 字符需要转义。 此外,我不想将其@article用于尚未在期刊上正式发表且仅在 arXiv 上可用的论文。

所以我的.bib看起来更像

@misc{Snorkel2017,
  title         =  {Snorkel: Rapid Training Data Creation with Weak Supervision},
  author        =  {Alexander Ratner and Stephen H. Bach and Henry Ehrenberg
                    and Jason Fries and Sen Wu and Christopher R{\'e}},
  year          =  {2017},
  howpubslished =  {\url{https://arxiv.org/abs/1711.10160}},
}

不过,书目IEEEtran样式支持url字段,所以我实际上更喜欢

@misc{Snorkel2017,
  title  =  {Snorkel: Rapid Training Data Creation with Weak Supervision},
  author =  {Alexander Ratner and Stephen H. Bach and Henry Ehrenberg
             and Jason Fries and Sen Wu and Christopher R{\'e}},
  year   =  {2017},
  url    =  {https://arxiv.org/abs/1711.10160},
}

相关内容