summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/biblatex-contrib/biblatex-socialscienceshuberlin/socialscienceshuberlin.tex
blob: 9646e37f49dea702133854e0978c0e168979484b (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
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
% biblatex-socialsciences|huberlin --%
% Copyright (c) 2018 and
% maintained by Lukas C. Bossert
%  
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
%   http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2005/12/01 or later.

%%%%% Disclaimer %%%%%%%%%%%%%%%%%%%%%
% The code of this documentation     %
% has been taken form 'biblatex-ext' %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
\documentclass[DIV=11]{scrartcl}
\usepackage{ifxetex,ifluatex}
\newif\iffontspec
\ifxetex
  \fontspectrue
\else\ifluatex
  \fontspectrue
\else 
  \fontspecfalse
\fi\fi
\iffontspec
  \usepackage{fontspec}
\else
  \usepackage[T1]{fontenc}
  \usepackage[utf8]{inputenc} 
\fi
\usepackage[british]{babel}
\usepackage{csquotes}


\usepackage[useregional]{datetime2}
\iffontspec  
\setmainfont[ 
%  Scale       = 0.95,
%  Numbers  = {OldStyle},
  Numbers={Proportional},
%	BoldItalicFont = Gentium Book Basic Bold Italic,
 	Ligatures   = TeX,
  BoldFont={Gentium Basic Bold},
%	BoldFont    = GenBasB,
%  BoldFont={Gentium Basic Bold},
]{Gentium Plus}
\setsansfont[
  Ligatures     = TeX,
  BoldFont      = Dosis-SemiBold,
  ItalicFont    = Dosis-Regular,
  ItalicFeatures={FakeSlant=0.25}
]{Dosis-Light}
\else
\usepackage{lmodern} 
\usepackage[mono=false]{libertine}
\usepackage[libertine]{newtxmath}
  \usepackage[scaled=0.78]{beramono}
\fi
\usepackage{microtype}
\usepackage{hyphenat}
\usepackage{bm}
\usepackage{booktabs}
\usepackage{multicol}
\usepackage{upquote}
\usepackage[svgnames]{xcolor}
\usepackage[listings, breakable, skins]{tcolorbox}%
\usetikzlibrary{arrows.meta}
\usepackage[style=socialscienceshuberlin, backend=biber]{biblatex}
\addbibresource{socialscienceshuberlin-examples.bib}

\usepackage[ 
  headsepline, 
  footsepline,
  automark, 
  draft=false,
]{scrlayer-scrpage} 
\pagestyle{scrheadings}
\clearscrheadfoot
\rohead{\texttt{bib}\LaTeX-style \texttt{socialsciences|huberlin \socialscienceshuberlinversion}}%
\lohead{\copyright\ by Lukas C. Bossert}
\rofoot{\normalfont\footnotesize  \textbf{\sffamily \thepage}}
\lofoot{\normalfont\footnotesize  \href{http://digitales-altertum.de}{digitales-altertum|de}}
\setkomafont{pageheadfoot}{\normalfont\footnotesize}
\setkomafont{footnotereference}{\normalfont\addfontfeature{Numbers=Lining}\selectfont}
\addtokomafont{footnotenumber}{\footnotesize\normalfont}
\deffootnote%
  %[\normalparindent]%<width of mark>
  {0.075cm}%<indent of footnote text>
  {\normalparindent}%<paragraph indent in the footnote text>
  {\makebox[\normalparindent][r]%
  {\thefootnotemark\hspace*{4pt}}}%<definition of mark>
\newlength{\normalparindent}
\AtBeginDocument{\setlength{\normalparindent}{\parindent}}
 \setfootnoterule{0pt}% Kein Fußnotenstrich
 %\setfootnoterule[<height>]{<length>}

\makeatletter
\iffontspec
\def\textvisiblespace{%
  \raisebox{-2.2pt}{%
    \mbox{\kern.04em\vrule \@height.5ex \@width.12ex}%
    \vbox{\hrule \@width.2em \@height.12ex}%
    \hbox{\vrule \@height.5ex \@width.12ex}%
    \kern.04em}}
\fi
\makeatother


\usepackage{ltxdockit}
\usepackage{btxdockit}
\usepackage{cleveref}
\hypersetup{%
  colorlinks=true,
  allcolors=spot,
  bookmarksopen=true,
  bookmarksnumbered=false,
  plainpages=false}

\definecolor{highlight1}{RGB}{240, 0, 0}
\definecolor{highlight2}{RGB}{0,153, 153}
\definecolor{spot}{rgb}{0,0.2,0.6}

\lstdefinestyle{extblxstylegeneral}{%
  aboveskip    = {0\p@ \@plus 6\p@},
  belowskip    = {0\p@ \@plus 6\p@},
  tabsize      = 2,
  breaklines   = true,
  breakatwhitespace = true,
  keepspaces   = true,
  escapeinside = {(*@}{@*)},
  moredelim    = {[is][\ttfamily\bfseries\color{highlight1}]{|}{|}},
  moredelim    = {[is][\ttfamily\bfseries\color{highlight1}]{|1}{1|}},
  moredelim    = {[is][\ttfamily\bfseries\color{highlight2}]{|2}{2|}},
}

\lstdefinelanguage{extBibTeX}{%
  morekeywords=[1]{%
    @article,@artwork,@audio,@bibnote,@book,@bookinbook,@booklet,%
    @collection,@commentary,@customa,@customb,@customc,@customd,%
    @custome,@customf,@inbook,@incollection,@inproceedings,%
    @inreference,@image,@jurisdiction,@legal,@legislation,@letter,%
    @manual,@misc,@movie,@music,@mvcollection,@mvreference,%
    @mvproceedings,@mvbook,@online,@patent,@performance,@periodical,%
    @proceedings,@reference,@report,@review,@set,@software,@standard,%
    @suppbook,@suppcollection,@suppperiodical,@thesis,@unpublished,@video%
   },
   morekeywords=[2]{author,title,date,owner,timestamp,journaltitle,%
   location,publisher,booktitle,subtitle,booksubtitle,pages,series,%
   shortseries,serieseditor,number,volume,year,date,pubstatus,editor,%
   shorthand,shortauthor,keywords,options,groups,shorteditor,translator,%
   origlanguage,origtitle,edition,origdate,doi},
   keywordstyle=[1]{\bfseries\spotcolor},
   keywordstyle=[2]{\spotcolor},
   sensitive=true,
}

\lstdefinestyle{extblxstylelatex}{%
  language  = {[LaTeX]TeX},
  style     = {extblxstylegeneral},
}

\lstdefinestyle{extblxstylebibtex}{%
  language  = {extBibTeX},
  style     = {extblxstylegeneral},
}


\newcommand*{\highlight}[2][1]{\textcolor{highlight#1}{#2}}
\newcommand*{\highlightbf}[2][1]{\textcolor{highlight#1}{\textbf{#2}}}
\DeclareFieldFormat{highlight1}{\textcolor{highlight1}{#1}}
\DeclareFieldFormat{highlight2}{\textcolor{highlight2}{#1}}

\newtcolorbox{bibexample}[1][]{enhanced,
                               colframe=spot!75!black, colback=spot!5!white,
                               breakable,
                               #1}
\newtcblisting{biblatexcode}{enhanced,
                             colframe=black!75!white, colback=black!5!white,
                             listing only,
                             frame hidden,
                             breakable,
                             listing style=extblxstylelatex}
\newtcblisting{bibtexfile}{enhanced,
                           colframe=black!75!white, colback=black!5!white,
                           listing only,
                           frame hidden,
                           breakable,
                           listing style = extblxstylebibtex}
\newcommand\edtobibexample[2][]{
\begin{bibexample}[#1]
  \begin{refsection}
  #2\par
  \hrulefill
  \printbibliography[heading=none]
  \end{refsection}
\end{bibexample}
}


\newtcbinputlisting\inputexamplebibfile[2][]{%
  listing file={#2},
  enhanced,
  colframe=black!75!white, 
  colback=black!5!white,
  listing only,
  frame hidden,
  breakable,
  %listing style = extblxstylebibtex,
  #1}




\makeatletter
\AtUsedriver*{%
  \let\newblock\relax
  \let\abx@macro@bibindex\@empty
  \let\abx@macro@pageref\@empty}


% this is taken from ltxdockit.cls, which is not loaded
\newrobustcmd*{\fnurl}[1][]{\hyper@normalise\ltd@fnurl{#1}}
\def\ltd@fnurl#1#2{\footnote{#1\hyper@linkurl{\Hurl{#2}}{#2}}}

\newrobustcmd*{\email}{\hyper@normalise\ltd@email}
\def\ltd@email#1{\href{mailto:#1}{#1}}

% title
\providecommand*{\titlepage}{}
\providecommand*{\titlefont}{}
\renewrobustcmd*{\titlepage}[1]{\setkeys{ltd@ttp}{#1}}
\renewcommand*{\titlefont}{
  \bfseries
  \sffamily
  }
\define@key{ltd@ttp}{title}{\def\ltd@title@title{#1}}
\define@key{ltd@ttp}{subtitle}{\def\ltd@title@subtitle{#1}}
\define@key{ltd@ttp}{url}{\def\ltd@title@url{#1}}
\define@key{ltd@ttp}{author}{\def\ltd@title@author{#1}}
\define@key{ltd@ttp}{link}{\def\ltd@title@link{#1}}
\define@key{ltd@ttp}{revision}{\def\ltd@title@revision{#1}}
\define@key{ltd@ttp}{date}{\def\ltd@title@date{#1}}

\providecommand*{\printtitlepage}{}
\renewrobustcmd*{\printtitlepage}{%
  \begingroup
  \centering\titlefont
  \begingroup\LARGE
    \ifundef\ltd@title@url
      {\ltd@title@title}
      {\href{\ltd@title@url}{\ltd@title@title}}%
    \par
  \endgroup
  \vspace{0.25\baselineskip}
  \begingroup\large
    \ltd@title@subtitle\par
  \endgroup
  \vspace{0.25\baselineskip}
  \begin{multicols}{2}
  \raggedleft
    \ltd@title@author\par
    \expandafter\email\expandafter{\ltd@title@link}\par
  \raggedright
    Version \ltd@title@revision\par\ltd@title@date
  \end{multicols}
  \endgroup}

\BeforeStartingTOC[toc]{\begin{multicols}{2}}
\AfterStartingTOC[toc]{\end{multicols}}

\newrobustcmd*{\tex}{\TeX}
\newrobustcmd*{\etex}{\mbox{e-TeX}}
\newrobustcmd*{\pdftex}{pdf\-\tex}
\newrobustcmd*{\xetex}{Xe\-\tex}
\newrobustcmd*{\luatex}{Lua\-\tex}
\newrobustcmd*{\latex}{\LaTeX}%{La\kern-0.07em TeX}
\newrobustcmd*{\pdflatex}{pdf\-\latex}
\newrobustcmd*{\xelatex}{Xe\-\latex}
\newrobustcmd*{\lualatex}{Lua\-\latex}
\newrobustcmd*{\miktex}{Mik\-\tex}
\newrobustcmd*{\texlive}{\tex~live}
\newrobustcmd*{\bibtex}{Bib\kern-0.07em TeX}
\newrobustcmd*{\lppl}{\latex{} Project Public License}
\newrobustcmd*{\pdf}{\acr{PDF}}
\newrobustcmd*{\utf}{\mbox{\acr{UTF}-8}}

\pdfstringdefDisableCommands{%
  \def\tex{TeX}%
  \def\etex{e-TeX}%
  \def\xetex{XeTeX}%
  \def\latex{LaTeX}%
  \def\xelatex{XeLaTeX}%
  \def\bibtex{BibTeX}%
  \def\lppl{LaTeX Project Public License}%
  \def\pdf{PDF}%
  \def\utf{UTF-8}%
}

\let\accentcolour\spotcolor

\addtokomafont{section}{\accentcolour}
\addtokomafont{subsection}{\accentcolour}
\addtokomafont{subsubsection}{\accentcolour}

\renewcommand*{\verbatimfont}{\ttfamily}
\renewcommand*{\displayverbfont}{\ttfamily}
\renewcommand*{\marglistfont}{\accentcolour\sffamily\small}
\renewcommand*{\margnotefont}{\sffamily\small}
\renewcommand*{\optionlistfont}{\accentcolour\sffamily\displayverbfont}
\renewcommand*{\ltxsyntaxfont}{\ttfamily}
\renewcommand*{\ltxsyntaxlabelfont}{\accentcolour\displayverbfont}
\renewcommand*{\changelogfont}{\normalfont}
\renewcommand*{\changeloglabelfont}{\accentcolour\sffamily\bfseries}
\newcommand*{\stylelistfont}{\accentcolour\sffamily\small}

\newenvironment*{stylelist}
  {\list{}{%
     \setlength{\labelwidth}{\marglistwidth}%
     \setlength{\labelsep}{\marglistsep}%
     \setlength{\leftmargin}{0pt}%
     \renewcommand*{\makelabel}[1]{\hss\stylelistfont##1}}%
   \def\styleitem##1{%
     \item[{##1}]%
     \ltd@pdfbookmark{##1}{##1}}}
  {\endlist}

\newenvironment*{keymarglistbook}
  {\marglist
   \setlength{\itemsep}{0pt}%
   \raggedright
   \let\@@item\item
   \def\item[##1]{%
     \@@item[{##1}]%
     \ltd@pdfbookmark{##1}{##1}}}
  {\endmarglist}

% modified for correct measurements
\def\ltd@option@i#1#2#3#4[#5]{%
  \item[#2]%
  \ltd@pdfbookmark{#1}{#1}%
  \begingroup\raggedright
  \ltd@textverb{=}%
  \settowidth\@tempdimb{\ltd@textverb{=}}%
  \settowidth\@tempdimc{\optionlistfont#2}%
  \ifdim\@tempdimc>\marglistwidth
    \@tempdimc=\dimexpr\@tempdimc-\marglistwidth\relax
  \else
    \@tempdimc=0pt
  \fi
  \@tempdima=\dimexpr\linewidth-\@tempdimb-\@tempdimc\relax
  \ifblank{#4}
    {}
    {\settowidth\@tempdimb{default: #4}%
     \@tempdima=\dimexpr\@tempdima-\@tempdimb-2em\relax}%
  \parbox[t]{\@tempdima}{\raggedright #3}%
  \ifblank{#4}
    {}
    {\hfill default:~#4}%
  \ifblank{#5}
    {}
    {\marginpar{\margnotefont #5}}%
  \par\endgroup
  \nobreak\vspace{\itemsep}}

%\blx@inputonce{ext-biblatex-aux.def}{auxiliary code for ext-biblatex}{}{}{}{}
\newcommand*{\biblatexversion}{\extblx@requiredbiblatexversion}
\newcommand*{\biblatexdate}{\extblx@requiredbiblatexdate}

\AtEndPreamble{%
  \deflength{\marglistwidth}{(\oddsidemargin+2cm)*85/100}}
\makeatother

% By Stefan Kottwitz, see https://tex.stackexchange.com/a/799/35864
\newcommand*\justify{%
  \fontdimen2\font=0.4em% interword space
  \fontdimen3\font=0.2em% interword stretch
  \fontdimen4\font=0.1em% interword shrink
  \fontdimen7\font=0.1em% extra space
  \hyphenchar\font=`\-% allowing hyphenation
}

% no \mbox here, we may have to break things
\renewrobustcmd*{\sty}[1]{{\verbatimfont\justify #1}}
\renewrobustcmd*{\bibfield}[1]{\sty{#1}}
\renewrobustcmd*{\opt}[1]{\sty{#1}}
\newrobustcmd*{\bibmacro}[1]{\sty{#1}}
\renewrobustcmd*{\bibtype}[1]{\sty{@#1}}
\renewrobustcmd*{\cmd}[1]{\sty{\textbackslash #1}}


\newcommand*{\gitbaseurl}{https://github.com/LukasCBossert/biblatex-socialsciences-huberlin}
\newcommand*{\biber}{Biber}
\newcommand*{\gitissuelink}[1]{%
  \href{\gitbaseurl/issues/#1}{issue \##1 on github}}

\titlepage{%
  title    = {The \sty{biblatex-socialscienceshuberlin} style},
  subtitle = {Style used for social sciences at Humbold-Universität zu Berlin},
  url      = {\gitbaseurl},
  author   = {Lukas C. Bossert},
  link     = {lukas@digitales-altertum.de},%
  revision = {\socialscienceshuberlinversion},
  date     = {{\socialscienceshuberlindate}},
}

\hypersetup{%
  pdftitle    = {The biblatex-'socialsciences|huberlin' style},
  pdfsubject  = {\sty{biblatex}-style 'socialsciences|huberlin'},
  pdfauthor   = {Lukas C. Bossert},
  pdfkeywords = {latex, biblatex, bibtex, bibliography, references, citation},
}

\hyphenation{%
  star-red
  un-star-red
  bib-lio-gra-phy
  white-space
  bib-open-paren
  bib-close-paren
  bib-open-bracket
  bib-close-bracket
  main-title-after-title
}

\begin{document}

\printtitlepage
\tableofcontents

\section{Introduction}\label{sec:int}
\subsection{About}
The \sty{biblatex-socialscienceshuberlin} style provides the citation and bibliography styles used at the Department of Social Sciences at Humboldt-Universität zu Berlin.

This style is built upon \sty{biblatex-ext}\fnurl{https://ctan.org/pkg/biblatex-ext} and uses \sty{ext-authoryear} for  citations and for the bibliography.
Several customisations have been done so far.

\subsection{Installation}\label{sec:install}
This style is available on \mkbibacro{CTAN}.%
\fnurl{https://ctan.org/pkg/biblatex-socialscienceshuberlin}
The current release is also available in \miktex{} and \texlive{} 2018 or
newer.
If at all possible you should install this style via your \tex{} distribution
(using \miktex{} Console\fnurl{https://miktex.org/howto/miktex-console} or
\sty{tlmgr} for \texlive\fnurl{https://www.tug.org/texlive/pkginstall.html}).
If you must install this package manually, get the files from \mkbibacro{CTAN}
and install the \sty{.bbx}, \sty{.cbx}  files preferably to
\path{tex/latex/editiontopoi} of your local or home \TeX{} tree, the other
files (\path{README.md}, \path{editiontopoi.tex},
\path{editiontopoi.pdf} and \path{editiontopoi-examples.bib}) go to
\path{doc/latex/editiontopoi}, you may have to refresh your file name database
afterwards, so \tex{} can find the files.

\subsection{License}\label{sec:license}
Permission is granted to copy, distribute and\slash or modify this software
under the terms of the \lppl, version 1.3c%
\fnurl{https://www.latex-project.org/lppl/lppl-1-3c.txt}
or (at your option) any later version%
\fnurl{https://www.latex-project.org/lppl.txt}.
This style is maintained by Lukas C. Bossert (\textcopyright 2018).


\section{How to use it}
For a general introduction to \sty{biblatex} see its documentation available on \mkbibacro{CTAN}\fnurl{http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/biblatex.pdf},
or have a look at the short \sty{biblatex}-tutorial by Paul Stanley\fnurl{https://github.com/PaulStanley/biblatex-tutorial/releases/download/0.2/biblatex-tutorial.pdf}. 

% There is one option so far: You can chose whether the author’s/editor’s names are colored and you can also define the color.

Note that the author’s/editor’s names are colored so far.
This will be an option in further releases.


\section{Bibliography examples}
\nocite{*} 
\begin{bibexample}[breakable]
\printbibliography
\end{bibexample}

\end{document}
\endinput