我在序言中说过:
\documentclass{article}
\usepackage{amssymb,amstext,amsmath,latexsym,mathtools}
\usepackage[italian,british]{babel}
\usepackage{pdfpages}
\usepackage[utf8,latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{csquotes}
\usepackage{cmbright}
\usepackage{setspace}
\usepackage{pdfpages}
\usepackage{hyperref}
\usepackage[style=authoryearcomp,firstinits=true,maxcitenames=2,maxbibnames=99]{biblatex}
\DeclareNameAlias{sortname}{last-first}
\DeclareFieldFormat[article,periodical]{volume}{\mkbibbold{#1}}
\renewcommand*{\multinamedelim}{\addcomma\space}
\renewcommand*{\finalnamedelim}{\addcomma\space}
\renewbibmacro{in:}{}
\addbibresource{trybib.bib}
\nocite{*}
我收到以下两个错误:
conflicting options
'firstinits' conflicts with'uniquename=true'
和
Data encoding is 'latin1'
Use backend=bibtex8 or backend=biber
我需要所有这些包,我该如何修复这些错误?
答案1
我只需要做一些整理和清理,
以下问题可能与您相关:
- 如何使用 biber
- biber .bcf 文件扩展名
- utf8 还是 latin1 输入编码?
- 更改文件编码
- hyperref 之后要加载哪些包?
- 人们默认加载哪些包?
- lmodern 与 cm-super 对比
- 字体包
之后,我只需要按照biblatex
提示操作即可。
以下内容应该可以顺利编译,不会出现任何警告/错误。
请注意注释。
\documentclass{article}
\usepackage{amssymb,amstext,amsmath,latexsym,mathtools} % do you really need all?
\usepackage{pdfpages} % you had that package twice
\usepackage{setspace}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc} % use utf8 for all files
\usepackage[italian,british]{babel}
\usepackage{cmbright} % needs the cm-super package to be installed
% \usepackage{lmodern} % try this one instead of cm-bright + cm-super
\usepackage[autostyle]{csquotes}
\usepackage[
backend=biber, % run biber.exe instead of bibtex.exe
style=authoryear-comp,
firstinits=true,
uniquename=init, % this option is compatible with firstinits
maxcitenames=2,
maxbibnames=99
]{biblatex}
\DeclareNameAlias{sortname}{last-first}
\DeclareFieldFormat[article,periodical]{volume}{\mkbibbold{#1}}
\renewcommand*{\multinamedelim}{\addcomma\space}
\renewcommand*{\finalnamedelim}{\addcomma\space}
\renewbibmacro{in:}{}
\addbibresource{biblatex-examples.bib}
\usepackage{hyperref} % hyperref should usually be the last package
\hypersetup{
colorlinks=true
}
\begin{document}
Lorem ipsum, dolor sit amet \cite{kastenholz}.
At vero utilisam \cite{bertram}.
\printbibliography
\end{document}