Skip to content

Commit 6175bbe

Browse files
authored
Merge pull request #26 from hoelzer/section-references
Section references
2 parents 8c0e666 + 522077f commit 6175bbe

File tree

3 files changed

+65
-8
lines changed

3 files changed

+65
-8
lines changed

README.md

+20-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ Thanks to [@dl1chb](https://github.com/dl1chb) for better ToDo handling via the
1414

1515
Thanks to [@mank4](https://github.com/mank4) for the iplementation of a gantt chart and better handling of subsections for work packages.
1616

17+
Thanks to [@klb2](https://github.com/klb2/dfg-proposal-template) for the implementation of consecutive section numbers for 1.2.1 and 1.2.2.
18+
1719
_Please let me know if I accidentally forgot a contribution!_
1820

1921
## Compilation
@@ -36,14 +38,29 @@ make filename=dfg-german
3638
```
3739

3840
### Biber
39-
4041
If you do not have ``biber`` installed try to install it from the package sources of your system. There is also a ``conda`` install that you can try:
4142

4243
```bash
4344
conda create -n biber -c malramsay biber
4445
conda activate biber
4546
```
4647

48+
### Docker
49+
You can also use a Docker container that comes with all dependencies (pdflatex, biber, ...) to compile the template. Thus, no installation of LaTeX, Biber, etc... is needed on your local system.
50+
51+
```bash
52+
DOCKER='nanozoo/pdflatex:3.14159265--6263fbd'
53+
docker pull $DOCKER
54+
55+
# using the Makefile
56+
docker run --rm -v $PWD:$PWD -w $PWD $DOCKER make
57+
58+
# using pdflatex, biber, ...
59+
docker run --rm -v $PWD:$PWD -w $PWD $DOCKER pdflatex dfg.tex
60+
docker run --rm -v $PWD:$PWD -w $PWD $DOCKER biber dfg
61+
...
62+
```
63+
4764
## ToDo-Notes, reference labels and draft mode
4865
By default, ToDos and labels are activated (see below) which is considered the _draft_ mode of the template. To turn both of them off (e.g. for the final version) just change `\setboolean{finalcompile}{false}` in dfg.tex to `\setboolean{finalcompile}{true}`.
4966

@@ -70,6 +87,8 @@ that can be later used in the sections:
7087
\printbibliography[category=reviewed, heading=none]
7188
```
7289

90+
Recently, the DFG changed their template to have references in the sections 1.2.1 and 1.2.2 sorted consecutively. For other references in the bibliography, it seems that one can arrange them alphabetically. This was solved by [@klb2](https://github.com/klb2/dfg-proposal-template) and changes were also included in this repo (thx!). The current default is numeric labels while first the references in sections 1.2.1 and 1.2.2 are numbered followed by all other references in the order how they appear in the text. Changes can be done via the `proposal.sty` file.
91+
7392
### Bib Style
7493

7594
To change the style of your bibliography you have to change the following code snippet in the ``proposal.sty`` file:

dfg.tex

+4-3
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,10 @@ \subsection{Project-related publications}
9191

9292
%a maximum of ten publications
9393
\subsubsection{Articles published by outlets with scientific quality assurance, book publications, and works accepted for publication but not yet published}
94-
\printbibliography[category=reviewed, heading=none]
94+
\printbibliography[category=reviewed, heading=none, env=bibliographyNUM, resetnumbers]
9595

9696
\subsubsection{Other publications, both peer-reviewed and non-peer-reviewed}
97-
\printbibliography[category=nonreviewed, heading=none]
97+
\printbibliography[category=nonreviewed, heading=none, env=bibliographyNUM]
9898

9999
\subsubsection{Patents}
100100

@@ -173,7 +173,8 @@ \subsection{Work programme including proposed research methods}
173173
\section{Bibliography concerning the state of the art, the research objectives, and the work programme}
174174
\label{sec:bib}
175175
%\AtNextBibliography{\small}
176-
\printbibliography[notcategory=reviewed, notcategory=nonreviewed, notcategory=patents_pending, notcategory=patents, heading=none]
176+
\newrefcontext
177+
\printbibliography[notcategory=reviewed, notcategory=nonreviewed, notcategory=patents_pending, notcategory=patents, heading=none, env=bibliographyNUM]
177178

178179
\section{Relevance of sex, gender and/or diversity}
179180
\todo[inline]{Text}

proposal.sty

+41-4
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,53 @@
2323
\pgfplotsset{compat=newest}
2424

2525
\usepackage[backend = biber,
26-
style = alphabetic,%numeric
26+
style = numeric, %alphabetic, numeric
2727
firstinits = true,
2828
natbib = true,
29+
url=false,
30+
doi=true,
31+
eprint=true,
32+
isbn=false,
33+
defernumbers=true,
34+
labelnumber,
2935
hyperref = true,
30-
maxbibnames = 10%,
31-
%sorting=none,%remove this to have things sorted, e.g. use style=alphabetic
36+
maxbibnames = 10,
37+
sorting=none,%remove this to have things sorted, e.g. use style=alphabetic
3238
]{biblatex}
3339
\renewcommand*{\labelalphaothers}{}
3440

41+
% bibliography (from dfgproposal.cls from https://github.com/klb2/dfg-proposal-template)
42+
\DeclareFieldFormat{labelnumberwidth}{\mkbibbrackets{#1}}
43+
\renewbibmacro*{cite}{%
44+
\printtext[bibhyperref]{%
45+
\printfield{labelprefix}%
46+
\ifcategory{reviewed}
47+
{\printfield{labelnumber}}
48+
{%
49+
\ifcategory{nonreviewed}
50+
{\printfield{labelnumber}}
51+
{%
52+
\printfield{labelnumber}%
53+
\printfield{extraalpha}}}}}
54+
% Here I changed the labelalpha to labelnumber which is generally preferrable I think... who wants this ugly abbreviations of author names and year of publication
55+
%\printfield{labelalpha}%
56+
%\printfield{extraalpha}}}}}
57+
58+
\defbibenvironment{bibliographyNUM}
59+
{\list
60+
{\printtext[labelnumberwidth]{%
61+
\printfield{labelprefix}%
62+
\printfield{labelnumber}}}
63+
{\setlength{\labelwidth}{\labelnumberwidth}%
64+
\setlength{\leftmargin}{\labelwidth}%
65+
\setlength{\labelsep}{\biblabelsep}%
66+
\addtolength{\leftmargin}{\labelsep}%
67+
\setlength{\itemsep}{\bibitemsep}%
68+
\setlength{\parsep}{\bibparsep}}%
69+
\renewcommand*{\makelabel}[1]{\hss##1}}
70+
{\endlist}
71+
{\item}
72+
3573
%% von Hurenkindern und Schusterjungen
3674
\clubpenalty = 10000
3775
\widowpenalty = 10000 \displaywidowpenalty = 10000
@@ -93,6 +131,5 @@
93131
\newcommand{\positionmul}[3]{\par #1 \hfill \num{#3} $\times$ \num[round-mode = places, round-precision = 2]{#2}\,\euro \FPeval{\funds}{\funds + #3*#2}}
94132

95133
% todonotes and a switch for final
96-
97134
\usepackage{ifthen}
98135
\newboolean{finalcompile}

0 commit comments

Comments
 (0)