I would like to add a list of publications to a thesis ordered by the publication date and numbered 1,2,3. Additionally the author of the thesis should be highlighted bold in this list.
The approach I tried is to use a refsection with a modified \defbibenvironment{bibliography}
and \ExecuteBibliographyOptions{labelnumber}
. This works in principle, but the numbering is according to the bibliography (what I do not want) and not the list index. The numbering can be independent by using the option defernumbers
but then the number never starts at one. In this example it would be 4,5,6.
A minor error is that each list start with a space instead of the authors name.
The normal bibliography is with a different style (alphabetic) and must remain unchanged.
If the numbered refsection with numbers according to the list index is not possible the second qustion would still be open. I want the thesis writers name in the list of publications to be highlighted (bold). In this case I have no idea how to achieve that.
This image shows how the numbering is wrong:
This is an example one can work on:
\documentclass{article}
\usepackage{filecontents}
\usepackage[
style=alphabetic, % Loads the bibliography and the citation style
%style=numeric,
]{biblatex}
\ExecuteBibliographyOptions{%
sorting=nty, % Sort by name, title, year.
maxbibnames=15,%
%defernumbers,
}%
\addbibresource{publications.bib}
\ExecuteBibliographyOptions{labelnumber}
\begin{document}
\begin{filecontents*}{publications.bib}
@Article{Pospiech2010,
Title = {Single-sweep laser writing of 3D-waveguide devices},
Author = {Matthias Pospiech and Moritz Emons and Benjamin V\"{a}ckenstedt and Guido Palmer and Uwe Morgner},
Journal = {Opt. Express},
Year = {2010},
Number = {7},
Pages = {6994--7001},
Volume = {18},
}
@Article{Pospiech2009,
Title = {Double waveguide couplers produced by simultaneous femtosecond writing},
Author = {Matthias Pospiech and Moritz Emons and Andy Steinmann and Guido Palmer and Roberto Osellame and Nicola Bellini and Giulio Cerullo and Uwe Morgner},
Journal = {Opt. Express},
Year = {2009},
Number = {5},
Pages = {3555--3563},
Volume = {17},
}
@Article{Siegel2007,
Title = {Theoretical and experimental limits of cavity-dumping in passively mode-locked thin-disk oscillators},
Author = {Martin Siegel and Guido Palmer and Andy Steinmann and Matthias Pospiech and Uwe Morgner},
Journal = {Opt. Express},
Year = {2007},
Month = {Dec},
Number = {25},
Pages = {16860--16869},
Volume = {15},
}
\end{filecontents*}
\newcommand{\numberedreferences}{%
\defbibenvironment{bibliography}
{\list
{\printtext[labelnumberwidth]{%
\printfield{prefixnumber}%
\printfield{labelnumber}.%
}%
}%
{\setlength{\labelwidth}{\labelnumberwidth}%
\setlength{\leftmargin}{\labelwidth}%
\setlength{\labelsep}{\biblabelsep}%
\addtolength{\labelsep}{1em}
\addtolength{\leftmargin}{\labelsep}%
\setlength{\itemsep}{\bibitemsep}%
\setlength{\parsep}{\bibparsep}}%
% fails to compile if included
%\renewcommand*{\makelabel}[1]{\hss##1}
}
{\endlist}
{\item}
}%
\section*{Scientific publications}
\begin{refsection}[publications]%
\numberedreferences
\nocite{*}
% supposed to be numbered and with author highlighted (bold)
\printbibliography[heading=none, sorting=ynt]
\end{refsection}
% standard style
\nocite{*}
\printbibliography
\end{document}
EDIT: This code show how the code from the examples below fails if parts are wrapped in a conditional:
\documentclass{article}
\usepackage{filecontents}
\usepackage{ltxcmds}
\makeatletter
\newcommand{\IfPackageLoaded}[2]{\ltx@ifpackageloaded{#1}{#2}{}}
\makeatother
\usepackage{biblatex}
\usepackage{xpatch}
\IfPackageLoaded{biblatex}{%
% \boldnames: etoolbox-list of names to typeset bold in \printbibiliography
\newcommand*{\boldnames}{}
\newbibmacro*{name:bold}[2]{%
\def\do##1{\ifstrequal{#1, #2}{##1}{\bfseries\listbreak}{}}%
\dolistloop{\boldnames}}
\xpretobibmacro{name:last-first}{\begingroup\usebibmacro{name:bold}{#1}{#2}}{}{}
\xapptobibmacro{name:last-first}{\endgroup}{}{}
%
\DeclareNameAlias{default}{last-first/first-last}
}% \IfPackageLoaded{biblatex}
\addbibresource{publications.bib}
\begin{document}
\begin{filecontents*}{publications.bib}
@Article{Pospiech2010,
Title = {Single-sweep laser writing of 3D-waveguide devices},
Author = {Matthias Pospiech and Moritz Emons and Benjamin V\"{a}ckenstedt and Guido Palmer and Uwe Morgner},
Journal = {Opt. Express},
Year = {2010},
Number = {7},
Pages = {6994--7001},
Volume = {18},
}
\end{filecontents*}
\begin{refsection}%
\nocite{*}
\printbibliography[heading=none, sorting=ynt, resetnumbers=true] %env=numbered+bold,
\end{refsection}
\end{document}
The error is
! Undefined control sequence.
<argument> \blx@do
{Pospiech2009}\blx@listloop@i