如果第 2 章包含在书籍类别中,则不会显示参考书目

如果第 2 章包含在书籍类别中,则不会显示参考书目

这是这个帖子

在下面给出的代码中,如果我注释掉第 2 章,我可以正确显示参考书目。如果取消注释第 2 章,则不会显示任何参考书目:

\documentclass[paper=a4, pagesize=auto, BCOR=0.75cm, DIV=10, numbers=noenddot, captions=heading, captions=nooneline ,listof=totoc, bibliography=totoc, index=totoc, headings=normal, USenglish]{scrbook}

\usepackage{lipsum}

\usepackage[headsepline,footsepline,plainfootsepline]{scrpage2}
\pagestyle{scrheadings}

\setheadwidth[-7.5mm]{1.175\textwidth}
%
% headline color
\setheadsepline{.5pt}[\color{Navy}]
\setfootsepline{.5pt}[\color{Navy}]

\newcommand*{\ORIGchapterheadstartvskip}{}%

\let\ORIGchapterheadstartvskip=\chapterheadstartvskip

\renewcommand*{\chapterheadstartvskip}{%
  \ORIGchapterheadstartvskip
  {\color{Navy}%
    \setlength{\parskip}{0pt}%
    \noindent\rule[.3\baselineskip]{\linewidth}{1pt}\par
  }%
}
% see above
\newcommand*{\ORIGchapterheadendvskip}{}%
\let\ORIGchapterheadendvskip=\chapterheadendvskip
\renewcommand*{\chapterheadendvskip}{%
  {\color{Navy}%
    \setlength{\parskip}{0pt}%
    \noindent\rule[.3\baselineskip]{\linewidth}{1pt}\par
  }%
  \ORIGchapterheadendvskip
}

\usepackage{marvosym}

\usepackage{fix-cm, etex, thinsp, xspace, calc}
% --------------------------------------------------------------------
\usepackage[T1]{fontenc}        % EC fonts
\usepackage[utf8]{inputenc}     % coding UTF-8


\usepackage[showerrors, svgnames, table]{xcolor}

% --------------------------------------------------------------------
\usepackage{graphicx, rotating, ltablex, dcolumn, booktabs}
\usepackage{siunitx}

    \renewcommand{\floatpagefraction}{0.75}% Standard = 0.5
    \renewcommand{\textfraction}{0.15}% Standard = 0.2

    \renewcommand{\topfraction}{0.8}% Standard = 0.7
    \setcounter{topnumber}{3} % vorher: 2
    \setcounter{bottomnumber}{1} % vorher: 1
    \setcounter{totalnumber}{5} % vorher: 3

    \renewcommand{\dbltopfraction}{.8}% Standard = 0.7
    \renewcommand{\dblfloatpagefraction}{.6}% Standard = 0.5


    \tolerance 1414
    \hbadness 1414
    \emergencystretch 1.5em
    \hfuzz 0.3pt
    \widowpenalty = 2500
    \displaywidowpenalty = 2500
    \vfuzz \hfuzz
    \raggedbottom
\DeclareOption{tanz}{\raggedbottom}
\ProcessOptions\relax

  \deffootnote{2.25em}{1.75em}{\thefootnotemark.\enspace}

%========================================================================================
%   Bibliography
%========================================================================================

\usepackage[refsection=chapter,defernumbers=true,sorting=none,sortcites=true,autopunct=true,babel=hyphen,hyperref=true,abbreviate=false,backref=true,backend=biber]{biblatex}   \addbibresource{chap1.bib}% BibTeX
 \defbibheading{bibempty}{}
 \newcommand*{\refname}{Bibliography}

\usepackage{expl3,xparse}
\ExplSyntaxOn% syntax of expl3 on

\cs_new_eq:Nc \emph_old:n { emph~ } % Copying the old definition of `\emph`
\cs_new_eq:NN \emph_braces:n \textup % Braces should be typeset upright.
\cs_new:Npn \emph_new:n #1 {
    \tl_set:Nn \l_emph_tl {#1}
    \tl_replace_all:Nnn \l_emph_tl {(}{\emph_braces:n{(}}
    \tl_replace_all:Nnn \l_emph_tl {)}{\emph_braces:n{)}}
    \tl_replace_all:Nnn \l_emph_tl {[}{\emph_braces:n{[}}
    \tl_replace_all:Nnn \l_emph_tl {]}{\emph_braces:n{]}}
    \exp_args:NV \emph_old:n \l_emph_tl
}
\RenewDocumentCommand {\emph} {sm} {
    \IfBooleanTF {#1} {\emph_old:n {#2}}
    {\emph_new:n {#2}}
}
          %
\AtEveryCitekey{\RenewDocumentCommand{\emph}{m}{%
    \emph_old:n {#1}}
}
\AtBeginBibliography{\RenewDocumentCommand{\emph}{m}{%
    \emph_old:n {#1}}
}
\ExplSyntaxOff% syntax of expl3 on
%
% --------------------------------------------------------------------

\usepackage[iso]{isodate}

% --------------------------------------------------------------------
% line breaks in URLs at "-"
\PassOptionsToPackage{hyphens}{url}
% --------------------------------------------------------------------
% PDF settings
\ifpdfoutput{% needs a KOMA-Script class!!!

\usepackage[final, kerning, babel, protrusion=true, expansion=true, tracking=true]{microtype}
   \DeclareMicrotypeSet*[tracking]{my}{ font = */*/*/sc/* }%
      \SetTracking{ encoding = *, shape = sc }{ 45 }

\usepackage[pdftex, plainpages=false, colorlinks, linkcolor={Navy}, citecolor={Navy}, linktocpage={true}, breaklinks, pdfcreator={pdflatex}, pdfstartview=FitH, bookmarksopen=true]{hyperref}
%
\usepackage{bookmark}% bookmark cleanup
}%
%% -----------------------------------
%% non-PDF branch
{%
   \usepackage[xetex,linktocpage={true}, breaklinks]{hyperref}
%
% optimized margin alignment with microtype:
   \usepackage[final, DVIoutput, kerning, babel, protrusion=true]{microtype}
}
%
\usepackage[figure]{hypcap} % links to the upper edge of floating environments
%
%% ============================================================================
% extended handling of figures
\usepackage[caption=false]{subfig}
%
%% ============================================================================
% intelligent cross references
\usepackage{cleveref}
%% ============================================================================
% Fonts
\usepackage{textcomp} % Text Companion fonts which provide many text symbols in the TS1 encoding.
%
%% -- Palatino with Bera fonts
    \linespread{1.05}\selectfont      % line spread for Palatino
    \usepackage[scaled=.88]{beramono} % Bera-Monospace
    \usepackage[scaled=.86]{berasans} % Bera Sans-Serif
    \usepackage[sc,osf]{mathpazo}     % Palatino with small caps and minuscel numbers

\usepackage{amsmath}

\usepackage{fixmath}

   \typearea[current]{last}    % with DIV=[number]

\usepackage{textcomp} % required for \texteuro
\usepackage{eurosym}  % required for \euro

\usepackage{lscape} %landscape pages support

\usepackage{imakeidx}
\makeindex[options=-s StyleInd.ist]

\begin{document}

%% ============================================================================
\KOMAoptions{cleardoublepage=plain}
\addtokomafont{caption}{\centering}% all caption lines as multilines
%% ============================================================================

\frontmatter

\subject{\ }
\title{WinEdt}
\subtitle{Quick Guide}
\author{\textsc{Aleksander Simonič}\\ \small{\copyright~1993--2015}}
\date{}
%

\maketitle

\tableofcontents

\listoffigures

\mainmatter

\chapter{First Chapter}
This chapter give you an idea of how the reference is not showing up \cite{egan}.
\section{Test 1}
\lipsum
%\chapter{Second Chapter}
%\lipsum


\backmatter

%\printbibliography
\section*{Bibliography}
\addcontentsline{toc}{section}{Bibliography}

\subsection*{Books}
\printbibliography[heading=bibempty,type=book,prefixnumbers={B}]

\subsection*{Articles}
\printbibliography[heading=bibempty,type=article,prefixnumbers={A}]

\subsection*{Online}
\printbibliography[heading=bibempty,type=online,prefixnumbers={O}]

\cleardoublepage
\setlength{\columnsep}{0.75cm}
\addcontentsline{toc}{chapter}{\textcolor{ocre}{Index}}
\printindex

\end{document}

你能告诉我如何让参考书目适用于多个章节吗?

答案1

您使用的是refsection=chapter。因此,在某一章中,您只能获得该章的参考文献。您在此处打印的参考书目是第 2 章的参考书目。但是第 2 章没有参考文献,因为没有引用任何内容。因此,没有要打印的参考书目。将您想要的命令添加到第一章,而不是第二章。

\usepackage[refsection=chapter,defernumbers=true,sorting=none,sortcites=true,autopunct=true,babel=hyphen,hyperref=true,abbreviate=false,backref=true,backend=biber]{biblatex}

如果您不想使用每章的参考部分,请不要告诉 Biblatex 这样做:

\usepackage[sorting=none,sortcites=true,autopunct=true,babel=hyphen,hyperref=true,abbreviate=false,backref=true,backend=biber]{biblatex}

您确定您想要sorting=nonebabel=hyphen吗?

相关内容