summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/biblatex-contrib/biblatex-ajc2020unofficial/ajc2020unofficial.bbx
blob: 7b52892aae5c450a24597b1b5d29d009aa6f0d4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
\ProvidesFile{ajc2020unofficial.bbx}[2020/03/03 v0.0.1 unofficial biblatex bibliography style for Australasian Journal of Combinatorics]

\RequireBibliographyStyle{numeric}
\RequireCitationStyle{numeric}

\ExecuteBibliographyOptions{labelnumber,firstinits=true,sorting=nyt}


\RequireBibliographyStyle{standard}
\newbibmacro*{bbx:savehash}{%
  \savefield{fullhash}{\bbx@lasthash}}
\DeclareBibliographyOption[boolean]{dashed}[false]{%
	\ifstrequal{#1}{true}{
		\ExecuteBibliographyOptions{pagetracker}%
		\renewbibmacro*{bbx:savehash}{\savefield{fullhash}{\bbx@lasthash}}
	}{
		\renewbibmacro*{bbx:savehash}{}
	}
}
\DeclareBibliographyOption[boolean]{sentencetitle}[false]{%
  \ifstrequal{#1}{true}{%
    \DeclareFieldFormat{titlecase}{\MakeSentenceCase*{##1}}%
  }{
    \DeclareFieldFormat{titlecase}{{##1}}%
  }%
}
\ExecuteBibliographyOptions{sentencetitle,dashed}

\renewcommand*{\bibfont}{\footnotesize}
\renewcommand*{\subtitlepunct}{\textup{\addcolon}\space}
\renewcommand*{\newunitpunct}{\addcomma\space}
\renewcommand*{\mkbibquote}[1]{\mkbibemph{#1}}
\renewcommand*{\labelnamepunct}{\addcomma\space}
\renewbibmacro*{in:}{}
\renewbibmacro*{author}{%
  \ifboolexpr{
    test \ifuseauthor
    and
    not test {\ifnameundef{author}}
  }
  {\usebibmacro{bbx:dashcheck}
    {\bibnamedash}
    {\printnames{author}%
      \setunit{\addcomma\space}%
      \usebibmacro{bbx:savehash}}%
    \usebibmacro{authorstrg}}
  {\global\undef\bbx@lasthash}}

\DeclareFieldFormat{journaltitle}{\textup{#1}}
\DeclareFieldFormat{booktitle}{\textup{#1}}
\DeclareFieldFormat[article]{number}{\mkbibbold{#1}}
\DeclareFieldFormat[book]{number}{\mkbibbold{#1}}
\DeclareFieldFormat
  [article,inbook,incollection,inproceedings,patent,thesis,unpublished]
  {title}{\mkbibemph{#1\isdot}}

\newbibmacro*{bbx:dashcheck}[2]{%
  \ifboolexpr{
    test {\iffieldequals{fullhash}{\bbx@lasthash}}
    and
    not test \iffirstonpage
  }
  {#1}
  {#2}}
\renewcommand*{\bibnamedash}{\rule{3em}{0.4pt}\hspace*{.16667em}\addcomma\addspace}


\DeclareFieldFormat{pages}{#1}
\DeclareFieldFormat{journaltitle}{\mkbibemph{#1}\isdot}
\DeclareFieldFormat*{title}{#1}


\endinput