From 15a7e1ace39b8fdcd663385d25d0dd6f6e245948 Mon Sep 17 00:00:00 2001 From: adin Date: Sun, 9 Sep 2018 14:55:00 -0300 Subject: [PATCH] Update grant number list and authors on projects. This is a fix for #2. --- cv.bbx | 20 ++++++++++++++------ cv.dbx | 2 +- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/cv.bbx b/cv.bbx index 9d5ac1b..417ab19 100644 --- a/cv.bbx +++ b/cv.bbx @@ -71,9 +71,15 @@ \DeclareBibliographyDriver{project}{% \usebibmacro{bibindex}% \usebibmacro{begentry}% - \printmlfield{role}% - \newunit% - % \setunit*{\addperiod\space}% + \ifnameundef{author}% + % if no author is given, print only the role + {\printmlfield{role}\newunit}% + {% else, print the author and the role in parenthesis, if the latter exists + \usebibmacro{author} + \ifmlfieldundef{role}{}% + {\mkbibparens{\printmlfield{role}}}% + \newunit% + }% \printmlfield{title}% \newunit% \usebibmacro{funding-project}% @@ -133,13 +139,15 @@ \fi% } } + \DeclareListFormat[project]{number}{% \ifnumequal{\value{listcount}}{1}{% \ifnumgreater{\value{liststop}}{1}% - {Nos.}{No.}% - }{} + {\bibstring{grantnums}}{\bibstring{grantnum}}% + \addnbspace + }{}% \usebibmacro{list:delim}{#1}% - #1\isdot + #1\isdot% \usebibmacro{list:andothers}% } diff --git a/cv.dbx b/cv.dbx index e1f793e..3dda384 100644 --- a/cv.dbx +++ b/cv.dbx @@ -3,7 +3,7 @@ \DeclareLocalizedDatamodelFields[type=field, datatype=literal]{level, period, title, organization, country, description, funding, role, note} \DeclareDatamodelFields[type=list, datatype=literal]{ - number + number% } \DeclareDatamodelFields[type=field, datatype=datepart]{ -- 2.50.1