hoelzer / dfg

A LaTeX template for a basic DFG (Deutsche Forschungsgemeinschaft, German Research Foundation) grant proposal.
GNU General Public License v3.0
73 stars 45 forks source link

Highlighting the author's publications in section 4 #47

Closed nise closed 6 months ago

nise commented 1 year ago

In the current template DFG states in the section "Project- and subject-related list of publications" to highlight the author's publications. Also highlighting is not a must the DFG strongly recommends doing so. Here is a short solution that can be added to the Header.tex:

%% Highlight entries
\usepackage[svgnames]{xcolor}
\DeclareBibliographyCategory{important}
\colorlet{impentry}{Maroon}% let 'impentry' = Maroon
\AtEveryBibitem{%
  \ifcategory{important}%
    {\bfseries\color{impentry}}%
    {}%
  }
\addtocategory{important}{%
Smith2023a,Smith2023b,Smith2023c,Smith2023d,MIller1900, % don't miss the comma after the last entry
}
ThiloKr commented 1 year ago

If you also want to highlight the citation keys in the text and the URLs/DOIs, you can use the following:

\AtEveryBibitem{%
  \ifcategory{important}%
    {\hypersetup{urlcolor=impentry}\bfseries\color{impentry}}%
    {}%
  }
\AtEveryCitekey{%
  \ifcategory{important}%
    {\hypersetup{citecolor=impentry}\bfseries\color{impentry}}%
    {}%
  }
ThiloKr commented 1 year ago

To also colorize the labels in the bibliography:

\AtBeginBibliography{%
  \DeclareFieldFormat{labelnumberwidth}{%
  \ifcategory{important}%
    {\color{impentry}\mkbibbrackets{#1}}%
    {\mkbibbrackets{#1}}%
  }}
hoelzer commented 6 months ago

Thanks for the suggestions and PRs! That's awesome and sorry coming back to that so late @ThiloKr @nise

I am merging that now. And I also tried @ThiloKr last suggestion but added a \bfseries to make the labels in the bibliography also bold:

https://github.com/hoelzer/dfg/blob/master/proposal.sty#L91