-
Notifications
You must be signed in to change notification settings - Fork 0
/
hydrobib.sty
executable file
·122 lines (105 loc) · 3.2 KB
/
hydrobib.sty
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
%% hydrobib.sty
%% Bibliography Setup
%% This file is part of the Hydro Thesis package for creating PhD theses
%% Author: Robin Schwemmle ([email protected])
%% File encoding: ASCII
\ProvidesPackage{hydrobib}[2017/11/04]
\RequirePackage{hyphenat}
\RequirePackage{csquotes} % recommended for biblatex
\newcommand{\fieldentry}[1]{
\ifthenelse{\equal{#1}{}}{}{\printfield{#1},}
}
\newcommand{\listentry}[1]{
\ifthenelse{\equal{#1}{}}{}{\printlist{#1},}
}
%Note: biblatex with bibtex backend is frozen at version 1.7.
\RequirePackage[bibstyle=authoryear-comp,citestyle=authoryear-comp,backend=bibtex,url=false,isbn=false,useprefix=true,maxcitenames=2,maxbibnames=100,uniquelist=false,autocite=inline,sortcites=true,dashed=false,uniquename=false,hyperref=true,giveninits=true]{biblatex}
\setlength{\bibitemsep}{1em} % distance between citation entries
\setlength{\bibhang}{2em} % hanging indent after first line
\setcounter{abbrvpenalty}{0} % set hyphenation threshold for citations
\setcounter{highnamepenalty}{0}
\setcounter{lownamepenalty}{0}
\DeclareNameAlias{sortname}{family-given}
\DeclareBibliographyDriver{article}{%
\printnames{author}:%
\newunit\newblock
\printfield{title},%
\newunit\newblock
\printfield{journaltitle},%
\newunit\newblock
\iffieldundef{volume}
{}%
{\printfield{volume},\newunit\newblock}
\iffieldundef{pages}
{}%
{\printfield{pages},\newunit\newblock}
\iffieldundef{doi}
{}%
{\printfield{doi},\newunit\newblock}
\printfield{year}.%
\finentry}
\DeclareBibliographyDriver{book}{%
\printnames{author}:%
\newunit\newblock
\printfield{title},%
\newunit\newblock
\printlist{publisher},%
\newunit\newblock
\printlist{location},%
\newunit\newblock
\printfield{pages} pp.,%
\newunit\newblock
\iffieldundef{doi}
{}%
{\printfield{doi},\newunit\newblock}
\printfield{year}.%
\finentry}
\DeclareBibliographyDriver{report}{%
\printnames{author}:%
\newunit\newblock
\printfield{title},%
\newunit\newblock
\printlist{institution},%
\newunit\newblock
\iffieldundef{location}
{}%
{\printfield{location},\newunit\newblock}
\printfield{year}.%
\finentry}
\DeclareBibliographyDriver{online}{%
\printnames{author}:%
\newunit\newblock
\printfield{title},%
\newunit\newblock
\printfield{url},%
\newunit\newblock
\printurldate.%
\finentry}
\DeclareBibliographyDriver{inproceedings}{%
\printnames{author}:%
\newunit\newblock
\printfield{title},%
\newunit\newblock
presented at \printfield{booktitle},%
\newunit\newblock
\printlist{publisher},%
\newunit\newblock
\printlist{location},%
\newunit\newblock
\printfield{year}.%
\finentry}
\DeclareFieldFormat
[article,thesis,report,unpublished,online,inproceedings]
{title}{#1\isdot}
\DeclareFieldFormat
[book]
{title}{#1}
\DeclareFieldFormat{urldate}{\MakeLowercase{last access}\addcolon\space{#1}}
\DeclareFieldFormat{url}{\MakeLowercase{available at}\addcolon\space\url{#1}}
\DeclareFieldFormat{doi}{%
\ifhyperref
{\href{https://doi.org/#1}{\nolinkurl{#1}}}
{\nolinkurl{#1}}}
\DeclareFieldFormat{pages}{#1}
\DeclareDelimFormat{nameyeardelim}{\addcomma\addspace}
% hyphenations exceptions for citations