jspitz / biblatex-publist

BibLaTeX bibliography support for publication lists
40 stars 4 forks source link

How to put `marginyear` outside the margin? #20

Closed xu-cheng closed 5 years ago

xu-cheng commented 5 years ago

I like the idea to print the publication year on the left of the publication list once a new year starts. However, is it possible to put it outside the margin? That is increasing the left margin of the publication list and making the printed year align with the start of the paragraph.

xu-cheng commented 5 years ago

To illustrate, the current behaviour looks like this:

       [text]

[year] [pub1]
       [pub2]
[year] [pub3]
       [pub4]

       [text]

And I am wonder how to achieve the following style:

       [text]

       [year] [pub1]
              [pub2]
       [year] [pub3]
              [pub4]

       [text]
jspitz commented 5 years ago

It is possible with some redefinitions:

\renewbibmacro*{date}{}
\renewbibmacro*{date+extradate}{}
\renewbibmacro*{issue+date}{}
\renewbibmacro*{bpl:year+labelyear}{\nopunct\ignorespaces}
\newcommand*{\bibyear}{}

\defbibenvironment{bibliography}
{\list
    {\iffieldequals{year}{\bibyear}
        {}
        {\printfield{year}%
         \savefield{year}{\bibyear}}}
    {\setlength{\topsep}{0pt}%
     \setlength{\itemsep}{\bibitemsep}%
     \leftmargin\labelwidth%
     \advance\leftmargin\labelsep}}
{\endlist}
{\item}
xu-cheng commented 5 years ago

Thanks for the solution. It works great.