因为@Andy 发现我的问题不合理,所以我用新样式(cbx)文件重写了我的问题(谢谢!)。
在我们的研究领域,冗长是一种很好的风格,因为书籍只在脚注中引用。但我想用以下方式在正文中引用一些书籍(一些基本资料和一些二手资料)。目前人文学科中流行的引用风格是:
请注意,这些书的引用格式,其中一个有“Im folgenden Zitat...”(以下引用为...),而另一个没有。我的 .bib 文件中的一些来源有速记字段的定义,其他没有定义。古典书籍,如康德的实践行动批判,有缩写。在这种情况下,应该显示来源(既不是“Kant, 1788”,也不是“Kant,临界值“, 只是 ”临界值"),而其他来源则以作者年份来引用(在这种情况下,我不需要声明“从今以后引用为......”)。
正如我发现的http://www.latex-community.org/forum/viewtopic.php?f=4&t=852,我想这样做。以下代码是从 verbose.cbx 修改而来,保存为“详细作者年份.cbx“。该文件名为”详细作者年份.bbx",与 verbose-authoryear.bbx 相同。
\ProvidesFile{verbose.cbx}
[\abx@cbxid $Id: verbose.cbx,v 1.6 2011/07/29 19:21:28 lehman stable $]
\InitializeCitationStyle{\numgdef{\cbx@resetcount}{\cbx@resetcount+1}}
\DeclareFieldFormat{bibhyperlink}{%
\bibhyperlink{\iffootnote{f}{t}:\cbx@resetcount:\thefield{entrykey}}{#1}}
\DeclareFieldFormat{bibhypertarget}{%
\bibhypertarget{\iffootnote{f}{t}:\cbx@resetcount:\thefield{entrykey}}{#1}}
\newcommand*{\cbx@resetcount}{0}
\newbibmacro*{cite:citepages}{}
\newbibmacro*{cite:full:citepages}{}
\newbibmacro*{cite:postnote}{}
\DeclareBibliographyOption{citepages}[permit]{%
\ifcsdef{cbx@opt@citepages@#1}
{\csuse{cbx@opt@citepages@#1}}
{\PackageError{biblatex}
{Invalid option 'citepages=#1'}
{Valid values are 'permit', 'suppress', 'omit', 'separate'.}}}
\providebibmacro*{cite:citepages}{}
\providebibmacro*{cite:full:citepages}{}
\providebibmacro*{cite:postnote}{}
\def\cbx@opt@citepages@permit{%
\renewbibmacro*{cite:citepages}{}%
\renewbibmacro*{cite:full:citepages}{}%
\renewbibmacro*{cite:postnote}{\usebibmacro{postnote}}}
\def\cbx@opt@citepages@suppress{%
\renewbibmacro*{cite:citepages}{}%
\renewbibmacro*{cite:full:citepages}{%
\clearfield{pages}%
\clearfield{pagetotal}}%
\renewbibmacro*{cite:postnote}{\usebibmacro{postnote}}}
\def\cbx@opt@citepages@omit{%
\renewbibmacro*{cite:citepages}{}%
\renewbibmacro*{cite:full:citepages}{%
\ifboolexpr{
test {\ifnumequal{\value{citecount}}{\value{citetotal}}}
and
test {\iffieldpages{postnote}}
}
{\clearfield{pages}%
\clearfield{pagetotal}}
{}}%
\renewbibmacro*{cite:postnote}{\usebibmacro{postnote}}}
\def\cbx@opt@citepages@separate{%
\providetoggle{cbx:fullcite}%
\renewbibmacro*{cite:citepages}{%
\global\togglefalse{cbx:fullcite}}%
\renewbibmacro*{cite:full:citepages}{%
\global\toggletrue{cbx:fullcite}}%
\renewbibmacro*{cite:postnote}{%
\ifboolexpr{
togl {cbx:fullcite}
and
test {\iffieldpages{postnote}}
and
test {\ifnumequal{\value{citecount}}{\value{citetotal}}}
and
(
not test {\iffieldundef{pages}}
or
not test {\iffieldundef{pagetotal}}
)
}
{\usebibmacro{cite:postnote:pages}}
{\usebibmacro{postnote}}}
\providebibmacro*{cite:postnote:pages}{%
\setunit{\postnotedelim}%
\bibstring{thiscite}%
\setunit{\addspace}%
\printfield{postnote}}}
\ExecuteBibliographyOptions{citetracker=context,autocite=footnote,citepages=permit}
%\newbibmacro*{cite}{%
% \usebibmacro{cite:citepages}%
% \ifciteseen
% {\iffieldundef{shorthand}
% {\usebibmacro{cite:short}}
% {\usebibmacro{cite:shorthand}}}
% {\usebibmacro{cite:full}}}
%replaced the last section with the following section
%by asblom http://www.latex-community.org/forum/viewtopic.php?f=4&t=852
\newbibmacro*{cite}{%
\ifciteseen
{\iffieldundef{shorthand}
{\ifnameundef{author}{\usebibmacro{cite:title}}{\usebibmacro{cite:name}}%
\usebibmacro{cite:year}}
{\usebibmacro{cite:shorthand}}}
{\usebibmacro{cite:full}}}
\newbibmacro*{cite:full}{%
\usebibmacro{cite:full:citepages}%
\printtext[bibhypertarget]{%
\usedriver
{\DeclareNameAlias{sortname}{default}}
{\thefield{entrytype}}}%
\usebibmacro{shorthandintro}}
\newbibmacro*{cite:short}{%
\printnames{labelname}%
\setunit*{\nametitledelim}%
\printtext[bibhyperlink]{%
\printfield[citetitle]{labeltitle}}}
\newbibmacro*{cite:shorthand}{%
\printtext[bibhyperlink]{\printfield{shorthand}}}
%added by asblom
\newbibmacro*{cite:year}{%
\printfield{year}%
\setunit*{\addcomma\space}}
%assumed adding by akira ueda (from verbose-trad1.cbx)
\newbibmacro*{cite:name}{%
\printnames{labelname}%
\setunit*{\nametitledelim}}
\DeclareCiteCommand{\cite}
{\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{cite}}
{\multicitedelim}
{\usebibmacro{cite:postnote}}
\DeclareCiteCommand{\parencite}[\mkbibparens]
{\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{cite}}
{\multicitedelim}
{\usebibmacro{cite:postnote}}
\DeclareCiteCommand{\footcite}[\mkbibfootnote]
{\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{cite}}
{\multicitedelim}
{\usebibmacro{cite:postnote}}
\DeclareCiteCommand{\footcitetext}[\mkbibfootnotetext]
{\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{cite}}
{\multicitedelim}
{\usebibmacro{cite:postnote}}
\DeclareCiteCommand{\smartcite}[\iffootnote\mkbibparens\mkbibfootnote]
{\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{cite}}
{\multicitedelim}
{\usebibmacro{cite:postnote}}
\endinput
但当我写下下面的 TeX 文档时,
\documentclass{report}
\usepackage[dvips]{graphicx}
\usepackage[ngerman]{babel}
\usepackage[
style=verbose-authoryear,
]{biblatex}
\usepackage[babel,german=quotes]{csquotes}
\renewcommand\mkbibnamelast[1]{\textsc{#1}}
\renewcommand\mkbibnamefirst[1]{\textsc{#1}}
\begin{filecontents*}{biblatex-examples.bib}
@Book{kant:kpv,
shorthand = {KpV},
hyphenation = {german},
author = {Kant, Immanuel},
bookauthor = {Kant, Immanuel},
title = {Kritik der praktischen Vernunft},
shorttitle = {Kritik der praktischen Vernunft},
booktitle = {Kritik der praktischen Vernunft. Kritik der Urtheilskraft},
year = {1788},
}
@Book{adorno-probleme,
hyphenation = {german},
author = {Adorno, Theodor W.},
title = {Probleme der Moralphilosophie},
shorttitle = {Probleme},
location = {Frankfurt am Main},
year = {1996},
\end{filecontents*}
\bibliography{biblatex-examples}
\begin{document}
Als Kant in der \cite{kant:kpv}, es geschrieben hat, war die Lage anders. Er schrieb,
"`Handle so, dass die Maxime deines Willens..."'.\footnote{\cite{kant:kpv}, S.54.}
Theodor W.Adorno erkl"art diesen Satz so, dass diese kategorische Imperativ die moderne
Vernunft voraussetzt.\footnote{Vgl. \cite{adorno-probleme}, S.30ff. Er tat Vorlesung
nach Kant.}
Nach Adornos Ansicht ist die Trennung von Antik und Moderne ansichtig.
\footnote{Schrieb er so deutlich. Siehe \cite{adorno-probleme}, S.30f.} Adorno:
"`In der modernen Zeit ist die Vernunft sowohl gemeinsam als auch pers"onlich"'
(\cite{adorno-probleme}, S.50).
\printshorthands
\printbibliography
\end{document}
我发现了一个问题。如果我不仅在脚注中引用,而且在正文中也引用,那么完整的参考书目会出现两次。我想在脚注中放入完整的参考书目,即使我在正文中第一次引用。我该如何解决?
PS 我制作了这个 verbose-authoryear.cbx 文件,因为我刚开始学习 LaTeX(一周前)。现在我被告知我应该在序言中写出新的引用格式,而不是制作新的 cbx 文件。我想知道我能做到吗。
答案1
您想要的引用样式遇到了许多问题,其中许多问题在您提供的示例输出中没有得到解决。作为新手biblatex
,这是可以理解的。但是,如果不知道您想如何处理每个问题,就很难提供解决方案。我做了一些猜测,总结如下。
前注和后注
如果第一个引用是行内引用\cite[prenote][postnote]{key}
,那么应该放在哪里prenote
-postnote
行内引用还是脚注中?我假设是在脚注中。行内多引用
\cites(multiprenote)(multipostnote)[prenote1][postnote1]{key1}[prenote2][postnote2]{key2}
遵循相同的规则,但是multiprenote
和multipostnote
以内联打印。
消歧义
详细样式基于作者-标题书目样式。如果不使用该字段,具有相同author
和的不同条目将具有模糊的作者-年份引用。可以使用选项设置或启用此字段。下面的示例采用后一种方法。year
labelyear
style=verbose,labelyear=true
bibstyle=authoryear,citestyle=verbose
详细样式
样式 有多种变体verbose
。下面的解决方案应适用于citestyle
设置为任何标准详细样式(verbose-ibid
、verbose-trad1
等)。
标点
在示例文档中,一些内联引用周围的标点位置不太理想。例如,在第一个引用中“堪萨斯州.1 “优于”堪萨斯州1.\autocite
”尾随标点符号可以通过和低级引用命令进行解析(如在上一个问题)。这将需要一种与下面所示的方法不同的方法。它不会轻易扩展到合格的引用列表,但希望随着 的升级,这一限制会有所改善biblatex
。
\documentclass{report}
\usepackage[T1]{fontenc}
\usepackage{csquotes}
\usepackage[american]{babel}
\usepackage[colorlinks]{hyperref}
\usepackage[bibstyle=authoryear,citestyle=verbose]{biblatex}
\addbibresource{biblatex-examples.bib}
% Set additional options for demonstration
\ExecuteBibliographyOptions{citetracker=true,citepages=omit,maxcitenames=1,dashed=false}
% Add comma between labelname and labelyear
\renewcommand*{\nameyeardelim}{\addcomma\space}
% Hack to omit parentheses around year
\newbool{bbx:parens}
\global\booltrue{bbx:parens}
\renewbibmacro*{begentry}{\global\boolfalse{bbx:parens}}
\renewcommand*{\labelnamepunct}{\newunitpunct\global\booltrue{bbx:parens}}
\DeclareFieldFormat{parens}{\ifbool{bbx:parens}{\mkbibparens{#1}}{\newunitpunct#1}}
% Set shorthands in italics
\DeclareFieldFormat{shorthand}{\mkbibemph{#1}}
% Set labelname/author/editor in small capitals
\renewcommand*{\mkbibnamefirst}[1]{\ifmknamesc{\textsc{#1}}{#1}}
\renewcommand*{\mkbibnamelast}[1]{\ifmknamesc{\textsc{#1}}{#1}}
\renewcommand*{\mkbibnameprefix}[1]{\ifmknamesc{\textsc{#1}}{#1}}
\renewcommand*{\mkbibnameaffix}[1]{\ifmknamesc{\textsc{#1}}{#1}}
\def\ifmknamesc{%
\ifboolexpr{ ( test {\ifbibliography} or test {\ifbool{citetracker}} )
and ( test {\ifcurrentname{labelname}}
or test {\ifcurrentname{author}}
or ( test {\ifnameundef{author}}
and test {\ifcurrentname{editor}} ) ) }}
\makeatletter
% Omit inline prenote if citation issues \footcite
\renewbibmacro*{prenote}{%
\iffieldundef{prenote}
{\global\undef{\cbx@prenote}}
{\ifboolexpr{ not test{\ifciteseen} and not test {\iffootnote} }
{\savefield{prenote}{\cbx@prenote}%
\clearfield{prenote}}
{\printfield{prenote}%
\setunit{\prenotedelim}}}}
% On first citation print full entry if in footnote;
% if not in footnote, print label inline and issue \footcite
\renewbibmacro*{cite:full}{%
\usebibmacro{cite:full:citepages}%
\iffootnote
{\printtext[bibhypertarget]{%
\usedriver
{\DeclareNameAlias{sortname}{default}}
{\thefield{entrytype}}}%
\usebibmacro{shorthandintro}}
{\iffieldundef{shorthand}
{\usebibmacro{cite:short}}
{\usebibmacro{cite:shorthand}}%
\ifundef{\cbx@prenote}
{}
{\restorefield{prenote}{\cbx@prenote}}%
\footcite{\thefield{entrykey}}%
\clearfield{postnote}}}
\makeatother
\renewbibmacro*{cite:shorthand}{%
\printtext[bibhyperref]{\printfield{shorthand}}}
% Print labelyear instead of title
\renewbibmacro*{cite:short}{%
\printnames{labelname}%
\setunit{\nameyeardelim}%
\usebibmacro{cite:labelyear+extrayear}}
\providebibmacro*{cite:title}{}
\renewbibmacro*{cite:title}{%
\usebibmacro{cite:labelyear+extrayear}}
\newbibmacro*{cite:labelyear+extrayear}{% from authoryear.cbx
\iffieldundef{labelyear}
{}
{\printtext[bibhyperref]{\printfield{labelyear}\printfield{extrayear}}}}
\begin{document}
\null\vfill\noindent
Filler text \cite{kant:ku}.
Filler text \autocites[See][10--15]{kant:ku}[10--15]{bertram}.
Following \cite{kant:kpv}, we adapt \cite[10--15]{kant:ku}.
Following \cites[See][10--15]{companion}[10--15]{knuth:ct:b}, we adapt \cite{knuth:ct:c}.
Filler text \autocite{knuth:ct:c,companion}.
Filler text.\footcite[See][10--15]{knuth:ct:b}
Filler text \parencites(See)(for example)[10--15]{knuth:ct:b}[10--15]{knuth:ct:d}.
\printbibliography
\end{document}