BibLaTeX:定制阅读书目样式

BibLaTeX:定制阅读书目样式

我正在编写一份包含“进一步阅读”列表和带注释的参考书目的文档。BibLaTeXreading的参考书目样式非常适合此目的。但是我想自定义样式外观的一些内容,并且我发现 BibLaTeX 手册对于我相当有限的 LaTeX 技能来说有点高级。有人能为我指明实现这些更改的正确方向吗?

我想要纳入的改变是:

  1. 在参考书目条目之间添加垂直空格,但不在条目文本和条目标题规则之间添加空格。
  2. 从条目标题横幅中删除作者姓名,以便横幅左侧的文本仅显示条目的标题。
  3. 更改横幅的右侧以显示参考书目条目中的字段,而不是参考书目关键字。特别是,我想向reading每个条目添加样式未使用的字段,以便我可以使用它来指示条目主题等。在下面的 MWE 中,我使用该verb字段添加了一些文本。
  4. 将“注释”一词更改为“说明”

我在下面提供了一个 MWE 示例,以及一张我想要实现的图像(我使用图像处理软件来创建目标风格的图像)。


原始reading风格:

在此处输入图片描述


目标书目样式:

在此处输入图片描述


用于创建原始输出的源:

\documentclass{article}

\usepackage{filecontents}

\begin{filecontents}{refs.bib}
  @book{kernighan1988c,
    title      = {The C Programming Language},
    author     = {Kernighan, Brian W and Ritchie, Dennis M},
    year       = {1988},
    annotation = {Instructional book for the C programming language.},
    verb       = {C/C++ programming}
  }
  @book{stroustrup2013c++,
    title      = {The C++ Programming Language},
    author     = {Stroustrup, Bjarne},
    year       = {2013},
    publisher  = {Pearson Education},
    annotation = {Instructional book for the C++ programming language.},
    verb       = {C/C++ programming}
  }
  @book{knuth1984texbook,
    title      = {The TeXbook},
    author     = {Knuth, Donald Ervin and Bibby, Duane},
    year       = {1984},
    publisher  = {Addison-Wesley Reading},
    annotation = {Instructional book for the TeX typesetting system.},
    verb       = {TeX typesetting}
  }
\end{filecontents}


\usepackage[style = reading, backend = biber]{biblatex}
\addbibresource{refs.bib}


\begin{document}

\nocite{*}
\printbibliography

\end{document}

答案1

定制biblatex并不难。我发现阅读样式文件本身有助于理解正在发生的事情。

此 MWE 将执行您想要的操作。请参阅注释以获取解释。

\documentclass{article}

% use verba instead of non-existent verb field
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@book{kernighan1988c,
  title      = {The C Programming Language},
  author     = {Kernighan, Brian W and Ritchie, Dennis M},
  year       = {1988},
  annotation = {Instructional book for the C programming language.},
  verba      = {C/C++ programming}
}
@book{stroustrup2013c++,
  title      = {The C++ Programming Language},
  author     = {Stroustrup, Bjarne},
  year       = {2013},
  publisher  = {Pearson Education},
  annotation = {Instructional book for the C++ programming language.},
  verba      = {C/C++ programming}
}
@book{knuth1984texbook,
  title      = {The TeXbook},
  author     = {Knuth, Donald Ervin and Bibby, Duane},
  year       = {1984},
  publisher  = {Addison-Wesley Reading},
  annotation = {Instructional book for the TeX typesetting system.},
  verba      = {TeX typesetting}
}
\end{filecontents}

% set entrykey to false so entry key isn't printed in banner
\usepackage[style=reading,entrykey=false]{biblatex}
\addbibresource{\jobname.bib}

% 1. Increase space between entries from 2\bibitemsep to 4\bibitemsep
\makeatletter
\patchcmd{\bbx@item@full}
  {\itemsep2\bibitemsep}
  {\itemsep4\bibitemsep}
  {}
  {}
\makeatother

% redefine entryhead:full so that
% 2. Author name is removed from banner and left hand text displays only title
% 3. Right hand side of banner prints verba (verb isn't a field)
\renewbibmacro*{entryhead:full}{%
  \printfield{labeltitle}%
  \hfill
  \printfield{verba}}

% 4. Change word Annotations to Description
\DeclareFieldFormat{annotation}{Description\addcolon\space #1}

\begin{document}
\nocite{*}
\printbibliography
\end{document}

在此处输入图片描述

相关内容