How to print only editor and title of parent entry in a child entry in the bibliography
To print the names you need \printnames{labelname}
.
If you want labelname
to print full names, then you need \DeclareNameAlias{labelname}{given-family}
.
To get (ed./eds.) after labelname
, add \setunit*{\addspace}\printtext[parens]{editorstrg}
.
To get (ed./eds.) after the main editor in entry proc
, you need to patch the bbx:editor
macro using xpatch
, like this:
\xpatchbibmacro{bbx:editor}
{\usebibmacro{#1}}
{\setunit{\addspace}\printtext[parens]{\usebibmacro{#1}}}
{}{}
To get the the labeltitle
in italics you can use \printfield[title]{labeltitle}
since the default format for title is italics.
So your crossref:label
macro becomes:
\newbibmacro{crossref:label}{%
\entrydata{\strfield{crossref}}
{\DeclareNameAlias{labelname}{given-family}%
\printnames{labelname}%
\setunit*{\addspace}%
\printtext[parens]{\usebibmacro{editorstrg}}%
\setunit*{\addcomma\space}%
\printfield[title]{labeltitle}}}
Note: This is very specific to your question. More customisation is needed to handle cases when labelname does not refer to an editor (e.g., translator).
Here's the full MWE and output:
\documentclass[]{scrartcl}
\usepackage{xpatch}
\usepackage[backend=biber,style=authortitle-icomp]{biblatex}
\usepackage{filecontents}
\begin{filecontents}{my.bib}
@incollection{inproc1,
Author = {Test Author},
Crossref = {proc},
Pages = {1--10},
Title = {Testing the Title}}
@incollection{inproc2,
Author = {Test Author},
Crossref = {proc},
Pages = {10--20},
Title = {Testing the second Title}}
@collection{proc,
Editor = {Senor Editor and Senora Editora},
Publisher = {Any Publisher},
Title = {My Proceedings},
Year = {2013}}
@inproceedings{inproc3,
Author = {Nother Author},
Publisher = {Nother Publisher},
Title = {In Some Other Proceedings},
Maintitle = {Main Title of Other Proceedings},
Year = {2001},
}
\end{filecontents}
\xpatchbibmacro{bbx:editor}
{\usebibmacro{#1}}
{\setunit{\addspace}\printtext[parens]{\usebibmacro{#1}}}
{}{}
\DeclareBibliographyDriver{incollection}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author/translator+others}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{title}%
\newunit
\printlist{language}%
\newunit\newblock
\usebibmacro{byauthor}%
\newunit\newblock
\usebibmacro{in:}%
\iffieldundef{crossref}
{\usebibmacro{crossref:full}}
{\usebibmacro{crossref:label}}
\newunit\newblock
\usebibmacro{chapter+pages}%
\iffieldundef{crossref}
{\usebibmacro{crossref:extrainfo}}
{}
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\usebibmacro{finentry}}
\newbibmacro{crossref:full}{%
\usebibmacro{maintitle+booktitle}%
\newunit\newblock
\usebibmacro{event+venue+date}%
\newunit\newblock
\usebibmacro{byeditor+others}%
\newunit\newblock
\iffieldundef{maintitle}
{\printfield{volume}%
\printfield{part}}
{}%
\newunit
\printfield{volumes}%
\newunit\newblock
\usebibmacro{series+number}%
\newunit\newblock
\printfield{note}%
\newunit\newblock
\printlist{organization}%
\newunit
\usebibmacro{publisher+location+date}}
\newbibmacro{crossref:label}{%
\entrydata{\strfield{crossref}}
{\DeclareNameAlias{labelname}{given-family}%
\printnames{labelname}%
\setunit*{\addspace}%
\printtext[parens]{\usebibmacro{editorstrg}}%
\setunit*{\addcomma\space}%
\printfield[title]{labeltitle}}}
\newbibmacro{crossref:extrainfo}{%
\newunit\newblock
\iftoggle{bbx:isbn}
{\printfield{isbn}}
{}%
\newunit\newblock
\usebibmacro{doi+eprint+url}%
\newunit\newblock
\usebibmacro{addendum+pubstate}}
\addbibresource{my.bib}
\pagestyle{empty}
\begin{document}
Test \cite{inproc1} and \cite{inproc2} and \cite{inproc3}
\printbibliography
\end{document}