格式化 Splitbib 类别标题的布局

格式化 Splitbib 类别标题的布局

我正在使用splitbib包来生成多个书目,但出于某种原因,我想稍微改变一下它的外观。

更具体地说,我希望类别标题(如下图所示的书籍和文章)左对齐,并且类别标题上方和下方没有线条。 在此处输入图片描述

以下是 MWE 生成参考书目样本splitbib

\documentclass{article}
\usepackage[round]{natbib}
\usepackage[export]{splitbib}
\bibliographystyle{plainnat}
\begin{category}{Books}
\SBentries{B1,B2}
\end{category}
\begin{category}{Articles}
\SBentries{A1}
\end{category}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}

@BOOK{B1,
  author =       {Author First and Author Second},
  title =        {Title of the first book},
  publisher =    {Demo Publisher ONE},
  year =         {2014}
}
@ARTICLE{A1,
  author =       {Author First Article and Second Author},
  title =        {This is the title of first article},
  journal =      {Name of the Journal},
  year =         {2012},
  volume =       {01},
  number =       {12},
  pages =        {101--114}
}
@BOOK{B2,
  author =       {Second Author Book},
  title =        {This is the title of the second book},
  publisher =    {NHL},
  year =         {2011}
}
\end{filecontents}

\begin{document}

I want to split the reference of this article of \cite{A1} along with the this book \cite{B2} and this book too \cite{B1}.

\bibliography{\jobname}
\end{document} 

答案1

您可以定义自己的风格(但使用 biblatex 会更直接。例如,您可以使用简单的,\subsection但由于硬编码的惩罚,它在这里不起作用。)

\documentclass{article}

\usepackage[round]{natbib}
\usepackage[export]{splitbib}

\makeatletter
\def\NMSB@titlestyle{simple}
\def\NMSB@stylesimple#1#2{\if@nobreak\else\bigskip\fi\textbf{\large #1#2}}
\makeatother
\bibliographystyle{plainnat}
\begin{category}{Books}
\SBentries{B1,B2}
\end{category}
\begin{category}{Articles}
\SBentries{A1}
\end{category}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}

@BOOK{B1,
  author =       {Author First and Author Second},
  title =        {Title of the first book},
  publisher =    {Demo Publisher ONE},
  year =         {2014}
}
@ARTICLE{A1,
  author =       {Author First Article and Second Author},
  title =        {This is the title of first article},
  journal =      {Name of the Journal},
  year =         {2012},
  volume =       {01},
  number =       {12},
  pages =        {101--114}
}
@BOOK{B2,
  author =       {Second Author Book},
  title =        {This is the title of the second book},
  publisher =    {NHL},
  year =         {2011}
}
\end{filecontents}

\begin{document}

I want to split the reference of this article of \cite{A1} along with the this book \cite{B2} and this book too \cite{B1}.

\bibliography{\jobname}
\end{document}

在此处输入图片描述

相关内容