0

Following this question I made the other day, I finally came up with a MWE that does 95% of what I need, but I still have 2 minor problems with it:

(1) - I want to change the color of the last period inserted automatically at the end of each Miscellanea entry. See I printed that last part in red, but the period still appears in black (text color).

(2) - The day sorting does not seem to work for some reason, I don't know if I'm doing something wrong... The TALK at "Research Center" was on the 25/09/2014, so should be listed ABOVE the TALK at "Yet Another Uni" on the 12/09/2014.

figure

Any clue?

This is the MWE:

\documentclass{article}

\usepackage{amssymb} \usepackage{lipsum}

%%%%%%%%%%
% Colors %
%%%%%%%%%%
\usepackage{xcolor}
\colorlet{textcolor}{black}

%%%%%%%%%
% Fonts %
%%%%%%%%%
\usepackage[quiet]{fontspec}
\defaultfontfeatures{Mapping=tex-text}
\setmainfont[Mapping=tex-text, Color=textcolor]{Arial}

\usepackage{fontawesome}
\newfontfamily{\FA}{FontAwesome}

%%%%%%%%%%%%
% Geometry %
%%%%%%%%%%%%
\setlength{\parindent}{0pt}% No paragraph indentation
\setlength{\parskip}{.5\baselineskip plus 0.1\baselineskip minus 0.1\baselineskip}
\usepackage[margin=2cm]{geometry}

%%%%%%%%%%%%%%%%
% Bibliography %
%%%%%%%%%%%%%%%%
\begin{filecontents}{\jobname.bib}
    @article{Doe2011,
        author = {Doe, John},
        journal = {Nucleic Acids Research},
        pages = {1--3},
        title = {{Title of paper}},
        volume = {39},
        year = {2011}
    }
    @article{Smith2013,
        author = {Smith, Josh},
        journal = {Nature},
        pages = {1--6},
        title = {{Overly complicated title}},
        volume = {85},
        year = {2013}
    }
    @article{Adams2016,
        author = {Adams, Brian},
        journal = {Science},
        pages = {10--15},
        title = {{Another absurd title}},
        volume = {2},
        year = {2016}
    }
    @phdthesis{Surname2012,
        author = {Surname, Name},
        location = {Some University},
        title = {{Some suitable thesis name}},
        type = {PhD Thesis},
        url = {http://thesis},
        year = {2012}
    }
    @misc{Willis2013,
        location = {Some Uni},
        note = {Work In Progress report},
        author = {Willis, William},
        title = {{This is the same title always}},
        type = {TALK},
        month = {07},
        year = {2013}
    }
    @misc{Willis2014,
        location = {Another Uni},
        note = {Poster Symposium},
        author = {Willis, William},
        title = {{This is the same title always}},
        type = {POSTER},
        month = {03},
        year = {2014}
    }
    @misc{Willis2014b,
        location = {Yet Another Uni},
        author = {Willis, William},
        title = {{This is the same title always}},
        type = {TALK},
        day = {12}, %I include the day in entries in the same month and year
        month = {09},
        year = {2014}
    }
    @misc{Willis2014c,
        location = {Research Center},
        author = {Willis, William},
        title = {{This is the same title always}},
        type = {TALK},
        day = {25}, %I include the day in entries in the same month and year
        month = {09},
        year = {2014}
    }
    @misc{Willis2016,
        location = {Another Research Center},
        author = {Willis, William},
        title = {{New title}},
        type = {TALK},
        month = {09},
        year = {2016}
    }
\end{filecontents}




\usepackage[style=verbose, defernumbers=true, sorting=ymdnt, backend=biber, dateabbrev=true, maxbibnames=7, minbibnames=7]{biblatex}%

\addbibresource{\jobname.bib}

\DeclareNameAlias{author}{first-last}

%%SORTING

\DeclareSortingScheme{ymdnt}{
    \sort{
        \field{presort}
    }
    \sort[final]{
        \field{sortkey}
    }
    \sort[direction=descending]{
        \field[strside=left,strwidth=4]{sortyear}
        \field[strside=left,strwidth=4]{year}
        \literal{9999}
    }
    \sort[direction=descending]{
        \field[padside=left,padwidth=2,padchar=0]{month}
        \literal{00}
    }
    \sort[direction=descending]{
        \field[padside=left,padwidth=2,padchar=0]{day}
        \literal{00}
    }
    \sort{
        \name{sortname}
        \name{author}
        \name{editor}
        \name{translator}
        \field{sorttitle}
        \field{title}
    }
    \sort{
        \field{sorttitle}
        \field{title}
    }
}

%%ARTICLE

\DeclareFieldFormat[article]{title}{#1\par}

\DeclareBibliographyDriver{article}{%
    \printfield{title}%
    \par\vspace{0.1\baselineskip}%
    \newblock%
    \printnames{author}%
    \par\vspace{0.1\baselineskip}%
    \newblock%
    {%
        \small \addfontfeature{Color=lightgray} \itshape%
        \usebibmacro{journal+issuetitle}%
        \setunit{\space}%
        \printfield{pages}%
        \newunit%
        \printfield{url}%
    }
    \par\vspace{0.1\baselineskip}%
}

%%THESIS

\DeclareFieldFormat[thesis]{title}{#1\par}

\DeclareBibliographyDriver{thesis}{%
    \printfield{title}%
    \par\vspace{0.1\baselineskip}%
    \newblock%
    \printnames{author}%
    \par\vspace{0.1\baselineskip}%
    \newblock%
    {%
        \small \addfontfeature{Color=lightgray} \itshape%
        \printfield{type}%
        \setunit{\addperiod\space}%
        \usebibmacro{institution+location+date}%
        \setunit{\addperiod\space}%
        \printfield{pages}%
        \newunit%
        \printfield{url}%
    }
    \par\vspace{0.1\baselineskip}
}

%%MISCELLANEA

\DeclareFieldFormat[misc]{title}{#1\\}

\newbibmacro*{bib:svtitle}{%
    \savefield{title}{\lasttitle}}

\newbibmacro*{bib:svauthor}{%
    \savename{author}{\lastauthor}}

\newbibmacro*{verifytitle}{%
    \iffieldequals{title}{\lasttitle}{\hspace{\bibhang}}{%
        \printfield{title}%
        \undef\lastauthor}%
    \usebibmacro{bib:svtitle}%
}

\renewbibmacro*{finentry}{\adddot\finentry}

\newbibmacro*{verifyauthor}{%
    \ifnameequals{author}{\lastauthor}
    {}
    {\printnames{author}\\}%
    \usebibmacro{bib:svauthor}}

\newbibmacro*{newtitle}{%
    \usebibmacro{verifytitle}}

\newbibmacro*{newauthor}{%
    \usebibmacro{verifyauthor}}

\DeclareBibliographyDriver{misc}{%
    \usebibmacro{newtitle}%
    \usebibmacro{newauthor}%
    {%
        \scriptsize \textcolor{red}{\faCaretRight}%
    }
    {%
        \footnotesize \addfontfeature{Color=red} \itshape%
        \hspace{5px}%
        \printfield{type} (\printfield{month} \printfield{year})%
        \setunit{\addperiod\space}%
        \printfield{note}%
        \setunit*{\addcomma\space}%
        \printlist{location}%
    }
    \usebibmacro{finentry}%
}

\newcommand{\printbibsection}[1]{
    \begin{refsection}
        \nocite{*}
        \printbibliography[type={#1}, heading=none]
    \end{refsection}
}





\begin{document}

    \lipsum[1]

    \medskip

    \section{Articles}
    \printbibsection{article}

    \section{Thesis}
    \printbibsection{thesis}

    \section{Miscellanea}
    \printbibsection{misc}

\end{document} 
  • 1
    The dot is black because \usebibmacro{finenty} is outside the group. There is no day field, use date={2014-09-25} in your bib. – Ulrike Fischer Dec 7 '16 at 9:43
  • Damn both things so easy! Many thanks @Ulrike – DaniCee Dec 7 '16 at 10:04
  • For futire reference it might be good to keep in mind that it is generally preferred to ask only one question per question. Your two questions here seem only tangentially related and so it is better to separate them into two different questions, both for those trying to answer your questions as well as for those who might have similar problems. – moewe Dec 7 '16 at 14:54
  • Alright thanks @moewe, will keep that in mind! – DaniCee Dec 8 '16 at 1:23
3

The dot is black because \usebibmacro{finenty} (which prints the final dot) is outside the group which changes the color.

There is no day field, use date={2014-09-25} in your bib. You can also set the year with date={2014} and the month with date={2014-09}.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.