我一直在使用biblatex-dw
带脚注的引文样式,并对其进行了一些改进。我的问题是:如何从条目中生成脚注,@incollection
以便将译者直接放在文章标题之后,而不是书名之后?
下面是我的序言的一个例子:
\documentclass[a4paper,12pt,pdftex]{report}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english,french,polish]{babel}
\usepackage{csquotes}
\DeclareQuoteAlias{croatian}{polish}
\usepackage[
style=footnote-dw,
autopunct=false,
sorting=nty,
abbreviate = true,
idembibformat = dash,
nopublisher = false,
pageref = false,
backend=biber]{biblatex}
\renewcommand*{\newunitpunct}{\addcomma\space}
\renewbibmacro*{in:}{}
\renewcommand{\multinamedelim}{\addcomma\space}
\DeclareFieldFormat{title}{\mkbibemph{#1}}
\DeclareFieldFormat{booktitle}{\mkbibemph{#1}}
\DeclareFieldFormat{citetitle}{\mkbibemph{#1}}
\DeclareFieldFormat{journaltitle}{\mkbibquote{#1\isdot}}
\DeclareFieldFormat[article,periodical]{volume}{\bibstring{jourvol}~#1}% volume of a journal
\DeclareFieldFormat[article,periodical]{number}{nr~#1}% number of a journal
\newbibmacro*{in:}{%
\ifentrytype{article}
{}
{\printtext[brackets]{%
\bibstring{in}\addcolon}\space}}
\renewbibmacro*{volume+number+eid}{%
\printfield{volume}%
\setunit{\addcomma\space}%
\printfield{number}%
\setunit{\addcomma\space}%
\printfield{eid}}
\renewbibmacro*{journal+issuetitle}{%
\usebibmacro{journal}%
\setunit*{\addspace}%
\iffieldundef{series}
{}
{\newunit
\printfield{series}%
\setunit{\addspace}}%
\usebibmacro{issue+date}%
\setunit{\addcomma\space}%
\usebibmacro{volume+number+eid}%
\setunit{\addcolon\space}%
\usebibmacro{issue}%
\newunit}
\renewbibmacro*{issue+date}{%
\printfield{issue}%
\setunit*{\addspace}%
\usebibmacro{date}%
\newunit}
\addbibresource{thesis.bib}
\begin{document}
Tytuł dokumentu\cite{jameson_postmodernizm_1996}.
\printbibliography
\end{document}
.bib 文件如下:
@incollection{jameson_postmodernizm_1996,
location = {Kraków},
title = {Postmodernizm i społeczeństwo konsumpcyjne},
booktitle = {Postmodernizm. Antologia przekładów},
publisher = {Wydawnictwo Baran i Suszczyński},
author = {Jameson, Fredric},
editor = {Nycz, Ryszard},
translator = {Czapliński, Przemysław},
date = {1996}
我如何编辑 bbx 或 cbx 文件,以便翻译字段位于书名之前(翻译仅指集合中的一篇文章)?
答案1
这类似于为什么 biblatex 选项“useeditor=true”在书籍文章中被忽略?。问题是 和translator
引用editor
而不是。您可以booktitle
引入新名称和引用。这需要一点技巧,但最终会让您如愿以偿@in...
title
ineditor
instranslator
title
\documentclass[a4paper,12pt]{report}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english,french,polish]{babel}
\usepackage{csquotes}
%\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@incollection{jameson_postmodernizm_1996,
location = {Kraków},
title = {Postmodernizm i społeczeństwo konsumpcyjne},
booktitle = {Postmodernizm. Antologia przekładów},
publisher = {Wydawnictwo Baran i Suszczyński},
author = {Jameson, Fredric},
editor = {Nycz, Ryszard},
intranslator = {Czapliński, Przemysław},
date = {1996},
}
\end{filecontents}
\begin{filecontents}{innames.dbx}
\ProvidesFile{innames.dbx}[2018/05/09 more names for @in types]
\RequireBiber[3]
% new translator etc. fields for "inner" work, that is translator of title (not booktitle) in @in...
\DeclareDatamodelFields[type=list,datatype=name]{ineditor, ineditora, ineditorb, ineditorc, intranslator, intranslator, inannotator, incommentator, inintroduction, inforeword, inafterword}
\DeclareDatamodelEntryfields[inbook,incollection,inproceedings,inreference]{ineditor, ineditora, ineditorb, ineditorc, intranslator, inannotator, incommentator, inintroduction, inforeword, inafterword}
\end{filecontents}
\usepackage[
backend=biber,
datamodel=innames,
style=footnote-dw,
autopunct=false,
sorting=nty,
abbreviate = true,
idembibformat = dash,
nopublisher = false,
pageref = false,
]{biblatex}
\makeatletter
\newbibmacro*{ineditorstrg}{%
\printtext[ineditortype]{%
\iffieldundef{ineditortype}
{\ifboolexpr{
test {\ifnumgreater{\value{ineditor}}{1}}
or
test {\ifandothers{ineditor}}
}
{\bibstring{editors}}
{\bibstring{editor}}}
{\ifbibxstring{\thefield{ineditortype}}
{\ifboolexpr{
test {\ifnumgreater{\value{ineditor}}{1}}
or
test {\ifandothers{ineditor}}
}
{\bibstring{\thefield{ineditortype}s}}
{\bibstring{\thefield{ineditortype}}}}
{\thefield{ineditortype}}}}}
\newbibmacro*{ineditor+othersstrg}{%
\iffieldundef{ineditortype}
{\ifboolexpr{
test {\ifnumgreater{\value{ineditor}}{1}}
or
test {\ifandothers{ineditor}}
}
{\def\abx@tempa{editors}}
{\def\abx@tempa{editor}}}
{\ifboolexpr{
test {\ifnumgreater{\value{ineditor}}{1}}
or
test {\ifandothers{ineditor}}
}
{\edef\abx@tempa{\thefield{ineditortype}s}}
{\edef\abx@tempa{\thefield{ineditortype}}}}%
\let\abx@tempb=\empty
\ifnamesequal{ineditor}{intranslator}
{\appto\abx@tempa{tr}%
\appto\abx@tempb{\clearname{intranslator}}}
{}%
\ifnamesequal{ineditor}{incommentator}
{\appto\abx@tempa{co}%
\appto\abx@tempb{\clearname{incommentator}}}
{\ifnamesequal{ineditor}{inannotator}
{\appto\abx@tempa{an}%
\appto\abx@tempb{\clearname{inannotator}}}
{}}%
\ifnamesequal{ineditor}{inintroduction}
{\appto\abx@tempa{in}%
\appto\abx@tempb{\clearname{inintroduction}}}
{\ifnamesequal{ineditor}{inforeword}
{\appto\abx@tempa{fo}%
\appto\abx@tempb{\clearname{inforeword}}}
{\ifnamesequal{ineditor}{inafterword}
{\appto\abx@tempa{af}%
\appto\abx@tempb{\clearname{inafterword}}}
{}}}%
\ifbibxstring{\abx@tempa}
{\printtext[ineditortype]{\bibstring{\abx@tempa}}\abx@tempb}
{\usebibmacro{ineditorstrg}}}
\newbibmacro*{intranslatorstrg}{%
\printtext[intranslatortype]{%
\ifboolexpr{
test {\ifnumgreater{\value{intranslator}}{1}}
or
test {\ifandothers{intranslator}}
}
{\bibstring{translators}}
{\bibstring{translator}}}}
\newbibmacro*{intranslator+othersstrg}{%
\ifboolexpr{
test {\ifnumgreater{\value{intranslator}}{1}}
or
test {\ifandothers{intranslator}}
}
{\def\abx@tempa{translators}}
{\def\abx@tempa{translator}}%
\ifnamesequal{intranslator}{incommentator}
{\appto\abx@tempa{co}%
\clearname{incommentator}}
{\ifnamesequal{intranslator}{inannotator}
{\appto\abx@tempa{an}%
\clearname{inannotator}}
{}}%
\ifnamesequal{intranslator}{inintroduction}
{\appto\abx@tempa{in}%
\clearname{inintroduction}}
{\ifnamesequal{intranslator}{inforeword}
{\appto\abx@tempa{fo}%
\clearname{inforeword}}
{\ifnamesequal{intranslator}{inafterword}
{\appto\abx@tempa{af}%
\clearname{inafterword}}
{}}}%
\bibstring{\abx@tempa}}
\newbibmacro*{ineditor+others}{%
\ifboolexpr{
test \ifuseineditor
and
not test {\ifnameundef{ineditor}}
}
{\printnames{ineditor}%
\setunit{\addcomma\space}%
\usebibmacro{ineditor+othersstrg}%
\clearname{ineditor}}
{}}
\newbibmacro*{intranslator+others}{%
\ifboolexpr{
test \ifuseintranslator
and
not test {\ifnameundef{intranslator}}
}
{\printnames{intranslator}%
\setunit{\addcomma\space}%
\usebibmacro{intranslator+othersstrg}%
\clearname{intranslator}}
{}}
\newbibmacro*{author/ineditor+others/intranslator+others}{%
\ifboolexpr{
test \ifuseauthor
and
not test {\ifnameundef{author}}
}
{\usebibmacro{author}}
{\ifboolexpr{
test \ifuseineditor
and
not test {\ifnameundef{ineditor}}
}
{\usebibmacro{ineditor+others}}
{\usebibmacro{intranslator+others}}}}
\newbibmacro*{byineditor}{%
\ifnameundef{ineditor}
{}
{\usebibmacro{bytypestrg}{ineditor}{editor}%
\setunit{\addspace}%
\printnames[byineditor]{ineditor}%
\newunit}%
\usebibmacro{byineditorx}}
\newbibmacro*{byineditorx}{%
\ifnameundef{ineditora}
{}
{\usebibmacro{bytypestrg}{ineditora}{editor}%
\setunit{\addspace}%
\printnames[byineditora]{ineditora}%
\newunit}%
\ifnameundef{ineditorb}
{}
{\usebibmacro{bytypestrg}{ineditorb}{editor}%
\setunit{\addspace}%
\printnames[byineditorb]{ineditorb}%
\newunit}%
\ifnameundef{ineditorc}
{}
{\usebibmacro{bytypestrg}{ineditorc}{editor}%
\setunit{\addspace}%
\printnames[byineditorc]{ineditorc}%
\newunit}}
\newbibmacro*{byintranslator}{%
\ifnameundef{intranslator}
{}
{\bibstring{bytranslator}%
\setunit{\addspace}%
\printnames[byintranslator]{intranslator}}}
\newbibmacro*{byineditor+others}{%
\ifnameundef{ineditor}
{}
{\usebibmacro{byineditor+othersstrg}%
\setunit{\addspace}%
\printnames[byineditor]{ineditor}%
\clearname{ineditor}%
\newunit}%
\usebibmacro{byineditorx}%
\usebibmacro{byintranslator+others}}
\newbibmacro*{byintranslator+others}{%
\ifnameundef{intranslator}
{}
{\usebibmacro{byintranslator+othersstrg}%
\setunit{\addspace}%
\printnames[byintranslator]{intranslator}%
\clearname{intranslator}%
\newunit}}
\newbibmacro*{byineditor+othersstrg}{%
\iffieldundef{ineditortype}
{\def\abx@tempa{byeditor}}
{\edef\abx@tempa{by\thefield{ineditortype}}}%
\let\abx@tempb=\empty
\ifnamesequal{ineditor}{intranslator}
{\appto\abx@tempa{tr}%
\appto\abx@tempb{\clearname{intranslator}}}
{}%
\ifnamesequal{ineditor}{incommentator}
{\appto\abx@tempa{co}%
\appto\abx@tempb{\clearname{incommentator}}}
{\ifnamesequal{ineditor}{inannotator}
{\appto\abx@tempa{an}%
\appto\abx@tempb{\clearname{inannotator}}}
{}}%
\ifnamesequal{ineditor}{inintroduction}
{\appto\abx@tempa{in}%
\appto\abx@tempb{\clearname{inintroduction}}}
{\ifnamesequal{ineditor}{inforeword}
{\appto\abx@tempa{fo}%
\appto\abx@tempb{\clearname{inforeword}}}
{\ifnamesequal{ineditor}{inafterword}
{\appto\abx@tempa{af}%
\appto\abx@tempb{\clearname{inafterword}}}
{}}}%
\ifbibxstring{\abx@tempa}
{\printtext{\bibstring{\abx@tempa}}\abx@tempb}
{\usebibmacro{bytypestrg}{ineditor}{editor}}}
\newbibmacro*{byintranslator+othersstrg}{%
\def\abx@tempa{bytranslator}%
\ifnamesequal{intranslator}{incommentator}
{\appto\abx@tempa{co}%
\clearname{incommentator}}
{\ifnamesequal{intranslator}{inannotator}
{\appto\abx@tempa{an}%
\clearname{inannotator}}
{}}%
\ifnamesequal{intranslator}{inintroduction}
{\appto\abx@tempa{in}%
\clearname{inintroduction}}
{\ifnamesequal{intranslator}{inforeword}
{\appto\abx@tempa{fo}%
\clearname{foreword}}
{\ifnamesequal{intranslator}{inafterword}
{\appto\abx@tempa{af}%
\clearname{afterword}}
{}}}%
\bibstring{\abx@tempa}}
\makeatother
\renewbibmacro*{author/translator+others}{\usebibmacro{author/ineditor+others/intranslator+others}} %% this is an ad hoc for this particular application
\renewcommand*{\newunitpunct}{\addcomma\space}
\renewbibmacro*{in:}{}
\renewcommand{\multinamedelim}{\addcomma\space}
\DeclareFieldFormat{title}{\mkbibemph{#1}}
\DeclareFieldFormat{booktitle}{\mkbibemph{#1}}
\DeclareFieldFormat{citetitle}{\mkbibemph{#1}}
\DeclareFieldFormat{journaltitle}{\mkbibquote{#1\isdot}}
\DeclareFieldFormat[article,periodical]{volume}{\bibstring{jourvol}~#1}% volume of a journal
\DeclareFieldFormat[article,periodical]{number}{nr~#1}% number of a journal
\usepackage{xpatch}
\xpatchbibdriver{incollection}
{\usebibmacro{byauthor}}
{\usebibmacro{byauthor}%
\newunit
\usebibmacro{byineditor+others}}
{}{}
\renewbibmacro*{in:}{%
\ifentrytype{article}
{}
{\printtext[brackets]{%
\bibstring{in}\addcolon}\space}}
\renewbibmacro*{volume+number+eid}{%
\printfield{volume}%
\setunit{\addcomma\space}%
\printfield{number}%
\setunit{\addcomma\space}%
\printfield{eid}}
\renewbibmacro*{journal+issuetitle}{%
\usebibmacro{journal}%
\setunit*{\addspace}%
\iffieldundef{series}
{}
{\newunit
\printfield{series}%
\setunit{\addspace}}%
\usebibmacro{issue+date}%
\setunit{\addcomma\space}%
\usebibmacro{volume+number+eid}%
\setunit{\addcolon\space}%
\usebibmacro{issue}%
\newunit}
\renewbibmacro*{issue+date}{%
\printfield{issue}%
\setunit*{\addspace}%
\usebibmacro{date}%
\newunit}
\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}
\begin{document}
Tytuł dokumentu\cite{jameson_postmodernizm_1996}.
\printbibliography
\end{document}