我正在处理参考书目。为此有两种方法,一种是使用 bibtex,另一种是 biber。当我使用 biber 打印参考书目时,它会给出我想要的结果。这意味着它可以在我的文档中的特定位置打印标题、作者等。但 bibtex 无法做到这一点。使用 bibtex,我的参考书目已生成,但当我使用它\citeauthor{is4562000}
打印作者姓名时,它显示“作者?”。我们可以使用 bibtex 打印作者姓名、标题和年份吗?这是代码。
demo.bib
@book{is4562000,
title={Indian Standard Plain and reinforced concrete--code of
practice (IS 456 : 2000)},
shorttitle = {IS 456~:~2000},
author={Cement and Concrete Sectional Committee, CED 2},
%author={Morrison, Norving,peter},
journal={New Delhi: },
year={2000},
publisher={Bureau of Indian Standards},
}
主要文件
\documentclass[a4paper,10pt]{article}
\usepackage{natbib}
%Includes "References" in the table of contents
%\usepackage[nottoc]{tocbibind}
%Title, date an author of the document
\title{Bibliography management: BibTeX}
\author{Manpreet}
%Begining of the document
\begin{document}
\maketitle
\tableofcontents
\medskip
\section{First Section}
This is bibliography using bibtex \cite{is4562000}\\
\citeauthor{is4562000}
\bibliographystyle{unsrt}
\bibliography{demo}
\end{document}
输出
答案1
您犯了两个错误:作者是公司员工,因此必须使用额外的括号;其次,bib 样式与 不兼容natbib
,请使用unsrtnat
。
注意该author
字段应该是
author={{Cement and Concrete Sectional Committee, CED 2}},
这是一个完整的例子,我使用它filecontents*
只是为了避免破坏我的文件。
\begin{filecontents*}{\jobname.bib}
@book{is4562000,
title={Indian Standard Plain and reinforced concrete--code of practice (IS 456 : 2000)},
shorttitle = {IS 456~:~2000},
author={{Cement and Concrete Sectional Committee, CED 2}},
journal={New Delhi: },
year={2000},
publisher={Bureau of Indian Standards},
}
\end{filecontents*}
\documentclass[a4paper,10pt]{article}
\usepackage{natbib}
%Includes "References" in the table of contents
%\usepackage[nottoc]{tocbibind}
%Title, date an author of the document
\title{Bibliography management: BibTeX}
\author{Manpreet}
%Begining of the document
\begin{document}
\maketitle
\tableofcontents
\medskip
\section{First Section}
This is bibliography using bibtex \cite{is4562000}
\citeauthor{is4562000}
\bibliographystyle{unsrtnat}
\bibliography{\jobname}
\end{document}
答案2
它来自您的书目风格,即unsrt
。
使用书目格式plainnat
,
\RequirePackage{filecontents}
\begin{filecontents}{\jobname.bib}
@book{is4562000,
author={{Cement and Concrete Sectional Committee, CED 2}},
title={Indian Standard Plain and reinforced concrete--code of practice (IS 456 2000)},
shorttitle = {IS 456~:~2000},
journal={New Delhi: },
year={2000},
publisher={Bureau of Indian Standards},
}
\end{filecontents}
\documentclass[a4paper,10pt]{article}
\usepackage{natbib}
\begin{document}
This is bibliography using bibtex \cite{is4562000}.
\citeauthor{is4562000}.
\bibliographystyle{plainnat}
\bibliography{\jobname}
\end{document}
我们得到
我同意,这并不是很好。
有了biber
,你可以拥有
\RequirePackage{filecontents}
\begin{filecontents}{\jobname.bib}
@book{is4562000,
author={{Cement and Concrete Sectional Committee, CED 2}},
title={Indian Standard Plain and reinforced concrete--code of practice (IS 456 2000)},
shorttitle = {IS 456~:~2000},
journal={New Delhi: },
year={2000},
publisher={Bureau of Indian Standards},
}
\end{filecontents}
\documentclass[a4paper,10pt]{article}
\usepackage[backend=biber]{biblatex}
\addbibresource{\jobname}
\begin{document}
This is bibliography using biber~\cite{is4562000}.
\citeauthor{is4562000}
\printbibliography
\end{document}
第三个选项是使用biblatex
,我推荐这个(个人喜好)。它支持\citeauthor{key}
命令:
\RequirePackage{filecontents}
\begin{filecontents}{\jobname.bib}
@book{is4562000,
author={{Cement and Concrete Sectional Committee, CED 2}},
title={Indian Standard Plain and reinforced concrete--code of practice (IS 456 2000)},
shorttitle = {IS 456~:~2000},
journal={New Delhi: },
year={2000},
publisher={Bureau of Indian Standards},
}
\end{filecontents}
\documentclass[a4paper,10pt]{article}
\usepackage[backend=bibtex]{biblatex}
\addbibresource{\jobname}
\begin{document}
This is bibliography using biblatex \cite{is4562000}.
\citetitle{is4562000}.
\citeauthor{is4562000}.
\printbibliography
\end{document}
给你: