我正在做我的论文,我有一个问题:我怎样才能仅为@book 条目打印“ed./edd.”并为@collection 打印“edited by”?
平均能量损失
\documentclass{article}
\usepackage[%
bibstyle=philosophy-verbose,%
citestyle=authoryear,%
autolang=other,
backend=biber,%
classical = true,%
scauthors = bibcite,%
dashed = true,%trattino al posto del nome dell'autore nelle entrate multiple
volnumformat = parens,%
volumeformat = Roman,%
firstinits=true,%
volnumformat=strings,%
volumeformat=romansc,%
sorting=nyt,%
relatedformat=brackets,%
editionformat=superscript,
indexing]{biblatex}
\usepackage{polyglossia}
\setmainlanguage[babelshorthands=true]{italian}
\setotherlanguages{latin,greek,english}
\setkeys{greek}{variant=polytonic}
\setkeys{latin}{variant=modern}
\renewcommand*{\newunitpunct}{\addcomma\space}
\renewcommand*{\editorstrgdelim}{\addcomma\space}%TOGLIERE PARENTESI ALLE DICITURE IN BIBLIO
\DeclareFieldFormat{editortype}{#1}
\renewcommand*{\mkbibnamefamily}[1]{\textsc{#1}} %carattere strano autori in bibliografi
\DefineBibliographyStrings{italian}{%
byeditor = {{a cura di}},
editor = {{ed\adddot}},
editors = {{edd\adddot}},
translator = {{trad\adddot}},
translators = {{tradd\adddot}},
phdthesis = {{ }},
}
\renewbibmacro*{byeditor+others}{%edd. quando ci sono più editori
\ifnameundef{editor}
{}
{\usebibmacro{editor+othersstrg}%
\setunit{\addspace}%
\printnames[byeditor]{editor}%
\clearname{editor}%
\newunit}%
\usebibmacro{byeditorx}%
\usebibmacro{bytranslator+others}}
\renewbibmacro*{bytranslator+others}{%edd. quando ci sono più traduttori
\ifnameundef{translator}
{}
{\usebibmacro{translator+othersstrg}%
\setunit{\addspace}%
\printnames[bytranslator]{translator}%
\clearname{translator}%
\newunit}%
\usebibmacro{bytranslator}}%
\DeclareNameAlias{sortname}{last-first}
\DeclareFieldFormat[article]{title}{\mkbibemph{#1}}
\DeclareFieldFormat[%book,
article, inbook, incollection, inproceedings]{volume}{#1}%PER FAR SPARIRE VOL. VOLL.
\DeclareFieldFormat[article]{journaltitle}{\mkbibquote{#1}}
\DeclareFieldFormat[incollection]{title}{\mkbibemph{#1}}
\DeclareFieldFormat[incollection]{citetitle}{\mkbibemph{#1}}
\DeclareFieldFormat[inbook]{title}{\mkbibemph{#1}}
\DeclareFieldFormat[inbook]{citetitle}{\mkbibemph{#1}}
%\renewcommand*{\finalnamedelim}{{} -- {}}
%\renewcommand*{\finalnamedelim}{{} -- {}} %mettere trattino a fine elenco autori o editori in biblio
\DeclareNameAlias{sortname}{last-first}
\DeclareFieldFormat[article]{title}{\mkbibemph{#1}}
\DeclareFieldFormat[%book,
article, inbook, incollection, inproceedings]{volume}{#1}%PER FAR SPARIRE VOL. VOLL.
\DeclareFieldFormat[article]{journaltitle}{\mkbibquote{#1}}
\DeclareFieldFormat[incollection]{title}{\mkbibemph{#1}}
\DeclareFieldFormat[incollection]{citetitle}{\mkbibemph{#1}}
\DeclareFieldFormat[inbook]{title}{\mkbibemph{#1}}
\DeclareFieldFormat[inbook]{citetitle}{\mkbibemph{#1}}
\renewbibmacro*{issue+date}{%
\printtext{% invece di \printtext[pureparens]{%
\iffieldundef{issue}
{\usebibmacro{date}}
{\printfield{issue}%
\setunit*{\addspace}%
\usebibmacro{date}}}%
\newunit}
\renewbibmacro*{journal+issuetitle}{%
\usebibmacro{journal}%
\setunit*{\addspace}%
\iffieldundef{series}
{}%
{\newunit%
\printfield{series}\setunit{\addspace}\midsentence}%
\newunit%
\usebibmacro{volume+number+eid}%
\setunit{\addcomma\space}% invece di \setunit{\addspace}%
\usebibmacro{issue+date}%
\setunit{\addcolon\space}%
\usebibmacro{issue}%
\newunit}
\renewbibmacro*{title+issuetitle}{%
\usebibmacro{periodical}%
\setunit*{\addspace}%
\iffieldundef{series}
{}%
{\newunit
\printfield{series}%
\setunit{\addspace}\midsentence}%
\usebibmacro{volume+number+eid}%
\setunit{\addcomma\space}% invece di \setunit{\addspace}%
\usebibmacro{issue+date}%
\setunit{\addcolon\space}%
\usebibmacro{issue}%
\newunit}
%-------------------------------------------------------------------------------------------------------------
%METTERE VOL DOPO TITOLO NEI LIBRI----------------------------------------------------------------------------------------------------------------------------
\DeclareBibliographyDriver{book}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author/editor+others/translator+others}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{maintitle+title}%
\newunit
\iffieldundef{maintitle}
{\printfield{volume}%
\printfield{part}}
{}%
\newunit
\printlist{language}%
\newunit\newblock
\usebibmacro{byauthor}%
\newunit\newblock
\usebibmacro{byeditor+others}%
\newunit\newblock
\printfield{edition}%
\newunit
\printfield{volumes}%
\newunit\newblock
\printfield{note}%
\newunit\newblock
\usebibmacro{publisher+location+date}%
\newunit\newblock
\usebibmacro{chapter+pages}%
\newunit
\printfield{pagetotal}%
\newunit\newblock
\iftoggle{bbx:isbn}
{\printfield{isbn}}
{}%
\newunit\newblock
\usebibmacro{doi+eprint+url}%
\newunit\newblock
\usebibmacro{addendum+pubstate}%
\setunit{\addsemicolon\space}\newblock
\iftoggle{bbx:related}
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
\newunit\newblock
\usebibmacro{pageref}%
\newblock\nopunct%
\usebibmacro{series+number}%
\newunit\newblock
\usebibmacro{finentry}}
%----------------------------------------------------------------------------------------------------------------------
\renewcommand*{\finentrypunct}{.} %punto a fine entrata bibliografica
\begin{filecontents*}{\jobname.bib}
@collection{fragmenta,
keywords = {libro},
editor = {H. Hofman and Annette Harder},
title = {Fragmenta dramatica},
subtitle = {Belträge zur Interpretation der griechischen Tragikerfragmente und ihrer Wirkungsgeschichte},
address = {Göttingen},
year = {1991}
}
@incollection{harder1991,
keywords = {libro},
author = {Annette Harder},
title = {Euripides’ \emph{Temenos} and \emph{Temenidai}},
Crossref = {fragmenta},
pages = {117--135},
shorthand = {Harder 1991}
}
@book{kannicht2004,
keywords = {libro},
title = {Tragicorum Graecorum Fragmenta},
volume = {V.2},
editor = {Richard Kannicht},
address = {Göttingen},
year = {2004},
shorthand = {Kannicht 2004},
options = {useeditor=false}
}
\end{filecontents*}
\addbibresource{\jobname.bib}
答案1
最简单的方法是调整你的宏版本byeditor+others
:
\renewbibmacro*{byeditor+others}{%
\ifnameundef{editor}
{}
{\usebibmacro{editor+othersstrg}%
\setunit{\addspace}%
\printnames[byeditor]{editor}%
\clearname{editor}%
\newunit}%
\usebibmacro{byeditorx}%
\usebibmacro{bytranslator+others}}
包含一个条件,检查条目类型并打印 bibstring“byeditor”当且仅当类型为@book
:
\ifentrytype{book}{\usebibmacro{byeditor}}{<otherwise proceed as before>}
这里是真正的最小philosophy-verbose
例如(如果你允许我双关语的话,你的例子最终相当不错):
\documentclass{article}
\usepackage{polyglossia}
\setmainlanguage[babelshorthands=true]{italian}
\usepackage{biblatex}
\DefineBibliographyStrings{italian}{%
byeditor = {{a cura di}},
editor = {{ed\adddot}},
editors = {{edd\adddot}},
}
\renewbibmacro*{byeditor+others}{%
\ifnameundef{editor}
{}
{%
\ifentrytype{book}{\usebibmacro{byeditor}}{% % this line is new ...
\usebibmacro{editor+othersstrg}% % (this part stays the same)
\setunit{\addspace}%
\printnames[byeditor]{editor}%
\clearname{editor}%
\newunit}}% % ...the 2nd closing brace is new
\usebibmacro{byeditorx}%
\usebibmacro{bytranslator+others}}
\begin{filecontents*}[overwrite]{\jobname.bib}
@collection{fragmenta,
keywords = {libro},
editor = {H. Hofman and Annette Harder},
title = {Fragmenta dramatica},
subtitle = {Belträge zur Interpretation der griechischen Tragikerfragmente und ihrer Wirkungsgeschichte},
address = {Göttingen},
year = {1991}
}
@incollection{harder1991,
keywords = {libro},
author = {Annette Harder},
title = {Euripides’ \emph{Temenos} and \emph{Temenidai}},
Crossref = {fragmenta},
pages = {117--135},
shorthand = {Harder 1991}
}
@book{kannicht2004,
keywords = {libro},
title = {Tragicorum Graecorum Fragmenta},
volume = {V.2},
editor = {Richard Kannicht},
address = {Göttingen},
year = {2004},
shorthand = {Kannicht 2004},
options = {useeditor=false}
}
\end{filecontents*}
\addbibresource{\jobname.bib}
\begin{document}
\nocite{*}
\printbibliography
\end{document}