我正在使用下面的代码,使用 manyfoot 包、biblatex 和 chem-angew 样式在页面底部实现脚注和脚注引用。
代码中使用的所有内容都可以在这里找到:Biblatex 仅引用一次脚注,并使用括号 和Biblatex footcite:自定义 biblatex 和参考书目样式和如何删除 doi 字段中的前缀(如果存在)和如何水平对齐跨多行的较长脚注(以及显示在页面底部的脚注)内的文本
我想在参考书目中显示article
和的标题inbook
(不带引号),但在引用文章或书中章节时不在脚注中显示。使用chaptertitle=true,articletitle=true
,我可以在参考书目中获得标题,也可以在脚注中获得标题。如何实现我想要的引用样式?
\documentclass[fontsize=11pt,DIV=11]{scrbook}
\usepackage[USenglish]{babel} % General language setting & Hyphenation; vor newpxtext laden!
\frenchspacing % Deaktiviert /Nonfrenchspacing von USenglish
\usepackage{newpxtext}
\usepackage{newpxmath}
\linespread{1.05}
\usepackage{setspace}
\setstretch{1.3}
\usepackage{xcolor}
\usepackage{manyfoot}
\usepackage[babel]{csquotes}
\usepackage[backend=biber,style=chem-angew,mcite,subentry]{biblatex}
\usepackage{hyperref}
\hypersetup{%
colorlinks,
linkcolor={red!0!black},
citecolor={blue!0!black},
urlcolor={blue!80!black}
}
\makeatletter
\long\def\MFL@fnoteplain#1#2#3{\NCC@makefnmark{#2}%
\MFL@insert#1{\def\baselinestretch {\setspace@singlespace}%
\reset@font\footnotesize
\interlinepenalty\interfootnotelinepenalty
\hsize\MFL@columnwidth \@parboxrestore
\protected@edef\@currentlabel{\@thefnmark}%
\color@begingroup
\MFL@applyhook{#1}%
\@makefntext{%
\rule\z@\footnotesep\ignorespaces#3\@finalstrut\strutbox}%
\color@endgroup
}%
}
\makeatother
\ExecuteBibliographyOptions{citetracker=true,sorting=none,maxcitenames=2,maxbibnames=99,chaptertitle=true,articletitle=true,doi=false,url=false,isbn=false,hyperref=true,backref=false}
\urlstyle{same}
\DeclareFieldFormat[article,inbook]{citetitle}{#1}
\DeclareFieldFormat[article,inbook]{title}{#1}
\DefineBibliographyStrings{ngerman}{
andothers = {\textit{et~al\adddot}}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Citation footnotes: use \footnoteA
\SetFootnoteHook{%
\hangindent=1.8em\noindent}
\DeclareNewFootnote{A}
% Vanilla footnotes: use \footnoteB
\SetFootnoteHook{%
\hangindent=1.8em\noindent}
\DeclareNewFootnote{B}
% Number of each bibliography entry in brackets
\DeclareFieldFormat{labelnumberwidth}{\mkbibbrackets{#1}}
\makeatletter
\newtoggle{cbx@togcite}
% Citation number superscript in brackets
\newcommand*{\cbx@makefntext}[1]{%
\hb@[email protected]{%
\iftoggle{cbx@togcite}
{\@textsuperscript{\normalfont[\@thefnmark]}}
{\@textsuperscript{\normalfont\@thefnmark}}%
\hss}%
#1%
\global\togglefalse{cbx@togcite}}
\renewcommand*{\@makefntext}{\cbx@makefntext}
% Citation number superscript in brackets (for babel french)
\ifdef{\@makefntextFB}
{\renewcommand\@makefntextFB{\cbx@makefntext}}
{}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Mostly verbatim from Joseph Wright
% http://www.texdev.net/2010/03/08/biblatex-numbered-citations-as-footnotes/
\DeclareCiteCommand{\sfcite}[\cbx@superscript]%
{\usebibmacro{cite:init}%
\let\multicitedelim=\supercitedelim
\iffieldundef{prenote}
{}
{\BibliographyWarning{Ignoring prenote argument}}%
\iffieldundef{postnote}
{}
{\BibliographyWarning{Ignoring postnote argument}}}
{\usebibmacro{citeindex}%
\usebibmacro{sfcite}%
\usebibmacro{cite:comp}}
{}
{\usebibmacro{cite:dump}}
\newbibmacro*{sfcite}{%
\ifciteseen
{}
{\xappto\cbx@citehook{%
\global\toggletrue{cbx@togcite}%
\noexpand\footnotetextA[\thefield{labelnumber}]{%
\fullcite{\thefield{entrykey}}\addperiod}}}}
\newrobustcmd{\cbx@superscript}[1]{%
\mkbibsuperscript{\mkbibbrackets{#1}}%
\cbx@citehook%
\global\let\cbx@citehook=\empty}
\let\cbx@citehook=\empty
\makeatother
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newbibmacro{string+doiurlisbn}[1]{%
\iffieldundef{doi}{%
\iffieldundef{url}{%
\iffieldundef{isbn}{%
\iffieldundef{issn}{%
#1%
}{%
\href{http://books.google.com/books?vid=ISSN\thefield{issn}}{#1}%
}%
}{%
\href{http://books.google.com/books?vid=ISBN\thefield{isbn}}{#1}%
}%
}{%
\href{\thefield{url}}{#1}%
}%
}{%
\href{https://doi.org/\thefield{doi}}{#1}%
}%
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\DeclareFieldFormat{journaltitle}{\usebibmacro{string+doiurlisbn}{\mkbibemph{#1}}}
\DeclareSourcemap{
\maps[datatype=bibtex]{
\map{
\step[
fieldsource=doi,
match=\regexp{https?://(dx.)?doi.org/(.+)},
replace=\regexp{$2}%$
]
}
}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{filecontents}[force]{\jobname.bib}
@article{Frank1953,
author = {Frank, F. C.},
title = {On spontaneous asymmetric synthesis},
journal = {Biochim. Biophys. Acta},
year = {1953},
volume = {11},
pages = {459-463},
doi = {http://dx.doi.org/10.1016/0006-3002(53)90082-1},
url = {http://www.sciencedirect.com/science/article/pii/0006300253900821},
}
@inbook{Keim1987,
author = {Keim, W.},
title = {Industrial Uses of Carbon Dioxide},
booktitle = {Carbon Dioxide as a Source of Carbon: Biochemical and Chemical Uses},
editor = {Aresta, M. and Forti, G.},
publisher = {Springer},
address = {Dordrecht},
edition = {1},
ISBN = {978-94-009-3923-3},
DOI = {10.1007/978-94-009-3923-3},
url = {https://doi.org/10.1007/978-94-009-3923-3},
year = {1987},
type = {Book Section}
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\chapter{Title}
\null\vfill\noindent
Vanilla footnote.\footnoteB{Vanilla footnote text.}
Citation of article.\sfcite{Frank1953} Citation of inbook.\sfcite{Keim1987}
\printbibliography
\end{document}
答案1
这些选项articletitle
是chaptertitle
通过一个简单的etoolbox
切换按钮实现的,可以在文档的任何位置切换。
在这里你可以说
\AtEveryCite{%
\togglefalse{bbx:articletitle}%
\togglefalse{bbx:chaptertitle}%
}
仅在引用时关闭标题。
\documentclass[fontsize=11pt,DIV=11]{scrartcl}
\usepackage[USenglish]{babel} % General language setting & Hyphenation; vor newpxtext laden!
\frenchspacing % Deaktiviert /Nonfrenchspacing von USenglish
\usepackage{newpxtext}
\usepackage{newpxmath}
\linespread{1.05}
\usepackage{setspace}
\setstretch{1.3}
\usepackage{xcolor}
\usepackage{manyfoot}
\usepackage[babel]{csquotes}
\usepackage[backend=biber,style=chem-angew,mcite,subentry]{biblatex}
\usepackage{hyperref}
\hypersetup{%
colorlinks,
linkcolor={red!0!black},
citecolor={blue!0!black},
urlcolor={blue!80!black}
}
\makeatletter
\long\def\MFL@fnoteplain#1#2#3{\NCC@makefnmark{#2}%
\MFL@insert#1{\def\baselinestretch {\setspace@singlespace}%
\reset@font\footnotesize
\interlinepenalty\interfootnotelinepenalty
\hsize\MFL@columnwidth \@parboxrestore
\protected@edef\@currentlabel{\@thefnmark}%
\color@begingroup
\MFL@applyhook{#1}%
\@makefntext{%
\rule\z@\footnotesep\ignorespaces#3\@finalstrut\strutbox}%
\color@endgroup
}%
}
\makeatother
\ExecuteBibliographyOptions{citetracker=true,
sorting=none,
maxcitenames=2, maxbibnames=99,
chaptertitle=true, articletitle=true,
doi=false, url=false, isbn=false,
backref=false}
\urlstyle{same}
\DeclareFieldFormat[article,inbook]{citetitle}{#1}
\DeclareFieldFormat[article,inbook]{title}{#1}
\AtEveryCite{%
\togglefalse{bbx:articletitle}%
\togglefalse{bbx:chaptertitle}%
}
\DefineBibliographyStrings{ngerman}{
andothers = {\textit{et~al\adddot}}
}
% Citation footnotes: use \footnoteA
\SetFootnoteHook{%
\hangindent=1.8em\noindent}
\DeclareNewFootnote{A}
% Vanilla footnotes: use \footnoteB
\SetFootnoteHook{%
\hangindent=1.8em\noindent}
\DeclareNewFootnote{B}
% Number of each bibliography entry in brackets
\DeclareFieldFormat{labelnumberwidth}{\mkbibbrackets{#1}}
\makeatletter
\newtoggle{cbx@togcite}
% Citation number superscript in brackets
\newcommand*{\cbx@makefntext}[1]{%
\hb@[email protected]{%
\iftoggle{cbx@togcite}
{\@textsuperscript{\normalfont[\@thefnmark]}}
{\@textsuperscript{\normalfont\@thefnmark}}%
\hss}%
#1%
\global\togglefalse{cbx@togcite}}
\renewcommand*{\@makefntext}{\cbx@makefntext}
% Citation number superscript in brackets (for babel french)
\ifdef{\@makefntextFB}
{\renewcommand\@makefntextFB{\cbx@makefntext}}
{}
% Mostly verbatim from Joseph Wright
% http://www.texdev.net/2010/03/08/biblatex-numbered-citations-as-footnotes/
\DeclareCiteCommand{\sfcite}[\cbx@superscript]%
{\usebibmacro{cite:init}%
\let\multicitedelim=\supercitedelim
\iffieldundef{prenote}
{}
{\BibliographyWarning{Ignoring prenote argument}}%
\iffieldundef{postnote}
{}
{\BibliographyWarning{Ignoring postnote argument}}}
{\usebibmacro{citeindex}%
\usebibmacro{sfcite}%
\usebibmacro{cite:comp}}
{}
{\usebibmacro{cite:dump}}
\newbibmacro*{sfcite}{%
\ifciteseen
{}
{\xappto\cbx@citehook{%
\global\toggletrue{cbx@togcite}%
\noexpand\footnotetextA[\thefield{labelnumber}]{%
\fullcite{\thefield{entrykey}}\addperiod}}}}
\newrobustcmd{\cbx@superscript}[1]{%
\mkbibsuperscript{\mkbibbrackets{#1}}%
\cbx@citehook%
\global\let\cbx@citehook=\empty}
\let\cbx@citehook=\empty
\makeatother
\newbibmacro{string+doiurlisbn}[1]{%
\iffieldundef{doi}{%
\iffieldundef{url}{%
\iffieldundef{isbn}{%
\iffieldundef{issn}{%
#1%
}{%
\href{http://books.google.com/books?vid=ISSN\thefield{issn}}{#1}%
}%
}{%
\href{http://books.google.com/books?vid=ISBN\thefield{isbn}}{#1}%
}%
}{%
\href{\thefield{url}}{#1}%
}%
}{%
\href{https://doi.org/\thefield{doi}}{#1}%
}%
}
\DeclareFieldFormat{journaltitle}{\usebibmacro{string+doiurlisbn}{\mkbibemph{#1}}}
\DeclareSourcemap{
\maps[datatype=bibtex]{
\map{
\step[
fieldsource=doi,
match=\regexp{https?://(dx.)?doi.org/(.+)},
replace=\regexp{$2}%$
]
}
}
}
\begin{filecontents}{\jobname.bib}
@article{Frank1953,
author = {Frank, F. C.},
title = {On spontaneous asymmetric synthesis},
journal = {Biochim. Biophys. Acta},
year = {1953},
volume = {11},
pages = {459-463},
doi = {http://dx.doi.org/10.1016/0006-3002(53)90082-1},
url = {http://www.sciencedirect.com/science/article/pii/0006300253900821},
}
@inbook{Keim1987,
author = {Keim, W.},
title = {Industrial Uses of Carbon Dioxide},
booktitle = {Carbon Dioxide as a Source of Carbon: Biochemical and Chemical Uses},
editor = {Aresta, M. and Forti, G.},
publisher = {Springer},
address = {Dordrecht},
edition = {1},
ISBN = {978-94-009-3923-3},
DOI = {10.1007/978-94-009-3923-3},
url = {https://doi.org/10.1007/978-94-009-3923-3},
year = {1987},
type = {Book Section}
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\null\vfill\noindent
Vanilla footnote.\footnoteB{Vanilla footnote text.}
Citation of article.\sfcite{Frank1953} Citation of inbook.\sfcite{Keim1987}
\printbibliography
\end{document}