doc-isac/mlehnfeld/master/thesis/hgbbib.sty
author Mathias Lehnfeld <s1210629013@students.fh-hagenberg.at>
Wed, 12 Mar 2014 17:43:22 +0100
changeset 55404 ab97437e021a
permissions -rw-r--r--
mathias lehnfeld master thesis latex files added
s1210629013@55404
     1
%% --------------- Bibliography setup --------------------------------------
s1210629013@55404
     2
s1210629013@55404
     3
\usepackage{csquotes}	% recommended for biblatex
s1210629013@55404
     4
%\usepackage[babel,german=quotes]{csquotes}	% utf8-change ??
s1210629013@55404
     5
s1210629013@55404
     6
%utf8-change
s1210629013@55404
     7
%Note: biblatex with bibtex backend is frozen at version 1.7.
s1210629013@55404
     8
\usepackage[style=numeric-comp,backend=biber,bibencoding=auto]{biblatex}[2013/01/10] %utf8-change
s1210629013@55404
     9
s1210629013@55404
    10
\ExecuteBibliographyOptions{bibwarn=true,sortcites=true,defernumbers=true,isbn=false,doi=false,backref=true}
s1210629013@55404
    11
s1210629013@55404
    12
%% titles of reference section + 3 categories of references:
s1210629013@55404
    13
\newcommand{\@bibtitle}{Quellenverzeichnis}
s1210629013@55404
    14
\newcommand{\@bibtitleLiteratur}{Literatur}
s1210629013@55404
    15
\newcommand{\@bibtitleAvmedia}{Filme und audiovisuelle Medien}
s1210629013@55404
    16
\newcommand{\@bibtitleOnline}{Online-Quellen}	
s1210629013@55404
    17
s1210629013@55404
    18
\ifthenelse{\equal{\hgb@MainLanguage}{english}}{%
s1210629013@55404
    19
	\renewcommand{\@bibtitle}{References}
s1210629013@55404
    20
	\renewcommand{\@bibtitleLiteratur}{Literature}
s1210629013@55404
    21
	\renewcommand{\@bibtitleAvmedia}{Films and audio-visual media}
s1210629013@55404
    22
	\renewcommand{\@bibtitleOnline}{Online sources}	
s1210629013@55404
    23
}{}
s1210629013@55404
    24
s1210629013@55404
    25
\defbibfilter{literature}{
s1210629013@55404
    26
	not ( type=movie or type=video or type=music or type=audio or 
s1210629013@55404
    27
				type=online or type=electronic or type=www or type=software )}
s1210629013@55404
    28
s1210629013@55404
    29
\defbibfilter{avmedia}{%
s1210629013@55404
    30
	( type=movie or type=video or type=music or type=audio or type=software )}
s1210629013@55404
    31
s1210629013@55404
    32
\defbibfilter{online}{%
s1210629013@55404
    33
	( type=online or type=electronic or type=www )}
s1210629013@55404
    34
s1210629013@55404
    35
s1210629013@55404
    36
\defbibheading{noheader}[]{}	% 'none' should be defined but isn't
s1210629013@55404
    37
s1210629013@55404
    38
% utf8-change (deactivated):
s1210629013@55404
    39
% German format in biblatex is flawed: it adds wrong spaces and prohibits
s1210629013@55404
    40
% line breaking within date strings. Corrected by Wilbur as follows.
s1210629013@55404
    41
% Taken from german.lbx: replaced \thinspace by breaking zero space \hskip0pt 
s1210629013@55404
    42
%\DefineBibliographyExtras{ngerman}{% 
s1210629013@55404
    43
  %\def\mkbibdatelong#1#2#3{%
s1210629013@55404
    44
    %\iffieldundef{#3}
s1210629013@55404
    45
      %{\hskip0pt}
s1210629013@55404
    46
      %{\mkbibordinal{\thefield{#3}}%
s1210629013@55404
    47
       %\iffieldundef{#2}{}{\space}}%	%was: \nobreakspace
s1210629013@55404
    48
    %\iffieldundef{#2}
s1210629013@55404
    49
      %{\hskip0pt}
s1210629013@55404
    50
      %{\mkbibmonth{\thefield{#2}}%
s1210629013@55404
    51
       %\iffieldundef{#1}{\hskip0pt}{\space}}%
s1210629013@55404
    52
    %\stripzeros{\thefield{#1}}}%
s1210629013@55404
    53
%%
s1210629013@55404
    54
  %\def\mkbibdateshort#1#2#3{%
s1210629013@55404
    55
    %\iffieldundef{#3}
s1210629013@55404
    56
      %{\hskip0pt}
s1210629013@55404
    57
      %{\mkdatezeros{\thefield{#3}}\adddot
s1210629013@55404
    58
       %\iffieldundef{#2}{}{\hskip0pt}}%
s1210629013@55404
    59
    %\iffieldundef{#2}
s1210629013@55404
    60
      %{\hskip0pt}
s1210629013@55404
    61
      %{\mkdatezeros{\thefield{#2}}%
s1210629013@55404
    62
       %\iffieldundef{#1}
s1210629013@55404
    63
	 %{\hskip0pt}
s1210629013@55404
    64
	 %{\iffieldundef{#3}{/}{\adddot\hskip0pt}}}%
s1210629013@55404
    65
    %\mkdatezeros{\thefield{#1}}}%
s1210629013@55404
    66
%}
s1210629013@55404
    67
s1210629013@55404
    68
% utf8-change (deactivated):
s1210629013@55404
    69
% Similar problem with badly braking date strings in english.
s1210629013@55404
    70
% Taken from english.lbx: added breaking zero space \hskip0pt to /
s1210629013@55404
    71
%\DefineBibliographyExtras{english}{% 
s1210629013@55404
    72
  %\def\mkbibdatelong#1#2#3{%
s1210629013@55404
    73
    %\iffieldundef{#2}
s1210629013@55404
    74
      %{}
s1210629013@55404
    75
      %{\mkbibmonth{\thefield{#2}}%
s1210629013@55404
    76
       %\iffieldundef{#3}
s1210629013@55404
    77
         %{\iffieldundef{#1}{}{\space}}
s1210629013@55404
    78
	 %{\space}}%	%was: \nobreakspace
s1210629013@55404
    79
    %\iffieldundef{#3}
s1210629013@55404
    80
      %{}
s1210629013@55404
    81
      %{\stripzeros{\thefield{#3}}%
s1210629013@55404
    82
       %\iffieldundef{#1}{}{,\space}}%
s1210629013@55404
    83
    %\stripzeros{\thefield{#1}}}%
s1210629013@55404
    84
%%
s1210629013@55404
    85
  %\def\mkbibdateshort#1#2#3{%
s1210629013@55404
    86
    %\iffieldundef{#2}
s1210629013@55404
    87
      %{}
s1210629013@55404
    88
      %{\mkdatezeros{\thefield{#2}}%
s1210629013@55404
    89
       %\iffieldundef{#3}
s1210629013@55404
    90
         %{\iffieldundef{#1}{}{/{\hskip0pt}}}
s1210629013@55404
    91
	 %{/{\hskip0pt}}}%
s1210629013@55404
    92
    %\iffieldundef{#3}
s1210629013@55404
    93
      %{}
s1210629013@55404
    94
      %{\mkdatezeros{\thefield{#3}}%
s1210629013@55404
    95
       %\iffieldundef{#1}{}{/{\hskip0pt}}}%
s1210629013@55404
    96
    %\mkdatezeros{\thefield{#1}}}%
s1210629013@55404
    97
%}
s1210629013@55404
    98
s1210629013@55404
    99
s1210629013@55404
   100
%This is only a wrapper to \addbibresource to allow the use
s1210629013@55404
   101
%of the classic bibtex-workflow in the future.
s1210629013@55404
   102
\newcommand{\AddBibFile}[1]{
s1210629013@55404
   103
	\addbibresource{#1}%
s1210629013@55404
   104
}
s1210629013@55404
   105
s1210629013@55404
   106
%See http://www.jr-x.de/publikationen/latex/tipps/zeilenumbruch.html
s1210629013@55404
   107
\newenvironment{bibhyphenation}% 
s1210629013@55404
   108
	{\hyphenpenalty=20%		(50)
s1210629013@55404
   109
	 \tolerance=9999%				(200)
s1210629013@55404
   110
	 \exhyphenpenalty=0%		(50)
s1210629013@55404
   111
	 \linepenalty=0%				(10)
s1210629013@55404
   112
	 \setlength{\emergencystretch}{3em}}%
s1210629013@55404
   113
	{}
s1210629013@55404
   114
s1210629013@55404
   115
% Currently the only public macro:
s1210629013@55404
   116
% \MakeBibliography ... creates a reference section split subsections (default)
s1210629013@55404
   117
% \MakeBibliography[nosplit] ... creates a one-piece reference section
s1210629013@55404
   118
\newcommand{\MakeBibliography}[1][]{
s1210629013@55404
   119
	% opt. arg (#1): optional argument "nosplit" to get a 1-piece bibliography
s1210629013@55404
   120
	\clearpage
s1210629013@55404
   121
	\ifthenelse{\equal{#1}{nosplit}}%
s1210629013@55404
   122
		{% create a single bibliography with all entries:
s1210629013@55404
   123
			%\printbibheading[heading=bibintoc,title={#2}]
s1210629013@55404
   124
			\printbibheading[heading=bibintoc,title={\@bibtitle}]
s1210629013@55404
   125
			\begin{bibhyphenation}	
s1210629013@55404
   126
			\printbibliography[heading=noheader]
s1210629013@55404
   127
			\end{bibhyphenation}
s1210629013@55404
   128
		}
s1210629013@55404
   129
		{% split the bibliography using the predefined categories:
s1210629013@55404
   130
			%\printbibheading[heading=bibintoc,title={#2}]
s1210629013@55404
   131
			\printbibheading[heading=bibintoc,title={\@bibtitle}]
s1210629013@55404
   132
			\begin{bibhyphenation}
s1210629013@55404
   133
			\printbibliography[filter=literature,heading=subbibintoc,title={\@bibtitleLiteratur}]
s1210629013@55404
   134
			\printbibliography[filter=avmedia,heading=subbibintoc,title={\@bibtitleAvmedia}]
s1210629013@55404
   135
			\printbibliography[filter=online,heading=subbibintoc,title={\@bibtitleOnline}]
s1210629013@55404
   136
			\end{bibhyphenation}
s1210629013@55404
   137
		}%
s1210629013@55404
   138
}