Edit: MWE added.
Edit2: Provided working intermediate MWE.
I am using moderncv with moderntimeline package.
I wanted to include a hack from https://tex.stackexchange.com/a/85981/6908 to display publications in the same format as the rest of the CV. This works nicely except that I want it work with the moderntimeline package.
However, I am unable to succeed. I think it has to do with an expansion problem.
This is the MWE.
\documentclass[11pt,a4paper,sans]{moderncv}
\usepackage[firstyear=1996,lastyear=2018]{moderntimeline}
\tlwidth{0.8ex}
\usepackage{xpatch}
\usepackage[url=false,backend=biber,
style=authoryear,
doi=false,
isbn=false,
backref=false,
sorting=ydnt]{biblatex}
%remove brackets from year
\xpatchbibmacro{date+extrayear}{%
\printtext[parens]}{\printtext}{}{}
% remove year from the author bibmacro
\xpatchbibmacro{author}{%
\usebibmacro{date+extrayear}}
{}{}{}
%change order and wrap into \cvline
\DeclareBibliographyDriver{article}{%
\cvline{\usebibmacro{date+extrayear}}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author/translator+others}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{title}%
\newunit
\printlist{language}%
\newunit\newblock
\usebibmacro{byauthor}%
\newunit\newblock
\usebibmacro{bytranslator+others}%
\newunit\newblock
\printfield{version}%
\newunit\newblock
\usebibmacro{in:}%
\usebibmacro{journal+issuetitle}%
\newunit
\usebibmacro{byeditor+others}%
\newunit
\usebibmacro{note+pages}%
\newunit\newblock
\iftoggle{bbx:isbn}
{\printfield{issn}}
{}%
\newunit\newblock
\usebibmacro{doi+eprint+url}%
\newunit\newblock
\usebibmacro{addendum+pubstate}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock
\usebibmacro{related}%
\usebibmacro{finentry}}%
}
\addbibresource{biblatex-examples.bib}
% personal data
\name{Joe}{Smith}
\moderncvstyle{classic}
\moderncvcolor{blue}
\begin{document}
\nocite{bertram}
\printbibliography[title={Publications}]
\end{document}
Changing the \cvline to \tldatelabelcventry from the moderntimeline package as follows
\documentclass[11pt,a4paper,sans]{moderncv}
\usepackage[firstyear=1996,lastyear=2018]{moderntimeline}
\tlwidth{0.8ex}
\usepackage{xpatch}
\usepackage[url=false,backend=biber,
style=authoryear,
doi=false,
isbn=false,
backref=false,
sorting=ydnt]{biblatex}
%remove brackets from year
\xpatchbibmacro{date+extrayear}{%
\printtext[parens]}{\printtext}{}{}
% remove year from the author bibmacro
\xpatchbibmacro{author}{%
\usebibmacro{date+extrayear}}
{}{}{}
%change order and wrap into \cvline
\DeclareBibliographyDriver{article}{%
\tldatelabelcventry{
2006 % actual year from bibitem
}{
2006 % Label of year (should be the same)
}{
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author/translator+others}}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
%\usebibmacro{author/translator+others}
%
\setunit{\labelnamepunct}\newblock
\usebibmacro{title}%
\newunit
\printlist{language}%
\newunit\newblock
\usebibmacro{byauthor}%
\newunit\newblock
\usebibmacro{bytranslator+others}%
\newunit\newblock
\printfield{version}%
\newunit\newblock
\usebibmacro{in:}%
\usebibmacro{journal+issuetitle}%
\newunit
\usebibmacro{byeditor+others}%
\newunit
\usebibmacro{note+pages}%
\newunit\newblock
\iftoggle{bbx:isbn}
{\printfield{issn}}
{}%
\newunit\newblock
\usebibmacro{addendum+pubstate}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock
\usebibmacro{related}%
\usebibmacro{finentry}}{}{}{}%
}
\addbibresource{biblatex-examples.bib}
% personal data
\name{Joe}{Smith}
\moderncvstyle{classic}
\moderncvcolor{blue}
\begin{document}
\nocite{bertram}
\printbibliography
\end{document}
yields the following result

which is great except that the year is hardcoded.
What do I need to change to make it work with the actual year of the bibitem?
I tried using \usebibmacro{date+extrayear} with no succees.


\documentclassand the appropriate packages so that those trying to help don't have to recreate it. – Peter Grill May 23 '14 at 20:56\protect, but without a MWE I can't test it. – Peter Grill May 23 '14 at 20:57Undefined control sequence. <argument> \@firstname {}~\@lastname {}. – Peter Grill May 23 '14 at 21:15\cvlineto\tldatelabelcventry. Perhaps you just need to delete the.auxfiles from a previous run. – Peter Grill May 23 '14 at 21:43\cvline{\usebibmacro{date+extrayear}}{%by\tldatelabelcventry{2006}{%then I get errors and no dvi file. – Stephan Lehmke May 24 '14 at 21:24\tldatelabelcventryonly the years are hardcoded. – Trefex May 25 '14 at 08:51\usebibmacro{date+extrayear}sounds like it would produce a formatted date. – Stephan Lehmke May 25 '14 at 09:32