8

I'm using biblatex with biber already, so this should be possible. What I'm trying to get is:

  • A full bibliography (superscript number style, numbered in order of appearance, nice and easy)

    and

  • A list of my publications etc. These may or may not appear in the bibliography. I use a refsection environment for this.

The MWE below does this, but the list of publications should be in date order without affecting the sort order of the main bibliography. How do I do specify a sort order just for a refsection?

\documentclass{article}
\usepackage[
    sorting=none,
    firstinits=true,
    maxbibnames=100,
    style=numeric-comp,
    sortcites=true,
    backend=biber,
    defernumbers=true,
    natbib
]{biblatex}
\begin{filecontents}{\jobname.bib}
@misc{me_poster,
    title="a poster",
    author="Me",
    keywords="me",
    year=2013
}
@article{me_article,
    title="a journal article",
    author="Me",
    journal="journal of stuff",
    year="2012",
    keywords="me"
}
@article{AuthorA_article,
    title="An Article",
    journal ="journal of applied stuff",
    author="Author, A",
    year="1999"
}
@book{AuthorB_book,
    title="A book",
    author="Author, B",
    year="1666"
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
    \section{Body}
        Some people said some stuff.\supercite{AuthorA_article, AuthorB_book}
    \section{My publications}
        \begin{refsection}%
            \DeclareFieldFormat{labelnumberwidth}{#1}%
            \nocite{*}%
            \printbibliography[omitnumbers=true,keyword=me,title={Publications and presentations},heading=bibintoc]%
        \end{refsection}%
    \printbibliography
\end{document}

output of above code

5

You can simply load biblatex without the sorting option and use that option when issuing \printbibliography commands.

So, for the full bibliography, you will use

\printbibliography[sorting=none]

while for the list of publications

\printbibliography[sorting=ynt,omitnumbers=true,keyword=me,title={Publications and presentations},heading=bibintoc]

MWE:

\documentclass{article}
\usepackage[
    firstinits=true,
    maxbibnames=100,
    style=numeric-comp,
    sortcites=true,
    backend=biber,
    defernumbers=true,
    natbib
]{biblatex}
\begin{filecontents}{\jobname.bib}
@misc{me_poster,
    title="a poster",
    author="Me",
    keywords="me",
    year=2013
}
@article{me_article,
    title="a journal article",
    author="Me",
    journal="journal of stuff",
    year="2012",
    keywords="me"
}
@article{AuthorA_article,
    title="An Article",
    journal ="journal of applied stuff",
    author="Author, A",
    year="1999"
}
@book{AuthorB_book,
    title="A book",
    author="Author, B",
    year="1666"
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
    \section{Body}
        Some people said some stuff.\supercite{AuthorA_article, AuthorB_book}
    \section{My publications}
        \begin{refsection}%
            \DeclareFieldFormat{labelnumberwidth}{#1}%
            \nocite{*}%
            \printbibliography[sorting=ynt,omitnumbers=true,keyword=me,title={Publications and presentations},heading=bibintoc]%
        \end{refsection}%
    \printbibliography[sorting=none]
\end{document} 

Output:

enter image description here

  • Running your code here, I get an error (undefined control sequence) on \supercite, only when sorting=none is removed from the preamble. If I leave sorting=none in the preamble I get numbers in both bibliographies: Can I check what versions you've got? I'm on biblatex 2.8a, biber 1.8. – Chris H May 22 '14 at 17:24
  • @ChrisH Delete the .bbl file. – karlkoeller May 22 '14 at 17:30
3

Consider this definition of a new sorting scheme ymdnt, which sorts by year,month,day,name,title. This implementation sorts ascending, but it is easy to make it descending if desired. The benefit comes in the proper sorting of items that use the month/day fields, which the standard nyt scheme does not consider.

I have also reworked some of your fixes to streamline them:

  • We cite everything, then track them as they are cited to put in the regular bibliography.
  • A new bibenvironment is used to remove the label (this will localize the change to the labelnumberwidth field format a bit nicer).

Code

\documentclass{article}
\usepackage[
    sorting=none,
    firstinits=true,
    maxbibnames=100,
    style=numeric-comp,
    sortcites=true,
    backend=biber,
    defernumbers=true,
    natbib
]{biblatex}
\begin{filecontents}{\jobname.bib}
@misc{me_poster,
    title="a poster",
    author="Me",
    keywords="me",
    year=2013
}
@article{me_article,
    title="a journal article",
    author="Me",
    journal="journal of stuff",
    year="2012",
    keywords="me"
}
@article{AuthorA_article,
    title="An Article",
    journal ="journal of applied stuff",
    author="Author, A",
    year="1999"
}
@book{AuthorB_book,
    title="A book",
    author="Author, B",
    year="1666"
}
\end{filecontents}
\addbibresource{\jobname.bib}
\nocite{*} % Cite everything; we'll track them explicitly

% Add cited entries to cited category
\DeclareBibliographyCategory{cited}
\AtEveryCitekey{\addtocategory{cited}{\thefield{entrykey}}}

% New bib environment: same as standard but with no numbers
\defbibenvironment{myrefs}
  {\DeclareFieldFormat{labelnumberwidth}{}\list{}{%
     \leftmargin\bibhang
     \itemindent-\leftmargin
     \itemsep\bibitemsep
     \parsep\bibparsep}}
  {\endlist}
  {\item}

% Sort by year in Self Publications
% Create new sort scheme that includes year and month
\DeclareSortingScheme{ymdnt}{
        \sort{                                                                                                                                                
                \field{presort}
        }
        \sort[final]{
                \field{sortkey}
        }
        \sort[direction=ascending]{ % Change if descending desired
                \field{sortyear}
                \field{year}
        }
        \sort[direction=ascending]{
                \field[padside=left,padwidth=2,padchar=0]{month}
                \literal{00}
        }
        \sort[direction=ascending]{
                \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}
        }
        \sort{
                \field[padside=left,padwidth=4,padchar=0]{volume}
                \literal{0000}
        }
}

\begin{document}
    \section{Body}
        Some people said some stuff.\supercite{AuthorA_article, AuthorB_book}
    \section{My publications}
            \printbibliography[omitnumbers=true,env=myrefs,keyword=me,title={Publications and presentations},heading=bibintoc,sorting=ymdnt]

    \printbibliography[category=cited]
\end{document}

Result

bibliography

  • I liked the simplicity of the other answer, but your new environment definitely improves that page. – Chris H May 22 '14 at 17:34

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.