Debian Codegraph @

texmf-dist/doc/latex/biblatex-socialscienceshuberlin/socialscienceshuberlin.tex

raw
1 % biblatex-socialsciences|huberlin --%
2 % Copyright (c) 2018 and
3 % maintained by Lukas C. Bossert
4 %
5 % This work may be distributed and/or modified under the
6 % conditions of the LaTeX Project Public License, either version 1.3
7 % of this license or (at your option) any later version.
8 % The latest version of this license is in
9 % http://www.latex-project.org/lppl.txt
10 % and version 1.3 or later is part of all distributions of LaTeX
11 % version 2005/12/01 or later.
12
13 %%%%% Disclaimer %%%%%%%%%%%%%%%%%%%%%
14 % The code of this documentation %
15 % has been taken form 'biblatex-ext' %
16 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
17
18 \documentclass[DIV=11]{scrartcl}
19 \usepackage{ifxetex,ifluatex}
20 \newif\iffontspec
21 \ifxetex
22 \fontspectrue
23 \else\ifluatex
24 \fontspectrue
25 \else
26 \fontspecfalse
27 \fi\fi
28 \iffontspec
29 \usepackage{fontspec}
30 \else
31 \usepackage[T1]{fontenc}
32 \usepackage[utf8]{inputenc}
33 \fi
34 \usepackage[british]{babel}
35 \usepackage{csquotes}
36
37
38 \usepackage[useregional]{datetime2}
39 \iffontspec
40 \setmainfont[
41 % Scale = 0.95,
42 % Numbers = {OldStyle},
43 Numbers={Proportional},
44 % BoldItalicFont = Gentium Book Basic Bold Italic,
45 Ligatures = TeX,
46 BoldFont={Gentium Basic Bold},
47 % BoldFont = GenBasB,
48 % BoldFont={Gentium Basic Bold},
49 ]{Gentium Plus}
50 \setsansfont[
51 Ligatures = TeX,
52 BoldFont = Dosis-SemiBold,
53 ItalicFont = Dosis-Regular,
54 ItalicFeatures={FakeSlant=0.25}
55 ]{Dosis-Light}
56 \else
57 \usepackage{lmodern}
58 \usepackage[mono=false]{libertine}
59 \usepackage[libertine]{newtxmath}
60 \usepackage[scaled=0.78]{beramono}
61 \fi
62 \usepackage{microtype}
63 \usepackage{hyphenat}
64 \usepackage{bm}
65 \usepackage{booktabs}
66 \usepackage{multicol}
67 \usepackage{upquote}
68 \usepackage[svgnames]{xcolor}
69 \usepackage[listings, breakable, skins]{tcolorbox}%
70 \usetikzlibrary{arrows.meta}
71 \usepackage[style=socialscienceshuberlin, backend=biber]{biblatex}
72 \addbibresource{socialscienceshuberlin-examples.bib}
73
74 \usepackage[
75 headsepline,
76 footsepline,
77 automark,
78 draft=false,
79 ]{scrlayer-scrpage}
80 \pagestyle{scrheadings}
81 \clearscrheadfoot
82 \rohead{\texttt{bib}\LaTeX-style \texttt{socialsciences|huberlin \socialscienceshuberlinversion}}%
83 \lohead{\copyright\ by Lukas C. Bossert}
84 \rofoot{\normalfont\footnotesize \textbf{\sffamily \thepage}}
85 \lofoot{\normalfont\footnotesize \href{http://digitales-altertum.de}{digitales-altertum|de}}
86 \setkomafont{pageheadfoot}{\normalfont\footnotesize}
87 \setkomafont{footnotereference}{\normalfont\addfontfeature{Numbers=Lining}\selectfont}
88 \addtokomafont{footnotenumber}{\footnotesize\normalfont}
89 \deffootnote%
90 %[\normalparindent]%<width of mark>
91 {0.075cm}%<indent of footnote text>
92 {\normalparindent}%<paragraph indent in the footnote text>
93 {\makebox[\normalparindent][r]%
94 {\thefootnotemark\hspace*{4pt}}}%<definition of mark>
95 \newlength{\normalparindent}
96 \AtBeginDocument{\setlength{\normalparindent}{\parindent}}
97 \setfootnoterule{0pt}% Kein Fußnotenstrich
98 %\setfootnoterule[<height>]{<length>}
99
100 \makeatletter
101 \iffontspec
102 \def\textvisiblespace{%
103 \raisebox{-2.2pt}{%
104 \mbox{\kern.04em\vrule \@height.5ex \@width.12ex}%
105 \vbox{\hrule \@width.2em \@height.12ex}%
106 \hbox{\vrule \@height.5ex \@width.12ex}%
107 \kern.04em}}
108 \fi
109 \makeatother
110
111
112 \usepackage{ltxdockit}
113 \usepackage{btxdockit}
114 \usepackage{cleveref}
115 \hypersetup{%
116 colorlinks=true,
117 allcolors=spot,
118 bookmarksopen=true,
119 bookmarksnumbered=false,
120 plainpages=false}
121
122 \definecolor{highlight1}{RGB}{240, 0, 0}
123 \definecolor{highlight2}{RGB}{0,153, 153}
124 \definecolor{spot}{rgb}{0,0.2,0.6}
125
126 \lstdefinestyle{extblxstylegeneral}{%
127 aboveskip = {0\p@ \@plus 6\p@},
128 belowskip = {0\p@ \@plus 6\p@},
129 tabsize = 2,
130 breaklines = true,
131 breakatwhitespace = true,
132 keepspaces = true,
133 escapeinside = {(*@}{@*)},
134 moredelim = {[is][\ttfamily\bfseries\color{highlight1}]{|}{|}},
135 moredelim = {[is][\ttfamily\bfseries\color{highlight1}]{|1}{1|}},
136 moredelim = {[is][\ttfamily\bfseries\color{highlight2}]{|2}{2|}},
137 }
138
139 \lstdefinelanguage{extBibTeX}{%
140 morekeywords=[1]{%
141 @article,@artwork,@audio,@bibnote,@book,@bookinbook,@booklet,%
142 @collection,@commentary,@customa,@customb,@customc,@customd,%
143 @custome,@customf,@inbook,@incollection,@inproceedings,%
144 @inreference,@image,@jurisdiction,@legal,@legislation,@letter,%
145 @manual,@misc,@movie,@music,@mvcollection,@mvreference,%
146 @mvproceedings,@mvbook,@online,@patent,@performance,@periodical,%
147 @proceedings,@reference,@report,@review,@set,@software,@standard,%
148 @suppbook,@suppcollection,@suppperiodical,@thesis,@unpublished,@video%
149 },
150 morekeywords=[2]{author,title,date,owner,timestamp,journaltitle,%
151 location,publisher,booktitle,subtitle,booksubtitle,pages,series,%
152 shortseries,serieseditor,number,volume,year,date,pubstatus,editor,%
153 shorthand,shortauthor,keywords,options,groups,shorteditor,translator,%
154 origlanguage,origtitle,edition,origdate,doi},
155 keywordstyle=[1]{\bfseries\spotcolor},
156 keywordstyle=[2]{\spotcolor},
157 sensitive=true,
158 }
159
160 \lstdefinestyle{extblxstylelatex}{%
161 language = {[LaTeX]TeX},
162 style = {extblxstylegeneral},
163 }
164
165 \lstdefinestyle{extblxstylebibtex}{%
166 language = {extBibTeX},
167 style = {extblxstylegeneral},
168 }
169
170
171 \newcommand*{\highlight}[2][1]{\textcolor{highlight#1}{#2}}
172 \newcommand*{\highlightbf}[2][1]{\textcolor{highlight#1}{\textbf{#2}}}
173 \DeclareFieldFormat{highlight1}{\textcolor{highlight1}{#1}}
174 \DeclareFieldFormat{highlight2}{\textcolor{highlight2}{#1}}
175
176 \newtcolorbox{bibexample}[1][]{enhanced,
177 colframe=spot!75!black, colback=spot!5!white,
178 breakable,
179 #1}
180 \newtcblisting{biblatexcode}{enhanced,
181 colframe=black!75!white, colback=black!5!white,
182 listing only,
183 frame hidden,
184 breakable,
185 listing style=extblxstylelatex}
186 \newtcblisting{bibtexfile}{enhanced,
187 colframe=black!75!white, colback=black!5!white,
188 listing only,
189 frame hidden,
190 breakable,
191 listing style = extblxstylebibtex}
192 \newcommand\edtobibexample[2][]{
193 \begin{bibexample}[#1]
194 \begin{refsection}
195 #2\par
196 \hrulefill
197 \printbibliography[heading=none]
198 \end{refsection}
199 \end{bibexample}
200 }
201
202
203 \newtcbinputlisting\inputexamplebibfile[2][]{%
204 listing file={#2},
205 enhanced,
206 colframe=black!75!white,
207 colback=black!5!white,
208 listing only,
209 frame hidden,
210 breakable,
211 %listing style = extblxstylebibtex,
212 #1}
213
214
215
216
217 \makeatletter
218 \AtUsedriver*{%
219 \let\newblock\relax
220 \let\abx@macro@bibindex\@empty
221 \let\abx@macro@pageref\@empty}
222
223
224 % this is taken from ltxdockit.cls, which is not loaded
225 \newrobustcmd*{\fnurl}[1][]{\hyper@normalise\ltd@fnurl{#1}}
226 \def\ltd@fnurl#1#2{\footnote{#1\hyper@linkurl{\Hurl{#2}}{#2}}}
227
228 \newrobustcmd*{\email}{\hyper@normalise\ltd@email}
229 \def\ltd@email#1{\href{mailto:#1}{#1}}
230
231 % title
232 \providecommand*{\titlepage}{}
233 \providecommand*{\titlefont}{}
234 \renewrobustcmd*{\titlepage}[1]{\setkeys{ltd@ttp}{#1}}
235 \renewcommand*{\titlefont}{
236 \bfseries
237 \sffamily
238 }
239 \define@key{ltd@ttp}{title}{\def\ltd@title@title{#1}}
240 \define@key{ltd@ttp}{subtitle}{\def\ltd@title@subtitle{#1}}
241 \define@key{ltd@ttp}{url}{\def\ltd@title@url{#1}}
242 \define@key{ltd@ttp}{author}{\def\ltd@title@author{#1}}
243 \define@key{ltd@ttp}{link}{\def\ltd@title@link{#1}}
244 \define@key{ltd@ttp}{revision}{\def\ltd@title@revision{#1}}
245 \define@key{ltd@ttp}{date}{\def\ltd@title@date{#1}}
246
247 \providecommand*{\printtitlepage}{}
248 \renewrobustcmd*{\printtitlepage}{%
249 \begingroup
250 \centering\titlefont
251 \begingroup\LARGE
252 \ifundef\ltd@title@url
253 {\ltd@title@title}
254 {\href{\ltd@title@url}{\ltd@title@title}}%
255 \par
256 \endgroup
257 \vspace{0.25\baselineskip}
258 \begingroup\large
259 \ltd@title@subtitle\par
260 \endgroup
261 \vspace{0.25\baselineskip}
262 \begin{multicols}{2}
263 \raggedleft
264 \ltd@title@author\par
265 \expandafter\email\expandafter{\ltd@title@link}\par
266 \raggedright
267 Version \ltd@title@revision\par\ltd@title@date
268 \end{multicols}
269 \endgroup}
270
271 \BeforeStartingTOC[toc]{\begin{multicols}{2}}
272 \AfterStartingTOC[toc]{\end{multicols}}
273
274 \newrobustcmd*{\tex}{\TeX}
275 \newrobustcmd*{\etex}{\mbox{e-TeX}}
276 \newrobustcmd*{\pdftex}{pdf\-\tex}
277 \newrobustcmd*{\xetex}{Xe\-\tex}
278 \newrobustcmd*{\luatex}{Lua\-\tex}
279 \newrobustcmd*{\latex}{\LaTeX}%{La\kern-0.07em TeX}
280 \newrobustcmd*{\pdflatex}{pdf\-\latex}
281 \newrobustcmd*{\xelatex}{Xe\-\latex}
282 \newrobustcmd*{\lualatex}{Lua\-\latex}
283 \newrobustcmd*{\miktex}{Mik\-\tex}
284 \newrobustcmd*{\texlive}{\tex~live}
285 \newrobustcmd*{\bibtex}{Bib\kern-0.07em TeX}
286 \newrobustcmd*{\lppl}{\latex{} Project Public License}
287 \newrobustcmd*{\pdf}{\acr{PDF}}
288 \newrobustcmd*{\utf}{\mbox{\acr{UTF}-8}}
289
290 \pdfstringdefDisableCommands{%
291 \def\tex{TeX}%
292 \def\etex{e-TeX}%
293 \def\xetex{XeTeX}%
294 \def\latex{LaTeX}%
295 \def\xelatex{XeLaTeX}%
296 \def\bibtex{BibTeX}%
297 \def\lppl{LaTeX Project Public License}%
298 \def\pdf{PDF}%
299 \def\utf{UTF-8}%
300 }
301
302 \let\accentcolour\spotcolor
303
304 \addtokomafont{section}{\accentcolour}
305 \addtokomafont{subsection}{\accentcolour}
306 \addtokomafont{subsubsection}{\accentcolour}
307
308 \renewcommand*{\verbatimfont}{\ttfamily}
309 \renewcommand*{\displayverbfont}{\ttfamily}
310 \renewcommand*{\marglistfont}{\accentcolour\sffamily\small}
311 \renewcommand*{\margnotefont}{\sffamily\small}
312 \renewcommand*{\optionlistfont}{\accentcolour\sffamily\displayverbfont}
313 \renewcommand*{\ltxsyntaxfont}{\ttfamily}
314 \renewcommand*{\ltxsyntaxlabelfont}{\accentcolour\displayverbfont}
315 \renewcommand*{\changelogfont}{\normalfont}
316 \renewcommand*{\changeloglabelfont}{\accentcolour\sffamily\bfseries}
317 \newcommand*{\stylelistfont}{\accentcolour\sffamily\small}
318
319 \newenvironment*{stylelist}
320 {\list{}{%
321 \setlength{\labelwidth}{\marglistwidth}%
322 \setlength{\labelsep}{\marglistsep}%
323 \setlength{\leftmargin}{0pt}%
324 \renewcommand*{\makelabel}[1]{\hss\stylelistfont##1}}%
325 \def\styleitem##1{%
326 \item[{##1}]%
327 \ltd@pdfbookmark{##1}{##1}}}
328 {\endlist}
329
330 \newenvironment*{keymarglistbook}
331 {\marglist
332 \setlength{\itemsep}{0pt}%
333 \raggedright
334 \let\@@item\item
335 \def\item[##1]{%
336 \@@item[{##1}]%
337 \ltd@pdfbookmark{##1}{##1}}}
338 {\endmarglist}
339
340 % modified for correct measurements
341 \def\ltd@option@i#1#2#3#4[#5]{%
342 \item[#2]%
343 \ltd@pdfbookmark{#1}{#1}%
344 \begingroup\raggedright
345 \ltd@textverb{=}%
346 \settowidth\@tempdimb{\ltd@textverb{=}}%
347 \settowidth\@tempdimc{\optionlistfont#2}%
348 \ifdim\@tempdimc>\marglistwidth
349 \@tempdimc=\dimexpr\@tempdimc-\marglistwidth\relax
350 \else
351 \@tempdimc=0pt
352 \fi
353 \@tempdima=\dimexpr\linewidth-\@tempdimb-\@tempdimc\relax
354 \ifblank{#4}
355 {}
356 {\settowidth\@tempdimb{default: #4}%
357 \@tempdima=\dimexpr\@tempdima-\@tempdimb-2em\relax}%
358 \parbox[t]{\@tempdima}{\raggedright #3}%
359 \ifblank{#4}
360 {}
361 {\hfill default:~#4}%
362 \ifblank{#5}
363 {}
364 {\marginpar{\margnotefont #5}}%
365 \par\endgroup
366 \nobreak\vspace{\itemsep}}
367
368 %\blx@inputonce{ext-biblatex-aux.def}{auxiliary code for ext-biblatex}{}{}{}{}
369 \newcommand*{\biblatexversion}{\extblx@requiredbiblatexversion}
370 \newcommand*{\biblatexdate}{\extblx@requiredbiblatexdate}
371
372 \AtEndPreamble{%
373 \deflength{\marglistwidth}{(\oddsidemargin+2cm)*85/100}}
374 \makeatother
375
376 % By Stefan Kottwitz, see https://tex.stackexchange.com/a/799/35864
377 \newcommand*\justify{%
378 \fontdimen2\font=0.4em% interword space
379 \fontdimen3\font=0.2em% interword stretch
380 \fontdimen4\font=0.1em% interword shrink
381 \fontdimen7\font=0.1em% extra space
382 \hyphenchar\font=`\-% allowing hyphenation
383 }
384
385 % no \mbox here, we may have to break things
386 \renewrobustcmd*{\sty}[1]{{\verbatimfont\justify #1}}
387 \renewrobustcmd*{\bibfield}[1]{\sty{#1}}
388 \renewrobustcmd*{\opt}[1]{\sty{#1}}
389 \newrobustcmd*{\bibmacro}[1]{\sty{#1}}
390 \renewrobustcmd*{\bibtype}[1]{\sty{@#1}}
391 \renewrobustcmd*{\cmd}[1]{\sty{\textbackslash #1}}
392
393
394 \newcommand*{\gitbaseurl}{https://github.com/LukasCBossert/biblatex-socialsciences-huberlin}
395 \newcommand*{\biber}{Biber}
396 \newcommand*{\gitissuelink}[1]{%
397 \href{\gitbaseurl/issues/#1}{issue \##1 on github}}
398
399 \titlepage{%
400 title = {The \sty{biblatex-socialscienceshuberlin} style},
401 subtitle = {Style used for social sciences at Humbold-Universität zu Berlin},
402 url = {\gitbaseurl},
403 author = {Lukas C. Bossert},
404 link = {[email protected]},%
405 revision = {\socialscienceshuberlinversion},
406 date = {{\socialscienceshuberlindate}},
407 }
408
409 \hypersetup{%
410 pdftitle = {The biblatex-'socialsciences|huberlin' style},
411 pdfsubject = {\sty{biblatex}-style 'socialsciences|huberlin'},
412 pdfauthor = {Lukas C. Bossert},
413 pdfkeywords = {latex, biblatex, bibtex, bibliography, references, citation},
414 }
415
416 \hyphenation{%
417 star-red
418 un-star-red
419 bib-lio-gra-phy
420 white-space
421 bib-open-paren
422 bib-close-paren
423 bib-open-bracket
424 bib-close-bracket
425 main-title-after-title
426 }
427
428 \begin{document}
429
430 \printtitlepage
431 \tableofcontents
432
433 \section{Introduction}\label{sec:int}
434 \subsection{About}
435 The \sty{biblatex-socialscienceshuberlin} style provides the citation and bibliography styles used at the Department of Social Sciences at Humboldt-Universität zu Berlin.
436
437 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.
438 Several customisations have been done so far.
439
440 \subsection{Installation}\label{sec:install}
441 This style is available on \mkbibacro{CTAN}.%
442 \fnurl{https://ctan.org/pkg/biblatex-socialscienceshuberlin}
443 The current release is also available in \miktex{} and \texlive{} 2018 or
444 newer.
445 If at all possible you should install this style via your \tex{} distribution
446 (using \miktex{} Console\fnurl{https://miktex.org/howto/miktex-console} or
447 \sty{tlmgr} for \texlive\fnurl{https://www.tug.org/texlive/pkginstall.html}).
448 If you must install this package manually, get the files from \mkbibacro{CTAN}
449 and install the \sty{.bbx}, \sty{.cbx} files preferably to
450 \path{tex/latex/editiontopoi} of your local or home \TeX{} tree, the other
451 files (\path{README.md}, \path{editiontopoi.tex},
452 \path{editiontopoi.pdf} and \path{editiontopoi-examples.bib}) go to
453 \path{doc/latex/editiontopoi}, you may have to refresh your file name database
454 afterwards, so \tex{} can find the files.
455
456 \subsection{License}\label{sec:license}
457 Permission is granted to copy, distribute and\slash or modify this software
458 under the terms of the \lppl, version 1.3c%
459 \fnurl{https://www.latex-project.org/lppl/lppl-1-3c.txt}
460 or (at your option) any later version%
461 \fnurl{https://www.latex-project.org/lppl.txt}.
462 This style is maintained by Lukas C. Bossert (\textcopyright 2018).
463
464
465 \section{How to use it}
466 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},
467 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}.
468
469 % 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.
470
471 Note that the author’s/editor’s names are colored so far.
472 This will be an option in further releases.
473
474
475 \section{Bibliography examples}
476 \nocite{*}
477 \begin{bibexample}[breakable]
478 \printbibliography
479 \end{bibexample}
480
481 \end{document}
482 \endinput