From 0dcbbb0e0bc4c90cc0ca405a7d353482760e4bec Mon Sep 17 00:00:00 2001 From: Martin Sievers Date: Wed, 20 Apr 2016 14:19:22 +0200 Subject: [PATCH] Added option ``nobiblatex`` to supress the loading of the biblatex package Added documentation to README.md and abstract-templatex.tex --- README.md | 10 +++++++++ abstract-template.tex | 25 +++++++++++++++++++--- dhbenelux.sty | 50 ++++++++++++++++++++++++++----------------- 3 files changed, 62 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 439fc60..fed379f 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,15 @@ License: Released under the LaTeX Project Public License v1.3c or later See: http://www.latex-project.org/lppl.txt ---------------------------------------------------------------------------- +This is an adoption of the MS Word template made available by the organizers +of the DH Benelux 2016 in Luxembourg. + +To use this LaTeX style file, please copy "dhbenelux.sty" and +"abstract-template.tex" to a directory. Edit "abstract-template.tex" and call +"xelatex" on that file (either via the shell or via your editor). Then call +biber (which is a modern substitute for BibTeX) and "xelatex" again (maybe +twice). + ``` ## Changelog @@ -17,6 +26,7 @@ See: http://www.latex-project.org/lppl.txt ### 0.2 to 0.3 * Added support for ``hyperref`` package (options ``print`` and ``electronic``) +* Added option ``nobiblatex`` to allow alternative ways for bibliography (BibTeX or own bibliography environment) * split up files to distribute it via Github ### 0.1 to 0.2 diff --git a/abstract-template.tex b/abstract-template.tex index 2e2b920..82acbf0 100644 --- a/abstract-template.tex +++ b/abstract-template.tex @@ -27,13 +27,30 @@ % www.makeuseof.com/tag/how-to-install-microsoft-core-fonts-in-ubuntu-linux/ % or www.pcworld.com/article/2863497/how-to-install-microsoft-fonts-in-linux-office-suites.html % +% By default the biblatex package is used in conjenction with biber. +% Therefore you have to call ``xelatex'', then ''biber'' and then +% ``xelatex'' again (maybe twice) +% % If you have any comments or questions, please let me know. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \documentclass[a4paper,11pt]{article} -\usepackage[]{dhbenelux} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%% Load style file for DH Benelux +%%% Available options: +%%% - electronic: create a document using hyperref with colors (default) +%%% - print: do not use colored links +%%% - biblatex: load biblatex package with backend biber (default) +%%% - nobiblatex: do not load biblatex -> user has to provide it own +%%% thebibliography environment, e.g. with bst+bibtex +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\usepackage[biblatex]{dhbenelux} +% Default: biblatex+biber \addbibresource{YOURFILE.bib} %%%<--- ENTER your .bib file here +% Otherwise provide your own thebibliography environment or use bst +% files together with bibtex +% \begin{document} \title{Title of Your Paper in Title Case} \author{Author name 1}{Affil}{Email@email.de} @@ -46,7 +63,7 @@ \maketitle -Please enter for text. +Please enter your text. \begin{figure} Place graphic here \caption{Fractal island construction} @@ -55,6 +72,8 @@ Please enter other text here. Use \parencite{key}, \cite{key} or \textcite{key} for references to your BibTeX database. -%%% Outputs bibliography +%%% Outputs bibliography (for default biblatex usage) +%%% You can use \bibliographystyle and \bibliography here instead if you want. \printbibliography + \end{document} \ No newline at end of file diff --git a/dhbenelux.sty b/dhbenelux.sty index 55a4518..d1b6506 100644 --- a/dhbenelux.sty +++ b/dhbenelux.sty @@ -14,13 +14,16 @@ % This work consists of the files dhbenelux.sty and abstract-template.tex % \NeedsTeXFormat{LaTeX2e}[1999/12/01] -\ProvidesPackage{dhbenelux}[2016/04/14 v0.3 A small style file for the DH Benelux] +\ProvidesPackage{dhbenelux}[2016/04/20 v0.3 A small style file for the DH Benelux] \RequirePackage{ifxetex} \RequireXeTeX \newif\if@print +\newif\if@usebiblatex \DeclareOption{electronic}{\@printfalse} \DeclareOption{print}{\@printtrue} -\ExecuteOptions{electronic} +\DeclareOption{biblatex}{\@usebiblatextrue} +\DeclareOption{nobiblatex}{\@usebiblatexfalse} +\ExecuteOptions{biblatex,electronic} \ProcessOptions\relax \usepackage{fontspec} \setmainfont{Calibri} @@ -44,24 +47,31 @@ format=hang,justification=raggedright,% singlelinecheck=false} \usepackage[autostyle]{csquotes} -\usepackage[backend=biber,style=authoryear]{biblatex} -%%% -\ExecuteBibliographyOptions{firstinits=true,uniquename=init,doi=false,isbn=false} - -\DeclareNameAlias{sortname}{last-first} - -\setlength{\bibitemsep}{0pt} -\setlength{\bibhang}{2em} -\renewcommand{\newunitpunct}{\addcomma\space} -\renewcommand{\labelnamepunct}{\addspace} -\renewbibmacro*{in:}{} -\renewcommand{\bibfont}{\normalfont\fontsize{10pt}{11.5pt}\selectfont\raggedright} -\defbibheading{bibliography}[\refname]{% - \removelastskip% - \vspace*{8mm}% - {\bfseries\fontsize{12pt}{13.8pt}\selectfont\color{GrayForReferences} #1\par}% - \vspace*{-0.5\baselineskip}}% -%%% +\if@usebiblatex + \PackageInfo{dhbenelux}{Package biblatex loaded. Please use\MessageBreak biber instead of bibtex to connect your .bib file.} + \usepackage[backend=biber,style=authoryear]{biblatex} + %%% + \ExecuteBibliographyOptions{firstinits=true,uniquename=init,doi=false,isbn=false} + % + \DeclareNameAlias{sortname}{last-first} + % + \setlength{\bibitemsep}{0pt} + \setlength{\bibhang}{2em} + \renewcommand{\newunitpunct}{\addcomma\space} + \renewcommand{\labelnamepunct}{\addspace} + \renewbibmacro*{in:}{} + \renewcommand{\bibfont}{\normalfont\fontsize{10pt}{11.5pt}\selectfont\raggedright} + \defbibheading{bibliography}[\refname]{% + \removelastskip% + \vspace*{8mm}% + {\bfseries\fontsize{12pt}{13.8pt}\selectfont\color{GrayForReferences} #1\par}% + \vspace*{-0.5\baselineskip}}% +\else + \PackageInfo{dhbenelux}{You deactivated biblatex. Please provide your\MessageBreak own bibliography or use BiBTeX instead.} + \newcommand*{\addbibresource}{\PackageError{dhbenelux}{You can not use \string\addbibresource, because\MessageBreak you deactivated biblatex.}{Please remove the option ``nobiblatex'' from the \string\usepackage\space call}} + \newcommand*{\addbibresource}{\PackageError{dhbenelux}{You can not use \string\printbibliography, because\MessageBreak you deactivated biblatex.}{Please remove the option ``nobiblatex'' from the \string\usepackage\space call}} + \RequirePackage{url} +\fi% \urlstyle{same} \usepackage{multicol}