BibLaTeX APA:当条目没有年份或日期时,如何防止 nd 出现在参考书目中?

BibLaTeX APA:当条目没有年份或日期时,如何防止 nd 出现在参考书目中?

我正在使用 APA 样式的 BibLaTeX 排版我的文档,并且需要引用法律材料。
使用内置的法律支持biblatex-apa没有给出预期的结果,所以我必须自定义书目的打印方式。
为此,我使用misc条目类型添加法律材料,并将法律材料的名称添加到字段title,如下所示:

@misc{k1,
    title = {Charter of Fundamental Rights of the European Union}
}

结果如下:

1

有没有办法可以防止 (nd) 出现在参考书目中?

另外,有没有办法cite引用并打印自定义字段,比如shorttitle,而不是title
例如:

It was said in \cite{k1} that ...  

将输出:

It was said in CFREU that ...

编辑:这似乎\citefield{k1}{shorttitle}是解决奖励问题的办法。

平均能量损失

\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@misc{k1,
    title = {Charter of Fundamental Rights of the European Union}
}
\end{filecontents*}

\documentclass[12pt,a4paper]{report}

\usepackage[T1]{fontenc} % output font encoding
\usepackage[utf8]{inputenc} % input font encoding
\usepackage[english]{babel}
\usepackage{csquotes}
\usepackage[style=apa, backend=biber]{biblatex}
\addbibresource{\jobname.bib}

\begin{document}
Hello, world! \nocite{k1}
\printbibliography
\end{document}

答案1

您可以指示biber在条目类型的不同字段中查找“年份”,并将其留空。在这里,我指示它在\labelin中查找@misc,并将其留空,因此当它查找年份时,它找不到任何内容。因此,它也不会打印任何内容,因为“nd”输出未编入。请注意,这将适用于参考书目中的\label所有条目。@misc

\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@misc{k1,
    label = {} % place for biber to look for the "new year"
    title = {Charter of Fundamental Rights of the European Union}
}
\end{filecontents*}

\documentclass[12pt,a4paper]{report}

\usepackage[T1]{fontenc} % output font encoding
\usepackage[utf8]{inputenc} % input font encoding
\usepackage[english]{babel}
\usepackage{csquotes}
\usepackage[style=apa, backend=biber]{biblatex}
\addbibresource{\jobname.bib}

\DeclareLabeldate[misc]{%
\field{label}
} % declaration of the "new year type" for biber to look for

\begin{document}
Hello, world! \cite{k1}
\printbibliography
\end{document}

答案2

有关法律引证的一般建议,请参阅对于法律以外的学科,使用 Biblatex/Biber 处理法律资源的最佳做法是什么?

新版本对biblatex-apa法律引用有一定的支持,特别是有@legal、、、、@constitution等类型@jurisdiction@legmaterial@legadminmaterial可以在biblatex-apa-test-references.bib。不过,其中大多数仍显示日期,而@constitution则由于其他原因无法正常使用。

即使这些条目类型没有提供比@misc现在更好的结果,您可能仍需要考虑使用这些类型,因为它们允许更好地控制修改,并且更具语义通常是一件好事。


如果你需要完全控制参考书目和引文输出,你可能会对“自由形式”引文感兴趣。请参阅如何设置 BibLaTeX 以用于“自由格式”引用

具体来说biblatex-apa,我做了一些东西https://github.com/plk/biblatex/issues/884不久前。

使用当前biblatex-apa版本(v9.14),您可以执行以下操作。

@freeform带有三个字段:citefirstcitebibliography,您可以使用它们来排版引用(如果需要,为第一次引用)和参考书目中的任意内容。

\documentclass[american]{article}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{csquotes}

\begin{filecontents}{freeform-apa.dbx}
\ProvidesFile{freeform-apa.dbx}[2020/10/23 v0.1 freeform for biblatex-apa v9.14 (2020/08/28)]
\DeclareDatamodelEntrytypes{
  presentation,
  constitution,
  legmaterial,
  legadminmaterial,
  nameonly,
  freeform}

\DeclareDatamodelFields[type=list, datatype=name]{
  groupauthor,
  narrator,
  execproducer,
  execdirector,
  with}

\DeclareDatamodelFields[type=list, datatype=literal]{
  citation}

\DeclareDatamodelFields[type=field, datatype=literal]{
  bibliography,
  cite,
  firstcite,
  source,
  article,
  section,
  amendment,
  appentry}

\DeclareDatamodelEntryfields{
  with,
  groupauthor,
  narrator,
  execproducer,
  execdirector}

% APA Court cases
\DeclareDatamodelEntryfields[jurisdiction]{
  organization
  citation}

% Legislative material
\DeclareDatamodelEntryfields[legmaterial]{
  source}

% Admin and Executive material
\DeclareDatamodelEntryfields[legadminmaterial]{
  citation,
  source}

% Constitution/charters
\DeclareDatamodelEntryfields[constitution]{
  article,
  section,
  amendment}

\DeclareDatamodelEntryfields[software]{
  appentry}

\DeclareDatamodelEntryfields[report]{
  addendum,
  author,
  authortype,
  chapter,
  doi,
  eprint,
  eprintclass,
  eprinttype,
  institution,
  isrn,
  language,
  location,
  note,
  number,
  pages,
  pagetotal,
  pubstate,
  subtitle,
  title,
  titleaddon,
  type,
  version}

\DeclareDatamodelEntryfields[presentation]{
  addendum,
  author,
  booksubtitle,
  booktitle,
  booktitleaddon,
  chapter,
  doi,
  editor,
  editortype,
  eprint,
  eprintclass,
  eprinttype,
  eventday,
  eventendday,
  eventendhour,
  eventendminute,
  eventendmonth,
  eventendseason,
  eventendsecond,
  eventendtimezone,
  eventendyear,
  eventhour,
  eventminute,
  eventmonth,
  eventseason,
  eventsecond,
  eventtimezone,
  eventyear,
  eventtitle,
  eventtitleaddon,
  isbn,
  language,
  location,
  mainsubtitle,
  maintitle,
  maintitleaddon,
  note,
  number,
  organization,
  pages,
  part,
  publisher,
  pubstate,
  series,
  subtitle,
  title,
  titleaddon,
  venue,
  volume,
  volumes}

\DeclareDatamodelEntryfields[freeform]{
  bibliography,
  cite,
  firstcite,
  sortkey}

\DeclareDatamodelConstraints[book,inbook,article,report]{
  \constraint[type=mandatory]{
    \constraintfieldsor{
      \constraintfield{author}
      \constraintfield{groupauthor}
    }
    \constraintfield{title}
  }
}
\end{filecontents}

\usepackage[backend=biber, style=apa, datamodel=freeform-apa]{biblatex}

\DeclareBibliographyDriver{freeform}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \printfield{bibliography}%
  \setunit{\addspace}\newblock
  \iftoggle{bbx:related}
    {\usebibmacro{related:init}%
     \usebibmacro{related}}
    {}%
  \usebibmacro{pageref}%
  \usebibmacro{annotation}%
  \usebibmacro{finentry}}


\letbibmacro{cite:standard}{cite}
\letbibmacro{textcite:standard}{textcite}

\renewbibmacro*{cite}{%
  \ifentrytype{freeform}
    {\ifboolexpr{    not test {\ifciteseen}
                 and not test {\iffieldundef{firstcite}}}
       {\printfield{firstcite}}
       {\printfield{cite}}%
     \setunit{\multicitedelim}}
    {\usebibmacro{cite:standard}}}

\renewbibmacro*{textcite}{%
  \ifentrytype{freeform}
    {\ifboolexpr{    not test {\ifciteseen}
                 and not test {\iffieldundef{firstcite}}}
       {\printfield{firstcite}}
       {\printfield{cite}}}
    {\usebibmacro{textcite:standard}}}


\DeclareSourcemap{
  \maps[datatype=bibtex,overwrite=false]{
    \map{
      \pertype{freeform}
      \step[fieldsource=bibliography, final]
      \step[fieldset=sortkey, origfieldval]
      \step[fieldset=cite, origfieldval]
    }
  }
}

\begin{filecontents}{\jobname.bib}
@freeform{cfr,
  bibliography = {Charter of Fundamental Rights of the European Union},
}
@freeform{foo,
  cite         = {Foo},
  bibliography = {Foobar},
}
@freeform{goo,
  firstcite    = {Gfoo},
  cite         = {Goo},
  bibliography = {Goobar},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}


\begin{document}
\autocite{sigfridsson,cfr,foo}

\autocite{goo}

\autocite{goo}
\printbibliography
\end{document}

欧洲联盟基本权利宪章。

相关内容