I want to print my own publications and show that I am an author by highlighting my own name. As some of the publications have over 100 authors I do not want to print all of them (would be ok with some publications with 5-10 authors, but a whole page of names looks ugly). In general I found a solution but there is currently a space that I would love to get rid off if I skip some names (currently: "First Author , ..., I. Me, et al."; should be: "First Author, ..., I. Me, et al.").
There are some additional things that could be improved but they are not that important for me (1. Is my name currently highlighted also in the normal bibliography and not only in my fullciteNEW command; 2. currently several fields like volume, doi etc. are included in a static fashion; 3. if the number of authors is below 10 it would be fine if all of them are presented.)
Here is current code to represent the status:
%----------------------------------------------------------------------------------------
% An example bib file
%----------------------------------------------------------------------------------------
\begin{filecontents}{test.bib}
@article{Source1,
author = {Me, Its and Author, another and Else, Someone},
journal = {The journal},
title = {{A fancy title}},
issn = {12345},
year = {2019},
pages = {1-2},
volume = {49},
number = {2},
doi = {TheDoiIsHelpful},
}
@article{Source2,
author = {Author, First and Me, I. and Author, Third and Author, Fourth},
title = {{This is my sedondauthorship}},
journal = {The real journal},
issn = {12345},
year = {2022},
pages = {1-2},
volume = {49},
number = {2},
doi = {TheDoiIsHelpful}
}
@article{Source3,
author = {Author, First and Author, Second and Me, I. and Author, Third and Author, Fourth},
title = {{This is another paper}},
journal = {The real journal},
issn = {12345},
year = {2022},
pages = {1-2},
volume = {49},
number = {2},
doi = {TheDoiIsHelpful}
}
@article{Source5,
author = {Author, First and Author, Second and Author, Third and Author, Fourth and Me, I.},
title = {{This is my last authorship}},
journal = {The real journal},
issn = {12345},
year = {2022},
pages = {1-2},
volume = {49},
doi = {TheDoiIsHelpful},
}
\end{filecontents}
% END bib file
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass{scrreprt}
\usepackage{csquotes}
\PassOptionsToPackage{%
language=auto,%
style=numeric-comp,%
sorting=nyt, % name, year, title
maxbibnames=10, % default: 3, et al.
minbibnames=5,%\minnames, %names before et. al
natbib=true % natbib compatibility mode (\citep and \citet still work)
}{biblatex}
\usepackage{biblatex}
%----------------------------------------------------------------------------------------
% HIGHLIGHTED SELF CITATIONS
%----------------------------------------------------------------------------------------
%\usepackage{biblatex}
\usepackage{xpatch}% or use http://tex.stackexchange.com/a/40705
\makeatletter
\newbibmacro{name:bold}[2]{%
\edef\blx@tmp@name{\expandonce#1, \expandonce#2}%
\def\do##1{\ifdefstring{\blx@tmp@name}{##1}{\large\scshape\listbreak}}%bfseries
\dolistloop{\boldnames}}
\newcommand{\boldnames}{}
\makeatother
\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\normalsize}{}{}
\xapptobibmacro{name:family}{\endgroup}{}{}
\xapptobibmacro{name:given-family}{\endgroup}{}{}
\xapptobibmacro{name:family-given}{\endgroup}{}{}
\xapptobibmacro{name:delim}{\endgroup}{}{}
\makeatletter
\DeclareNameFormat{given-family:noetal}{
\ifgiveninits
{\usebibmacro{name:given-family}
{\namepartfamily}
{\namepartgiveni}
{\namepartprefix}
{\namepartsuffix}}
{\usebibmacro{name:given-family}
{\namepartfamily}
{\namepartgiven}
{\namepartprefix}
{\namepartsuffix}}
,
}
\usepackage{ifthen}
\DeclareCiteCommand*{\fullciteNEW}
{\defcounter{maxnames}{10}%
}
{
{}
{}
\ifthenelse{\equal{\thefield{postnote}}{1}}{\printnames[given-family][1-1]{author}}{
\ifthenelse{\equal{\thefield{postnote}}{2}}{\printnames[given-family][1-2]{author}}{
\printnames[given-family:noetal][1-1]{author}
..., \printnames[given-family][\thefield{postnote}-\thefield{postnote}]{author}
}
}
\printfield{title}\printtext{ In:}
\printfield{journaltitle}
\printfield{volume}.\printfield{number}
(\printfield{year}),
\printfield{pages}.
\printfield{issn}.
\printfield{doi}}
{\multicitedelim}
{}
\addbibresource{test.bib} % The file housing your bibliography
\forcsvlist{\listadd\boldnames}
{{Me, Its}, {Me, I.}}
\begin{document}
\noindent\fullciteNEW[1]{Source1}\
\noindent\fullciteNEW[2]{Source2}\
\noindent\fullciteNEW[3]{Source3}\
\noindent\fullciteNEW[5]{Source5}\
\end{document}
(sorry that the minimal example is not optimal it is my first try)
Thanks a lot for your hint!
– Mareike Sep 30 '22 at 07:43