Skip to content

Commit

Permalink
Support starred variants for citation commands (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
dcpurton committed Dec 13, 2018
1 parent 7ea820f commit bf7a100
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 9 deletions.
26 changes: 18 additions & 8 deletions doc/biblatex-sbl.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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}
Expand Down Expand Up @@ -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}
Expand Down
2 changes: 1 addition & 1 deletion latex/biblatex-sbl.def
Original file line number Diff line number Diff line change
Expand Up @@ -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)}
Expand Down
76 changes: 76 additions & 0 deletions latex/sbl.cbx
Original file line number Diff line number Diff line change
Expand Up @@ -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}%
Expand Down Expand Up @@ -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}}
Expand All @@ -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}%
Expand All @@ -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}%
Expand All @@ -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}}
Expand Down

0 comments on commit bf7a100

Please sign in to comment.