summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/biblatex-ms/latex/cbx/authortitle-ms.cbx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/biblatex-ms/latex/cbx/authortitle-ms.cbx')
-rw-r--r--macros/latex/contrib/biblatex-ms/latex/cbx/authortitle-ms.cbx115
1 files changed, 115 insertions, 0 deletions
diff --git a/macros/latex/contrib/biblatex-ms/latex/cbx/authortitle-ms.cbx b/macros/latex/contrib/biblatex-ms/latex/cbx/authortitle-ms.cbx
new file mode 100644
index 0000000000..9eec2b6036
--- /dev/null
+++ b/macros/latex/contrib/biblatex-ms/latex/cbx/authortitle-ms.cbx
@@ -0,0 +1,115 @@
+\ProvidesFile{authortitle-ms.cbx}
+[\abx@cbxid]
+
+\ExecuteBibliographyOptions{uniquename,uniquelist,autocite=footnote}
+
+\renewcommand*{\iffinalcitedelim}{\iflastcitekey}
+
+\newbool{cbx:parens}
+
+\newbibmacro*{cite}{%
+ \iffieldundef{shorthand}
+ {\printnames{labelname}%
+ \setunit*{\printdelim{nametitledelim}}%
+ \usebibmacro{cite:title}}%
+ {\usebibmacro{cite:shorthand}}}
+
+\newbibmacro*{citetitle}{%
+ \iffieldundef{shorthand}
+ {\usebibmacro{cite:title}}%
+ {\usebibmacro{cite:shorthand}}}
+
+\newbibmacro*{textcite}{%
+ \printnames{labelname}%
+ \setunit*{%
+ \global\booltrue{cbx:parens}%
+ \printdelim{nametitledelim}\bibopenparen}%
+ \ifnumequal{\value{citecount}}{1}
+ {\usebibmacro{prenote}}
+ {}%
+ \iffieldundef{shorthand}
+ {\usebibmacro{cite:title}}%
+ {\usebibmacro{cite:shorthand}}}
+
+\newbibmacro*{cite:title}{%
+ \printtext[bibhyperref]{%
+ \printfield[citetitle]{labeltitle}}}
+
+\newbibmacro*{cite:shorthand}{%
+ \printtext[bibhyperref]{\printfield{shorthand}}}
+
+\newbibmacro*{textcite:postnote}{%
+ \iffieldundef{postnote}
+ {\ifbool{cbx:parens}
+ {\bibcloseparen}
+ {}}
+ {\ifbool{cbx:parens}
+ {\printdelim{postnotedelim}}
+ {\printdelim{extpostnotedelim}\bibopenparen}%
+ \printfield{postnote}\bibcloseparen}}
+
+\DeclareCiteCommand{\cite}
+ {\usebibmacro{prenote}}
+ {\usebibmacro{citeindex}%
+ \usebibmacro{cite}}
+ {\multicitedelim}
+ {\usebibmacro{postnote}}
+
+\DeclareCiteCommand*{\cite}
+ {\usebibmacro{prenote}}
+ {\usebibmacro{citeindex}%
+ \usebibmacro{citetitle}}
+ {\multicitedelim}
+ {\usebibmacro{postnote}}
+
+\DeclareCiteCommand{\parencite}[\mkbibparens]
+ {\usebibmacro{prenote}}
+ {\usebibmacro{citeindex}%
+ \usebibmacro{cite}}
+ {\multicitedelim}
+ {\usebibmacro{postnote}}
+
+\DeclareCiteCommand*{\parencite}[\mkbibparens]
+ {\usebibmacro{prenote}}
+ {\usebibmacro{citeindex}%
+ \usebibmacro{citetitle}}
+ {\multicitedelim}
+ {\usebibmacro{postnote}}
+
+\DeclareCiteCommand{\footcite}[\mkbibfootnote]
+ {\usebibmacro{prenote}}
+ {\usebibmacro{citeindex}%
+ \usebibmacro{cite}}
+ {\multicitedelim}
+ {\usebibmacro{postnote}}
+
+\DeclareCiteCommand{\footcitetext}[\mkbibfootnotetext]
+ {\usebibmacro{prenote}}
+ {\usebibmacro{citeindex}%
+ \usebibmacro{cite}}
+ {\multicitedelim}
+ {\usebibmacro{postnote}}
+
+\DeclareCiteCommand{\smartcite}[\iffootnote\mkbibparens\mkbibfootnote]
+ {\usebibmacro{prenote}}
+ {\usebibmacro{citeindex}%
+ \usebibmacro{cite}}
+ {\multicitedelim}
+ {\usebibmacro{postnote}}
+
+\DeclareCiteCommand{\textcite}
+ {\boolfalse{cbx:parens}}
+ {\usebibmacro{citeindex}%
+ \iffirstcitekey
+ {\setcounter{textcitetotal}{1}}
+ {\stepcounter{textcitetotal}%
+ \textcitedelim}%
+ \usebibmacro{textcite}}
+ {\ifbool{cbx:parens}
+ {\bibcloseparen\global\boolfalse{cbx:parens}}
+ {}}
+ {\usebibmacro{textcite:postnote}}
+
+\DeclareMultiCiteCommand{\textcites}{\textcite}{}
+
+\endinput