僅兩份傳記中的一份中的條目之前的標籤

僅兩份傳記中的一份中的條目之前的標籤

我在參考書目條目之前使用標籤,就像中給出的解決方案一樣biblatex 或 natbib 中的authordate2 等參考書目樣式?,這就像一個魅力。然而,我需要將標籤限制為參考書目的第一部分(第二部分專門用於沒有作者的線上資源),我根據 MWE 使用過濾器進行管理。我正在使用 biblatex、biber、APA 風格、義大利語。我在 Sharelatex.com 上進行編輯。

\documentclass{book}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}    
\usepackage[italian]{babel}
\usepackage[babel]{csquotes}
\usepackage[style=apa,backend=biber]{biblatex}         
\DeclareLanguageMapping{italian}{italian-apa}

%LABELS
\defbibenvironment{bibliography}
  {\list
     {
        \printtext[]{%
            \begingroup
            \defcounter{maxnames}{\value{mymaxcitenames}}%
            \printnames{labelname}%
            \setunit{\nameyeardelim}%
            \printfield{labelyear}% 
            \printfield{extrayear}%
            \endgroup
            }%
        }
     {\setlength{\labelwidth}{100pt}%
      \setlength{\leftmargin}{\labelwidth}%
      \setlength{\labelsep}{\biblabelsep}%
      \addtolength{\leftmargin}{\labelsep}%
      \setlength{\itemsep}{\bibitemsep}%
      \setlength{\parsep}{\bibparsep}}%
      \renewcommand*{\makelabel}[1]{\hfill##1\hss}
      }
  {\endlist}
  {\item}


\defbibfilter{online}{
    type=online
}

\defbibfilter{offline}{
    type=book or
    type=article or
    type=report
}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}

@online{cit1,
  title = {Title},
  url = {http://www.website.com},
  timestamp = {2013-04-11T17:20:44Z},
  titleaddon = {Example},
  urldate = {2013-04-10},
  date = {2004}
}

@report{cit2,
  author = {BBBAuthor, Name},
  title = {Title Title Title},
  url = {http://www.example.com},
  timestamp = {2013-04-11T17:20:44Z},
  titleaddon = {Website Name},
  urldate = {2013-04-10},
  date = {2004}
}

@book{cit3,
  location = {Location},
  title = {Title Title},
  timestamp = {2016-02-01T21:50:03Z},
  langid = {english},
  publisher = {Publisher},
  author = {Author, Name},
  date = {2001}
}

\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}

\begin{minipage}{\textwidth}

Bla bla\footnote{\cite[]{cit1}, \url{http://www.website.com}}.
Bla\footnote{\cite[]{cit2}, \url{http://www.example.com}}.
Blaaa blaa bla\footcite[]{cit3}.

\printbibliography[heading=bibintoc,filter=offline,title={Bibliography}]
\printbibliography[title={Online},filter=online,heading=subbibliography]

\end{minipage}

\end{document}

答案1

這應該就像將新的參考書目環境重新命名為一樣簡單bibwithlabels

\defbibenvironment{bibliography}
  {\list
     {
        \printtext[]{%
            \begingroup
            \defcounter{maxnames}{\value{mymaxcitenames}}%
            \printnames{labelname}%
            \setunit{\nameyeardelim}%
            \printfield{labelyear}% 
            \printfield{extrayear}%
            \endgroup
            }%
        }
     {\setlength{\labelwidth}{100pt}%
      \setlength{\leftmargin}{\labelwidth}%
      \setlength{\labelsep}{\biblabelsep}%
      \addtolength{\leftmargin}{\labelsep}%
      \setlength{\itemsep}{\bibitemsep}%
      \setlength{\parsep}{\bibparsep}}%
      \renewcommand*{\makelabel}[1]{\hfill##1\hss}
      }
  {\endlist}
  {\item}

並將其用於離線參考書目和env選項

\printbibliography[heading=bibintoc,filter=offline,title={Bibliography},env=bibwithlabels]
\printbibliography[title={Online},filter=online,heading=subbibliography]

相關內容