Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A smart way to include the bibliography #61

Open
fzeiser opened this issue Aug 11, 2020 · 1 comment
Open

A smart way to include the bibliography #61

fzeiser opened this issue Aug 11, 2020 · 1 comment

Comments

@fzeiser
Copy link

fzeiser commented Aug 11, 2020

I spend some time to include a list of articles in a smart way. There are several solutions available, see eg. rgeirhos /
academic-cv-publications
and How to use BibTeX for putting a nice publication list in resume with document class (res.cls), but they did not fulfill my demands:

  • automatic formatting according to a provided style
  • read literature from bibtex file
  • highlighting (mentioning) some works, whilst the rest should be printed as a list (not repeating the works already highlighted)
  • visual highlight (here: bold -- maybe underscore would have been nicer) of my name in all publications

I hacked together a solution using biblatex. It's really not beautiful, but worked very well. Any better suggestions are of course welcome, but I thought I can share my insights.

It looks like this, where [1] to [6] are described in some more detail, and "minor contribution" is the full list of other works and continues for two more pages)

image

The bibtex setup I used:

\usepackage[backend=bibtex8,
		style=numeric,
		maxbibnames=99,
		maxcitenames=99,
    natbib=true,
    url=false,
    doi=true,
    eprint=true,
    sorting=ydnt,
    defernumbers=true
    ]{biblatex}
\urlstyle{same}
\addbibresource{publications.bib}

For highlighting (mentioning) some works, whilst the rest should be printed as a list (not repeating the works already highlighted)

% Biblatex: Print bibliography for custom enumeration (highlights + rest in list)
% Adapted from https://tex.stackexchange.com/questions/163774/biblatex-print-bibliography-for-a-single-entry-within-an-enumeration
\newcommand{\enumcite}[1]{%
  \addtocategory{enumpapers}{#1}%
  \defbibcheck{key#1}{
    \iffieldequalstr{entrykey}{#1}
      {}
      {\skipentry}}%
  \printbibliography[heading=none,check=key#1]%
}
\DeclareBibliographyCategory{enumpapers}

visual highlight (here: bold -- maybe underscore would have been nicer) of my name in all publications

%%%% bib: bold author %%%
% see https://tex.stackexchange.com/questions/73136/make-specific-author-bold-using-biblatex

\usepackage{xpatch}% or use http://tex.stackexchange.com/a/40705

\def\makenamesetup{%
  \def\bibnamedelima{~}%
  \def\bibnamedelimb{ }%
  \def\bibnamedelimc{ }%
  \def\bibnamedelimd{ }%
  \def\bibnamedelimi{ }%
  \def\bibinitperiod{.}%
  \def\bibinitdelim{~}%
  \def\bibinithyphendelim{.-}}
\newcommand*{\makename}[3]{\begingroup\makenamesetup\xdef#1{#2, #3}\endgroup}

\newbibmacro*{name:bold}[2]{%
  \makename{\currname}{#1}{#2}%
  \makename{\findname}{\lastname}{\firstname}%
  \makename{\findinit}{\lastname}{\firstinit}%
  \ifboolexpr{ test {\ifdefequal{\currname}{\findname}}
            or test {\ifdefequal{\currname}{\findinit}} }{\bfseries}{}}

\newcommand*{\boldname}[3]{%
  \def\lastname{#1}%
  \def\firstname{#2}%
  \def\firstinit{#3}}
\boldname{}{}{}

\xpretobibmacro{name:family}{\begingroup\usebibmacro{name:bold}{#1}{#2}}{}{}
\xpretobibmacro{name:given-family}{\begingroup\usebibmacro{name:bold}{#1}{#2}}{}{}
\xpretobibmacro{name:family-given}{\begingroup\usebibmacro{name:bold}{#1}{#2}}{}{}
\xpretobibmacro{name:delim}{\begingroup\normalfont}{}{}

\xapptobibmacro{name:family}{\endgroup}{}{}
\xapptobibmacro{name:given-family}{\endgroup}{}{}
\xapptobibmacro{name:family-given}{\endgroup}{}{}
\xapptobibmacro{name:delim}{\endgroup}{}{}


% \boldname{Author}{Zeiser}{F.}
\DeclareNameAlias{default}{family-given/given-family}
\boldname{Zeiser}{Fabio}{F.}
%%%%%%%%%%%%%%%%%%%%%%%%

and finally, in the document (simplified from my document):

Here is a first full citation of Zeiser2015 and Zeiser2020; they will not appear in the "full list"
\enumcite{Zeiser2015} 
\enumcite{Zeiser2020}

And all the other works: (not Zeiser2015 and Zeiser2020)
\nocite{*}
\printbibliography[heading=none, notcategory=enumpapers]
@fzeiser
Copy link
Author

fzeiser commented Aug 11, 2020

Btw: As the publication list spans over several pages, I use it in a tcolorbox environement

% for page breaks
\usepackage[skins,breakable]{tcolorbox}

and in the document:

\newpage
\begin{tcolorbox}[
  blanker,
  width=0.9\textwidth,
  before skip=6pt,
  breakable,]
[...]
Here is a first full citation of Zeiser2015 and Zeiser2020; they will not appear in the "full list"
\enumcite{Zeiser2015} 
\enumcite{Zeiser2020}

And all the other works: (not Zeiser2015 and Zeiser2020)
\nocite{*}
\printbibliography[heading=none, notcategory=enumpapers]
[...]
\end{tcolorbox}

which is a solution adapted from How to make minipage spanning multiple pages

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant