我一直在制作德克萨斯州律师 .bbx 和 .cbx,在制作过程中,我创建了一种称为 courtrule 的引用样式。例如,德克萨斯州民事诉讼规则第 4 条的引用方式为 Tex. R. Civ. P. 4。但是,由于有数百条不同的规则,我希望有一个通用的\cite{}
规则编号,以便我可以将其作为后记传递,即,\cite[4]{TRCP}
这将导致:
正文:Tex. R. Civ. P. 4
参考书目:Tex. R. Civ. P. 4
目前,当我写 时\cite[4]{TRCP}
,它会进行正确的文内引用,但不会在参考书目中打印后记。此外,我会引用多个不同的规则,所以我可能会有\cite[500]{TRCP}
。\cite[4]{TRCP}
我希望参考书目为每个不同的后记创建一个新条目。这可能吗?
这是我现在的书目驱动程序代码:
\DeclareBibliographyDriver{courtrule}{%
\usebibmacro{begentry}%
\printfield{title}\addspace\printfield{postnote}\hspace{-0.7ex}
\dotfill\usebibmacro{pageref}%
}
但这只会使书目打印出来
Tex. R. Civ. P.
而没有编号。[编辑:我了解到这是因为该postnote
字段在书目中不可用]
我知道我做错了,但我不知道该如何改正。
答案1
索引引用。
使用开箱即用的 Biblatex、分别用于存储权威和法律报告的title=
和字段以及用于检索该信息的和引用命令,快速进行五分钟的概念验证。author=
\citetitle
\citeauthor
对于 bibentry 的用法X
:
\citetitle{X}, \citeauthor{X}\index[indexname]{\citetitle{X}, \citeauthor{X}}
使用(数字)精确定位:
\citetitle{X}, \citeauthor[45]{X}\index[indexname]{\citetitle{X}, \citeauthor[45]{X}}
索引的棘手部分是正确获取索引排序键,并且在使用不同的命令添加(即相同)项目时不会无意地在索引条目中添加/删除空格。
使用字母数字精确定位时,必须手动添加索引排序键(和引用前缀)。
例如,将其纳入r 45(a)
索引rules
/表格(如果有引用,则纳入文本中的引用):
\citetitle[r 45(a)]{tcpr}\index[rules]{r 045@\citetitle[r 45(a)]{tcpr}}
MWE 还有更多详细信息。
这是一个多步骤的过程(参见Toolchain
MWE)。
记住在启用 shell escape 的情况下运行。
平均能量损失
%Toolchain:
%(pdf/xe/lua)latex with shell escape
%biber
%latex
%splitindex -s plainindexstyle.ist
%latex
%latex
\begin{filecontents*}[overwrite]{\jobname.bib}
@misc{tcpr, %misc: just for demo
title = {TCPR},
pagination = {rule}, %bibstring to apply if postnote is digits
}
@misc{auth1,
title = {A v B},
author = {{4 LR 456}},
}
@misc{auth2c,
title = {The Dog Co. v. The Cat Co.},
author = {{4 LR 458}},
}
@misc{auth3c,
title = {U.S. v. U.S.},
author = {{102 U.S.X.C. 123}},
}
\end{filecontents*}
%style file for index
\begin{filecontents*}{plainindexstyle.ist}
delim_0 "\\space\\dotfill\\space "
delim_1 "\\space\\dotfill\\space "
delim_2 "\\space\\dotfill\\space "
delim_n ", "
delim_r "--"
delim_t ""
encap_prefix "\\"
encap_infix "{"
encap_suffix "}"
\end{filecontents*}
\documentclass{article}
\newcommand\rulesep{\rule{0.4\textwidth}{.4pt}}
%------------------
\title{Creating a Table of Rules}
\author{}
\date{}
\usepackage[splitindex,noautomatic,nonewpage]{imakeidx}
\newcommand\abibname{authortitle}
\newcommand\abibstyle{style=\abibname}
\usepackage[
\abibstyle ,
indexing=cite,
citetracker=true,
ibidtracker=false,
pagetracker=true,
% idemtracker=true,
% opcittracker=true,
% loccittracker=true,
% autocite=footnote,
% datezeros=true,
]{biblatex}
\addbibresource{\jobname.bib}
\NewBibliographyString{atparagraph,rule}
\DefineBibliographyStrings{english}{%
atparagraph = {at para},
rule = {r},
}
%=================
%indexing
\newcommand\pagerefindexnote{\noindent\small\mdseries $\to$ References are to page numbers.}
\makeindex
\makeindex[name=rulesa,title=Table of TCP Rules,columns=3,columnseprule,intoc]
\makeindex[name=cases,title={\normalsize Cases},columns=1]
\makeindex[name=rules,title={\normalsize Rules},columns=1]
\usepackage[
final=true,
bookmarks,
colorlinks=true,
allcolors = black,
citecolor=blue,
hyperindex=false,
]{hyperref}
% variations instead of having \cite...\index... all the time
\newcommand{\icite}[1]{\cite[#1]{tcpr}\index[rulesa]{r~#1}}
\newcommand{\iicite}[2]{\cite[#1]{tcpr}\index[rulesa]{r~#2@r~#1}}
\newcommand{\iiicite}[3]{\cite[#1]{tcpr}\index[rulesa]{r~#3@r~#2{#1}}}
\newcommand{\ivcite}[4]{\cite[#1]{tcpr}\index[rulesa]{r~#3@r~#2{#1}|#4}}
\newcommand{\vcite}[2]{\cite[#1]{tcpr}\index[rulesa]{#2}}
%some wrapper commands for convenience
%%\imki@wrindexentry{names}{Charles}{26} - this is an imakeidx macro
\makeatletter
\newcommand{\addindexitem}[3]{%
\imki@wrindexentry{#1}{#2}{#3}}
\makeatother
\newcommand{\textformat}[1]{\textsf{\textbf{#1}}}
\newcommand\yq{\begin{quotation}}
\newcommand\yqq{\end{quotation}}
\newcommand\yc{\begin{center}}
\newcommand\ycc{\end{center}}
\newcommand\yi{\begin{itemize}}
\newcommand\yii{\end{itemize}}
\newcommand\yis{\item[\space]}
\newcommand\zzz[2]{\cite[#1]{tcpr}\index[rules]{r #2@\citetitle[#1]{tcpr}}}
%1=rule2=sortkey
%------------------
\begin{document}
\maketitle
\newpage
\tableofcontents
\newpage
\index{p} %seems general index is expected/assumed??
%\printindex
\indexprologue{\pagerefindexnote}
%\addindexitem{cases}{ @\textit{Case}|textit}{Page(s)}
%\addindexitem{rules}{ @\textit{Rule}|textit}{Page(s)}
\printindex[rulesa]
\newpage
Index the citations.
Use multiple indices, one for each category of authority.
\yc
\bfseries
TABLE OF AUTHORITIES
\ycc
\hfill\textbf{Page(s)}
\printindex[cases]
\printindex[rules]
\newpage
\section{Text}
\cite[4]{tcpr}\index[rulesa]{4}
xxx
\section{More Text}
xxx
\newpage
\cite[4]{tcpr}\index[rulesa]{4}
\cite[123]{tcpr}\index[rulesa]{123}
\iicite{5}{006}, \iicite{15}{015}, \iicite{52}{052}, \iicite{502}{502}, \iicite{12}{012}.
\cite[4556]{tcpr}\index[rulesa]{4556}
\iicite{53}{053}
\iiicite{14}{\textit}{014}
\iiicite{16}{\textbf}{016}
\iiicite{18}{}{018}{textbf}
\vcite{19}{r~019@r~19|textformat}
\vcite{19(a)}{r~019a@r~19!(a)} versus \vcite{r~19(a)}{r~019a@r~19!(a)}
\vcite{55(b)}{r~055b@r~55(b)|see{52(a)}}
\vcite{55(c)}{r~055c@r~55(c)!see{52(a)}}
\vcite{52(a)}{r~052a@r~52(a)}
\newpage
\vcite{52(a)}{r~052a@r~52(a)}
$\to$ \textbackslash index\{indexentry\}
An \verb.indexentry. is formatted as:
\yq
\yc
a@b|c
\ycc
where
\yi
\yis a = sortkey
\yis b = index display key(s), up to three levels
\yi
\item[·] level1!level2!level3
\yii
\yis c = page number format command name (without the backslash)
\yi
\item[·] can be \verb,see{...},
\yii
\yii
\yc
e.g., 052@52|textbf
\ycc
Sort the item as 052, print 52, and make the page number bold.
\textbf{References}: Do \verb.texdoc makeindex. to bring up both \verb,makeindex.pdf, and \verb,ind.pdf, manuals.
\yqq
\cite[457]{auth1}\index[cases]{\citetitle{auth1}, \citeauthor[457]{auth1}}
\cite[45]{tcpr}\index[rules]{r 045@\citetitle[45]{tcpr}}
\zzz{123}{123}
\zzz{200}{200}
\cite{auth2c}\index[cases]{\citetitle{auth2c}, \citeauthor{auth2c}}
\newpage
\cite{auth2c}\index[cases]{\citetitle{auth2c}, \citeauthor{auth2c}}
\cite{auth2c}\index[cases]{\citetitle{auth2c}, \citeauthor{auth2c}}
\cite{auth3c}\index[cases]{\citetitle{auth3c}, \citeauthor{auth3c}}
\zzz{123}{123}
\zzz{200}{200}
\zzz{201}{201}
\zzz{r 212(a)}{212(a)}
versus
\cite[r 212(a)]{tcpr}\index[rules]{r 212(a)@\citetitle [r 212(a)]{tcpr}}%note the space
\newpage
\cite{auth3c}\index[cases]{\citetitle{auth3c}, \citeauthor{auth3c}}
\zzz{123}{123}
\newpage
\cite{auth3c}\index[cases]{\citetitle{auth3c}, \citeauthor{auth3c}}
\zzz{85}{085}
\zzz{85}{085}
\newpage
\cite{auth2c}\index[cases]{\citetitle{auth2c}, \citeauthor{auth2c}}
\cite{auth3c}\index[cases]{\citetitle{auth3c}, \citeauthor{auth3c}}
\newpage
\cite{auth2c}\index[cases]{\citetitle{auth2c}, \citeauthor{auth2c}}
\zzz{123}{123}
\zzz{85}{085}
\citetitle[r 45(a)]{tcpr}\index[rules]{r 045@\citetitle[r 45(a)]{tcpr}}
\bigskip
\hfill\rulesep\hfill\ %\hrule%{0.8\linewidth}
\bigskip
%===============================================
\end{document}