使用该authoryear
样式,可以设置多个索引,包括作者索引,如下所示:
\begin{filecontents*}{oscola.bib}
@article{boyle04,
author = {Boyle, James},
title = {A Manifesto on WIPO and the Future of Intellectual Property},
journaltitle = {2004 Duke L \& Tech Review 0009},
url = {http://dltr.law.duke.edu/2004/09/08/a-manifesto-on-wipo-and-the-future-of-intellectual-property},
urldate = {2012-07-18},
options = {url=true},
}
@legislation{eggs,
title = {Eggs and Chicks (England) Regulations},
date = {2009},
number = {SI 2009\slash 2163},
pagination = {regulation},
entrysubtype = {secondary},
}
@jurisdiction{corfu,
title = {Corfu Channel Case},
subtitle = {UK v Albania},
titleaddon = {Merits},
date = {1949},
reporter = {ICJ Rep},
pages = {4},
keywords = {int},
}
\end{filecontents*}
\begin{filecontents*}{oscola.ist}
% Part of the OSCOLA package for biblatex: see the file
% oscola.lbx for copyright and licence information
% v 1.5 01/04/2017
delim 0 "\\space\\dotfill\\space "
delim_1 "\\space\\dotfill\\space "
delim_2 "\\space\\dotfill\\space "
\end{filecontents*}
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage[margin=2cm]{geometry}
\usepackage[splitindex,nonewpage]{imakeidx}
\usepackage{csquotes,xcolor,graphicx}
\usepackage{hyperref}
\setlength\parindent{0pt}
\pagestyle{empty}
\hypersetup{
pdfauthor={The author},
pdftitle={The title},
colorlinks=true,
pdfborder={0 0 0},
linkcolor={red!50!black},
citecolor={blue!50!black},
urlcolor={blue!80!black},
citecolor={green!50!black},
urlcolor={purple!80!black}
}
\usepackage[%
style=authoryear,
indexing=cite,
backend=biber,
sorting=nyt,
maxcitenames=1,
mincitenames=1,
maxbibnames=999,
minbibnames=999,
refsection=section,
doi=true,
url=true
]{biblatex}
\indexsetup{level=\section*,toclevel=section,noclearpage}
\makeindex[name=general,intoc=true,columns=2,options=-s oscola.ist,title={General Index}]
\makeindex[name=name,intoc=true,columns=2,options=-s oscola.ist,title={Index of Authors}]
\makeindex[name=title,intoc=true,columns=1,options=-s oscola.ist,title={Index of Titles}]
\makeindex[name=ukcases,intoc=true,columns=1,options=-s oscola.ist,title={Table of UK Cases}]
\makeindex[name=ukleg, intoc=true,columns=1,options=-s oscola.ist,title={Table of UK Legislation}]
\DeclareIndexNameFormat{default}{%
\usebibmacro{index:name}{\index[name]}
{\namepartfamily}
{\namepartgiven}
{\namepartprefix}
{\namepartsuffix}
}
\DeclareIndexFieldFormat{indextitle}{%
\usebibmacro{index:title}{\index[title]}{#1}}
\renewbibmacro*{citeindex}{%
\ifciteindex
{\indexnames{labelname}%
\indexfield{indextitle}}
{}}
\renewbibmacro*{bibindex}{%
\ifbibindex
{\indexnames{author}%
\indexnames{editor}%
\indexnames{editora}%
\indexnames{editorb}%
\indexnames{editorc}%
\indexfield{indextitle}}
{}}
\addbibresource{oscola.bib}
\begin{document}
\section{My text}
Add an entry to the general index. \index[general]{IndexEntry}\par
Add a citation to an article \cite{boyle04}. The author's name to appear in the Index of Authors.\par
Add a citation to a piece of legislation \cite{eggs}\index[ukleg]{Legislation!Eggs}, which is to appear in the Table of UK legislation.\par
Manually add a case \cite{corfu}\index[ukcases]{Case!Corfu}, which is to appear in the Table of UK cases.\par
Run pdflatex, biber, pdflatex, splitindex, pdflatex
\printbibliography[nottype=jurisdiction,nottype=legislation,nottype=legal,notsubtype=parliamentary,nottype=commentary]
\printindex[general] % Print the general index
\printindex[name] % Print the Index of Authors
\printindex[title] % Print the Index of Titles
\printindex[ukleg] % Print the Index of UK Legislation
\printindex[ukcases] % Print the Index of UK cases
\end{document}
根据要求生成如下结果:
OSCOLA
是牛津大学法律权威引用标准。它是为Biblatex
使用该OSCOLA
包而实现的。
将第 61 行的样式更改authoryear
为该oscola
样式,导致错误地生成作者索引,如下所示:
OSCOLA 标准要求使用脚注引用,并\footcite
为此定义了命令。我的理解是,错误的作者索引将是由于\usebibmacro{index:name}{\index[name]}
对oscola
样式的定义不正确造成的。
如能就如何为该风格创建作者索引提出建议,我们oscola
将不胜感激。
第二个问题涉及索引的格式。我希望makeindex
使用oscola.ist
来生成一个索引,其页码右对齐,并与索引项以 分隔\dotfill
。但是,没有点填充,页码为raggedright
。
该文件使用以下项编译:
pdflatex
,,,,,。biber
pdflatex
splitindex
pdflatex
答案1
oscola
确实重新定义了index:name
很多。
您可以使用以下方式恢复默认设置
\renewbibmacro*{index:name}[5]{%
\usebibmacro{index:entry}{#1}{\mkbibindexname{#2}{#3}{#4}{#5}}}