I'm trying to get a bibliography driver working correctly. I used the code from this previous post, with some minor changes: Need help configuring entry type driver for biblatex-dw. Different citation style sa for different entry types
My version is in the MWE below.
What I want to accomplish, that the previous question did not deal with, is to suppress one of the bib entries (e.g. the one I call box
in my MWE. The suppression works fine, but the result is that I get two or more similar lines in the bibliography. Is there a way to get a list of unique entries, while still suppressing the box
field?
MWE:
\documentclass{article}
\usepackage[
style=authortitle-dw,
firstfull=true,
datamodel=archives,
]{biblatex}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@archive{test1,
subcategory = {Foo},
category = {StateArchive},
box = {130},
}
@archive{test2,
subcategory = {Foo},
category = {StateArchive},
box = {131},
}
\end{filecontents*}
\begin{filecontents*}{archives.dbx}
\ProvidesFile{archives.dbx}[2014/04/02 supplement archive]
\RequireBiber[3]
\DeclareDatamodelEntrytypes{archive}
\DeclareDatamodelEntryfields[archive]{category,subcategory,archive,box}
\DeclareDatamodelConstraints[archive]{
\constraint[type=mandatory]{
\constraintfield{archive}
\constraintfield{category}
\constraintfield{box}
}
}
\DeclareDatamodelFields[type=field,datatype=literal]{category}
\DeclareDatamodelEntryfields[archive]{category}
\DeclareDatamodelFields[type=field,datatype=literal]{subcategory}
\DeclareDatamodelEntryfields[archive]{subcategory}
\DeclareDatamodelFields[type=field,datatype=literal]{archive}
\DeclareDatamodelEntryfields[archive]{archive}
\DeclareDatamodelFields[type=field,datatype=literal]{box}
\DeclareDatamodelEntryfields[archive]{box}
\endinput
\end{filecontents*}
\DeclareBibliographyDriver{archive}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\printfield{archive}%
\setunit{\addspace}%
\printfield{category}%
\setunit{\addspace}%
\printfield{subcategory}%
\setunit{\addspace}%
\printfield{box}%
\newunit\newblock
\usebibmacro{pageref}%
\usebibmacro{finentry}}
\renewbibmacro*{cite:normal}{%
\iffieldundef{shorthand}
{\ifthenelse{\ifciteibid\AND\NOT\iffirstonpage}
{\usebibmacro{cite:ibid}}
{\ifentrytype{archive}
{\usedriver
{\DeclareNameAlias{sortname}{default}}
{\thefield{entrytype}}}
{\ifthenelse{\ifciteidem\AND\NOT\boolean{cbx:noidem}%
\AND\NOT\iffirstonpage}
{\usebibmacro{cite:idem}%
\usebibmacro{cite:title}%
\usebibmacro{cite:save}}
{\ifnameundef{labelname}
{}
{\usebibmacro{cite:name}}%
\usebibmacro{cite:title}}%
\ifbool{cbx:omiteditor}
{}
{\ifnameundef{labelname}
{\newunit
\usebibmacro{cite:byeditor}}
{}}%
\usebibmacro{cite:save}}}}%
{\ifbool{cbx:shorthandibid}%
{\ifthenelse{\ifciteibid\AND\NOT\iffirstonpage}%
{\usebibmacro{cite:ibid}}
{\usebibmacro{cite:shorthand}}}%
{\usebibmacro{cite:shorthand}}}}
\DeclareBibliographyCategory{archive1}
\DeclareBibliographyCategory{archnew}
\AtDataInput[archive]{
\iffieldequalstr{archive}{Archive 1}
{\addtocategory{archive1}{\thefield{entrykey}}}
{}
\iffieldequalstr{archive}{ArchNew}
{\addtocategory{archnew}{\thefield{entrykey}}}
{}
}
\DeclareSortingScheme{archive}{
\sort{
\field{archive}
}
\sort{
\field{category}
}
\sort{
\field{subcategory}
}
\sort{
\field{box}
}
}
\addbibresource{\jobname.bib}
\begin{document}
more\footcite{test1}
more\footcite{test2}
\clearpage
\DeclareFieldFormat[archive]{box}{}
\printbibliography
\end{document}
Current output (bibliography only, as it's the one I'm having problems with):
So, I only want one line, not two similar lines.
Edit: to be clear, I need the box field to be visible in the footnotes.