summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/biblatex-ms/latex/cbx/draft-ms.cbx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/biblatex-ms/latex/cbx/draft-ms.cbx')
-rw-r--r--macros/latex/contrib/biblatex-ms/latex/cbx/draft-ms.cbx73
1 files changed, 73 insertions, 0 deletions
diff --git a/macros/latex/contrib/biblatex-ms/latex/cbx/draft-ms.cbx b/macros/latex/contrib/biblatex-ms/latex/cbx/draft-ms.cbx
new file mode 100644
index 0000000000..38b48985e9
--- /dev/null
+++ b/macros/latex/contrib/biblatex-ms/latex/cbx/draft-ms.cbx
@@ -0,0 +1,73 @@
+\ProvidesFile{draft-ms.cbx}
+[\abx@cbxid]
+
+\ExecuteBibliographyOptions{autocite=plain}
+
+\DeclareFieldFormat{citekey}{\cbx@mkcitekey{#1}}
+\DeclareUrlCommand{\cbx@mkcitekey}{\urlstyle{citekey}}
+\def\url@citekeystyle{\def\UrlFont{\bfseries}}
+\newbool{cbx:parens}
+
+\newbibmacro*{cite}{%
+ \printtext[bibhyperref]{\printfield[citekey]{entrykey}}}
+
+\newbibmacro*{textcite}{%
+ \printnames{labelname}%
+ \setunit*{%
+ \global\booltrue{cbx:parens}%
+ \addspace\bibopenparen}%
+ \ifnumequal{\value{citecount}}{1}
+ {\usebibmacro{prenote}}
+ {}%
+ \usebibmacro{cite}}
+
+\newbibmacro*{textcite:postnote}{%
+ \iffieldundef{postnote}
+ {\ifbool{cbx:parens}
+ {\bibcloseparen}
+ {}}
+ {\ifbool{cbx:parens}
+ {\setunit{\printdelim{postnotedelim}}}
+ {\setunit{\addspace\bibopenparen}}%
+ \printfield{postnote}\bibcloseparen}}
+
+\DeclareCiteCommand{\cite}
+ {\usebibmacro{prenote}}
+ {\usebibmacro{cite}}
+ {\multicitedelim}
+ {\usebibmacro{postnote}}
+
+\DeclareCiteCommand{\parencite}[\mkbibparens]
+ {\usebibmacro{prenote}}
+ {\usebibmacro{cite}}
+ {\multicitedelim}
+ {\usebibmacro{postnote}}
+
+\DeclareCiteCommand{\footcite}[\mkbibfootnote]
+ {\usebibmacro{prenote}}
+ {\usebibmacro{cite}}
+ {\multicitedelim}
+ {\usebibmacro{postnote}}
+
+\DeclareCiteCommand{\footcitetext}[\mkbibfootnotetext]
+ {\usebibmacro{prenote}}
+ {\usebibmacro{cite}}
+ {\multicitedelim}
+ {\usebibmacro{postnote}}
+
+\DeclareCiteCommand{\smartcite}[\iffootnote\mkbibparens\mkbibfootnote]
+ {\usebibmacro{prenote}}
+ {\usebibmacro{cite}}
+ {\multicitedelim}
+ {\usebibmacro{postnote}}
+
+\DeclareCiteCommand{\textcite}
+ {\boolfalse{cbx:parens}}
+ {\usebibmacro{textcite}}
+ {\ifbool{cbx:parens}
+ {\bibcloseparen\global\boolfalse{cbx:parens}}
+ {}%
+ \multicitedelim}
+ {\usebibmacro{textcite:postnote}}
+
+\endinput