From bf7a100add4f3e5517a53d68efcfc25b787813a6 Mon Sep 17 00:00:00 2001 From: David Purton Date: Thu, 13 Dec 2018 23:24:37 +1030 Subject: [PATCH] Support starred variants for citation commands (#74) --- doc/biblatex-sbl.tex | 26 ++++++++++----- latex/biblatex-sbl.def | 2 +- latex/sbl.cbx | 76 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 95 insertions(+), 9 deletions(-) diff --git a/doc/biblatex-sbl.tex b/doc/biblatex-sbl.tex index 910e4bf..02ea67f 100644 --- a/doc/biblatex-sbl.tex +++ b/doc/biblatex-sbl.tex @@ -233,12 +233,15 @@ \subsection{Commands} \begin{ltxsyntax} \cmditem{autocite}[prenote]<(altpostnote)postnote>{key} +\cmditem{autocite*}[prenote]<(altpostnote)postnote>{key} \cmd{autocite} inserts a citation as a footnote. If used in a footnote, the -citation is placed in parentheses. It works as in the standard \biblatex -styles, except that that \bibfield{postnote} argument can be divided into two -using parentheses. This creates an \bibfield{altpostnote} field which is used -in some of the examples from §6.4 of the \cite{SBLHS}. e.g., +citation is placed in parentheses. The starred variant suppresses the author, +editor, or translator (provided the entry options are set to use them). It +works as in the standard \biblatex styles, except that that +\bibfield{postnote} argument can be divided into two using parentheses. This +creates an \bibfield{altpostnote} field which is used in some of the examples +from §6.4 of the \cite{SBLHS}. e.g., \begin{snugshade} \samplecite{1}[See][(1.3)8:223]{clementinehomilies} @@ -252,15 +255,21 @@ \subsection{Commands} \end{snugshade} \cmditem{cite}[prenote]<(altpostnote)postnote>{key} +\cmditem{cite*}[prenote]<(altpostnote)postnote>{key} \cmd{cite} works in the same way as \cmd{autocite} except that the citation is -placed directly into the text instead of in a footnote. +placed directly into the text instead of in a footnote. The starred variant +suppresses the author, editor, or translator (provided the entry options are +set to use them). \cmditem{parencite}[prenote]<(altpostnote)postnote>{key} +\cmditem{parencite*}[prenote]<(altpostnote)postnote>{key} \cmd{parencite} works in the same way as \cmd{autocite} except that the -citation is placed inside parentheses instead of in a footnote. This is most -useful for citing primary sources. e.g., +citation is placed inside parentheses instead of in a footnote. The starred +variant suppresses the author, editor, or translator (provided the entry +options are set to use them). This is most useful for citing primary sources. +e.g., \begin{snugshade} \sampleparencite[2.233-235]{josephus:ant} @@ -1242,10 +1251,11 @@ \subsection{Reprints} \section{Important Changes} -\subsection*{0.11\quad 2018-06-08} +\subsection*{0.11\quad 2018-12-13} \begin{itemize} \item Add abbreviations from related entries to the list of abbreviations. + \item Add starred variants for citation commands. \end{itemize} \subsection*{0.10\quad 2018-05-24} diff --git a/latex/biblatex-sbl.def b/latex/biblatex-sbl.def index 736d4bc..aa7301d 100644 --- a/latex/biblatex-sbl.def +++ b/latex/biblatex-sbl.def @@ -15,7 +15,7 @@ % VERSION STRINGS % ------------------------------------------------------------------ -\def\sbl@abx@date{2018/06/08} +\def\sbl@abx@date{2018/12/13} \def\sbl@abx@version{0.11} \def\sbl@abx@bbxid{\sbl@abx@date\space v\sbl@abx@version\space biblatex-sbl bibliography style (DCP)} \def\sbl@abx@cbxid{\sbl@abx@date\space v\sbl@abx@version\space biblatex-sbl citation style (DCP)} diff --git a/latex/sbl.cbx b/latex/sbl.cbx index 9d15a05..bb745ef 100644 --- a/latex/sbl.cbx +++ b/latex/sbl.cbx @@ -86,6 +86,29 @@ {\newunit \printfield{pages}}}} +\newbibmacro*{cite:suppresslabelname}{% + \renewbibmacro*{author}{}% + \renewbibmacro*{author+holder}{}% + \renewbibmacro*{editor}{% + \ifboolexpr{ + test \ifuseeditor + and + not test {\ifnameundef{editor}} + } + {\clearname{editor}} + {}}% + \renewbibmacro*{editor+others}{\usebibmacro{editor}}% + \renewbibmacro*{translator}{% + \ifboolexpr{ + test \ifusetranslator + and + not test {\ifnameundef{translator}} + } + {\clearname{translator}} + {}}% + \renewbibmacro*{translator+others}{\usebibmacro{translator}}% +} + \newbibmacro*{bibentrycite}{% \citereset \global\togglefalse{relatedseen}% @@ -166,12 +189,26 @@ {\multicitedelim} {\usebibmacro{cite:postnote}} +\DeclareCiteCommand*{\smartcite}[\iffootnote\mkbibparens\mkbibfootnote] + {\usebibmacro{prenote}} + {\usebibmacro{cite:suppresslabelname}% + \usebibmacro{cite}} + {\multicitedelim} + {\usebibmacro{cite:postnote}} + \DeclareCiteCommand{\cite} {\usebibmacro{prenote}} {\usebibmacro{cite}} {\multicitedelim} {\usebibmacro{cite:postnote}} +\DeclareCiteCommand*{\cite} + {\usebibmacro{prenote}} + {\usebibmacro{cite:suppresslabelname}% + \usebibmacro{cite}} + {\multicitedelim} + {\usebibmacro{cite:postnote}} + \DeclareCiteCommand{\bibentrycite} {} {\usebibmacro{bibentrycite}} @@ -190,18 +227,39 @@ {\multicitedelim} {\usebibmacro{cite:postnote}} +\DeclareCiteCommand*{\parencite}[\mkbibparens] + {\usebibmacro{prenote}} + {\usebibmacro{cite:suppresslabelname}% + \usebibmacro{cite}} + {\multicitedelim} + {\usebibmacro{cite:postnote}} + \DeclareCiteCommand{\footcite}[\mkbibfootnote] {\usebibmacro{prenote}} {\usebibmacro{cite}} {\multicitedelim} {\usebibmacro{cite:postnote}} +\DeclareCiteCommand*{\footcite}[\mkbibfootnote] + {\usebibmacro{prenote}} + {\usebibmacro{cite:suppresslabelname}% + \usebibmacro{cite}} + {\multicitedelim} + {\usebibmacro{cite:postnote}} + \DeclareCiteCommand{\footcitetext}[\mkbibfootnotetext] {\usebibmacro{prenote}} {\usebibmacro{cite}} {\multicitedelim} {\usebibmacro{cite:postnote}} +\DeclareCiteCommand*{\footcitetext}[\mkbibfootnotetext] + {\usebibmacro{prenote}} + {\usebibmacro{cite:suppresslabelname}% + \usebibmacro{cite}} + {\multicitedelim} + {\usebibmacro{cite:postnote}} + \DeclareCiteCommand{\fullcite} {\usebibmacro{prenote}} {\def\blx@shorthand{false}% @@ -210,6 +268,15 @@ {\multicitedelim} {\usebibmacro{cite:postnote}} +\DeclareCiteCommand*{\fullcite} + {\usebibmacro{prenote}} + {\def\blx@shorthand{false}% + \let\ifciteseen\@secondoftwo + \usebibmacro{cite:suppresslabelname}% + \usebibmacro{cite}} + {\multicitedelim} + {\usebibmacro{cite:postnote}} + \DeclareCiteCommand{\footfullcite}[\mkbibfootnote] {\usebibmacro{prenote}} {\def\blx@shorthand{false}% @@ -218,6 +285,15 @@ {\multicitedelim} {\usebibmacro{cite:postnote}} +\DeclareCiteCommand*{\footfullcite}[\mkbibfootnote] + {\usebibmacro{prenote}} + {\def\blx@shorthand{false}% + \let\ifciteseen\@secondoftwo + \usebibmacro{cite:suppresslabelname}% + \usebibmacro{cite}} + {\multicitedelim} + {\usebibmacro{cite:postnote}} + \DeclareCiteCommand{\citeseries} {} {\usebibmacro{shortseries}}