写论文到了添加参考文献,整合论文修改阶段,此处专注添加参考文献。
如何配置VScode下的Latex编辑环境参考: 这里
https://blog.csdn.net/jh1513/article/details/103647961
我主要出错原因如下:
1.要使用 \usepackage{cite}
2. 要设置参考文献格式 \bibliographystyle{ieeetr}
3. 引用时使用的标签,要和你 bib 文件中对应的上
4. 生成参考文献时一种顺序为xe->bib->xe->xe, 也就是说后面要把文章编译两次,这个是在VScode latex设置中配置的,具体看前面提到的链接。
代码如下
\documentclass{article}
\author{Me}
\title{Test on Reference}
\usepackage{cite}
\begin{document}
\maketitle
This is a test~\cite{taphoorn2010review} of reference.
\bibliographystyle{ieeetr} % reference style
\bibliography{References} % reference library
\end{document}
这个东西我还没有搞太懂,但是测试是通过的
{
// Latex workshop
"latex-workshop.latex.tools": [
{
"name": "latexmk",
"command": "latexmk",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"-pdf",
"%DOC%"
]
},
{
"name": "xelatex",
"command": "xelatex",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"%DOC%"
]
},
{
"name": "pdflatex",
"command": "pdflatex",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"%DOC%"
]
},
{
"name": "bibtex",
"command": "bibtex",
"args": [
"%DOCFILE%"
]
}
],
"latex-workshop.latex.recipes": [
{
"name": "xelatex",
"tools": [
"xelatex"
]
},
{
"name": "latexmk",
"tools": [
"latexmk"
]
},
{
"name": "pdflatex -> bibtex -> pdflatex*2",
"tools": [
"pdflatex",
"bibtex",
"pdflatex",
"pdflatex"
]
},
{
"name": "xelatex",
"tools": [
"xelatex"
]
},
{
"name": "xelatex->bibtex->xelatex->xelatex",
"tools": [
"xelatex",
"bibtex",
"xelatex",
"xelatex",
]
}
],
"latex-workshop.view.pdf.viewer": "tab",
"latex-workshop.latex.clean.fileTypes": [
"*.aux",
"*.bbl",
"*.blg",
"*.idx",
"*.ind",
"*.lof",
"*.lot",
"*.out",
"*.toc",
"*.acn",
"*.acr",
"*.alg",
"*.glg",
"*.glo",
"*.gls",
"*.ist",
"*.fls",
"*.log",
"*.fdb_latexmk"
],
"editor.fontSize": 16,
"window.zoomLevel": 0,
// "latex-workshop.view.pdf.external.synctex.command": "C:\Program Files\SumatraPDF/SumatraPDF.exe",
// "latex-workshop.view.pdf.external.synctex.args": [
// "-forward-search",
// "%TEX%",
// "%LINE%",
// "-reuse-instance",
// "-inverse-search",
// "code \"C:\\Users\\CHEN\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app\\out\\cli.js\" -r -g \"%f:%l\"",
// "%PDF%",
// ],
}