我正在用 LaTex 写一个项目,当我插入参考文献时,它不起作用。我在 bib 文件中命名的名称只会以粗体形式出现在 pdf 中。
这是我的代码:
\usepackage[backend=biber,style=authoryear,autocite=inline]{biblatex}
\usepackage[style=numeric,sorting=none]{biblatex}
\addbibresource{Bibliography.bib}
\usepackage[labelfont={bf, it}]{caption}
\captionsetup{font=footnotesize, textfont=it}
\usepackage{graphicx}
\usepackage{epstopdf}
\usepackage{float}
\usepackage[normalem]{ulem}
\useunder{\uline}{\ul}{}
\usepackage[T1]{fontenc}
\usepackage[table,xcdraw]{xcolor}
\usepackage{multicol}
\usepackage{adjustbox}
\usepackage{array}
\usepackage{wrapfig}
\usepackage{multirow}
\usepackage{tabu}
\usepackage{rotating}
\usepackage{amsmath}
%\usepackage[table,xcdraw]{xcolor}
\usepackage[a4paper, total={6in, 9in}]{geometry}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead[L]{\fontsize{10}{12}}
\linespread{1.5}
\usepackage{times}
\usepackage[none]{hyphenat}
\sloppy
\usepackage{hyperref}
\usepackage[utf8]{inputenc}
我的 bib 文件如下所示:
@article{t,
title = {Technological Aspects of β-Carotene Production},
journal = {Food and Bioprocess Technology},
volume = {4},
number = {5},
pages = {693-701},
year = {2011},
issn = {19355149, 19355130},
author = {Ribeiro, Bernardo Dias and Barreto, Daniel Weingart and Coelho, Maria Alice Zarur}
}
然后,当我使用时,t 将以粗体显示在 pdf 中~autocite{t}
。此外,我在主文件中输入:\printbibliography[title={Bibliography}]
答案1
前两行代码片段将产生错误
! LaTeX Error: Option clash for package biblatex.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
这是当您两次加载具有冲突选项的包时收到的典型消息。通常最好避免多次加载包。
代替
\usepackage[backend=biber,style=authoryear,autocite=inline]{biblatex}
\usepackage[style=numeric,sorting=none]{biblatex}
只需一条\usepackage
指令即可加载biblatex
所需选项。例如
\usepackage[backend=biber, style=authoryear]{biblatex}
修复前言后,您应该删除临时文件(,,,.aux
... )并使用 LaTeX、Biber、LaTeX、LaTeX 重新编译。请参阅.bbl
.bcf
使用问号或粗体引用关键字代替引用编号和Biblatex 与 Biber:配置我的编辑器以避免未定义的引用寻求帮助让您的编辑器为您运行 Biber。biber 故障排除可以作为解决简单 Biber 问题的切入点。
t
解决该错误后,当您使用 pdfLaTeX引用该条目时,可能会出现第二个错误
! Package inputenc Error: Unicode character β (U+03B2)
(inputenc) not set up for use with LaTeX.
默认情况下,标题中的原始 β 无法处理inputenc
。如果您使用 Unicode 引擎(XeLaTeX 或 LuaLaTeX),则这不是问题。使用 pdfLaTeX,您可以帮助 LaTeX 以及
\DeclareUnicodeCharacter{03B2}{\ensuremath{\beta}}
或者使用textgreek
包
\usepackage{textgreek}
\DeclareUnicodeCharacter{03B2}{\textbeta}
平均能量损失
\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[backend=biber, style=authoryear]{biblatex}
\usepackage{textgreek}
\DeclareUnicodeCharacter{03B2}{\textbeta}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{t,
author = {Ribeiro, Bernardo Dias and Barreto, Daniel Weingart
and Coelho, Maria Alice Zarur},
title = {Technological Aspects of β-Carotene Production},
journal = {Food and Bioprocess Technology},
volume = {4},
number = {5},
pages = {693-701},
year = {2011},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}
\begin{document}
\cite{sigfridsson,t}
\printbibliography
\end{document}