我正在尝试通过以下方式将书目添加到我的报告中。但是,它不会发生。检查了很多教程和文档,但我无法显示它。有什么好主意吗?
\documentclass[12pt, openany]{report}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[french]{babel}
\usepackage{libertine}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{soul}
\usepackage[left=1cm,right=1cm,top=1cm,bottom=1cm]{geometry}
\usepackage{graphicx} %inclusion de figures
\usepackage{pstricks,pst-node} %Graphiques
\newcommand{\hsp}{\hspace{20pt}}
\newcommand{\HRule}{\rule{\linewidth}{0.5mm}}
\newlength\mytemplength
\newcommand\parboxc[3]{%
\settowidth{\mytemplength}{#3}%
\parbox[#1][#2]{\mytemplength}{\centering #3}%
}
\usepackage{verbatimbox}
\newcommand{\ts}{\textsuperscript}
% for custom chapter
\usepackage[svgnames, x11names]{xcolor}
\newcommand*\ftsize[1]{\fontsize{#1pt}{\numexpr 1.2*#1\relax pt}\selectfont}
\newcommand*\chapsubtitle[1]{{\LARGE #1}}
\newcommand\maketabular[1]{\begin{tabular}[b]{l}
#1
\end{tabular}}
\usepackage{colortbl}
\usepackage{titlesec}
\titleformat{\chapter}[block]{\usefont{T1}{phv}{m}{n}}{%
\vskip -120pt
\hspace{-10pt}
\begin{tabular}[b]{c !{\color{gray}\vline width1.5pt}}{\large\color{gray} \textls{CHAPITRE}}\\[2ex] \fontsize{40}{40}\selectfont\thechapter\end{tabular}}{1em}{\bfseries\fontsize{30}{30}\selectfont\maketabular}%[]
% to fix float's positions by being able to use the H property
\usepackage{float}
% for another level of subsections (subsubsubsection)
\setcounter{tocdepth}{4}
\setcounter{secnumdepth}{4}
% set the margins
\newgeometry{vmargin={30mm}, hmargin={20mm}}
% config of the header & footer
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\lhead{\leftmark}
\rfoot{\thepage}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
% fix footnote's position to bottom
\usepackage[bottom]{footmisc}
\usepackage{setspace}
% for tikz positioning
\usepackage{tikz}
\usepackage{tkz-graph}
\usetikzlibrary{chains, decorations.pathreplacing, shapes.multipart, positioning}
% making the table of content clickable
\usepackage{hyperref}
% bibliography
\usepackage{cite}
\usepackage[backend=biber]{biblatex}
\addbibresource{3-appendices/references.bib}
% URLs
\usepackage{url}
% appendixes
\usepackage{hyperref}
\usepackage{cleveref}
% for blank pages
\usepackage{afterpage}
% paragraph formatting
\renewcommand{\baselinestretch}{1.4}
\begin{document}
\include{0-configuration/configurations}
\include{1-opening/1.1-cover}
%\pagenumbering{roman}
\newpage
\thispagestyle{empty}
\afterpage{\null\newpage}
\newpage
\include{1-opening/1.2-signings}
\newpage
\include{1-opening/1.3-acknowledgments}
\include{1-opening/1.4-abstract}
\newpage
\tableofcontents
\listoffigures
\listoftables
\newpage
\include{2-chapters/2.0-introduction}
\printbibliography[title = {References}]
\addcontentsline{toc}{chapter}{\protect\numberline{}References}
\end{document}
先感谢您!
答案1
该代码示例实际上并不是最小的(它加载了不相关的包)并且没有真正起作用(它包含许多\include
我们不知道其内容的 s)。
序言中一个明确的错误来源是包cite
和biblatex
都已加载。但这两个包不兼容,只能加载其中一个。其余代码建议您使用biblatex
,因此您可能应该删除\usepackage{cite}
。
\printbibliography[title = {References}]
\addcontentsline{toc}{chapter}{\protect\numberline{}References}
应替换为
\printbibliography[title = {References}, heading=bibintoc]
您还应尝试仅加载一次包。仅加载您需要的包。hyperref
通常应最后加载(此规则有几个例外:cleveref
例如必须在之后加载hyperref
)。