\DeclareLabelname 在 Emacs Org 模式下使用 Biblatex

\DeclareLabelname 在 Emacs Org 模式下使用 Biblatex

我有一個名為“film”的自訂 biblatex 條目類型。它有幾個自訂字段,特別是“導演”字段。

#+LaTeX_Header:雖然我可以讓它作為一個直接的 LaTeX 文件工作,但當從 Emacs 組織模式中設定時,我無法顯示「導演」欄位。我究竟做錯了什麼?

這是 LaTeX 版本:

\documentclass{article}
\usepackage[american]{babel}
\usepackage{csquotes}
\usepackage[style=apa, natbib]{biblatex}
\DeclareLanguageMapping{american}{american-apa}
\addbibresource{apamovie.bib}

\DeclareLabelname[film]{
  \field{director}
  \field{producer}
  \field{actor}
}

\begin{document}
I've read a book \citep{book}.
I've seen a movie \citep{highlander}.

\printbibliography
\end{document}

這是 Emacs org-mode 版本:

#+TITLE: LaTeX Output with Emacs org-mode
#+options: toc:nil
#+latex_header: \usepackage[american]{babel}
#+latex_header: \usepackage{csquotes}
#+latex_header: \usepackage[style=apa, natbib]{biblatex}
#+latex_header: \DeclareLanguageMapping{american}{american-apa}
#+latex_header: \addbibresource{./apamovie.bib}
#+latex_header: \DeclareLabelname[film]{\field{director}}

I've read a book cite:book. I've seen a film cite:highlander.

\printbibliography

這是.bib文件:

@Book{book,
  author =       {A. U. Thor},
  title =        {My first book},
  publisher =    {Methuen},
  year =         {1999}
}

@film{highlander,
  title =        {Highlander},                  
  director =     {Mulcahy, Russell},
  year =         {1986},
  publisher =    {Cannon Films},
  type =         {DVD}
}

以下是我在文件中設定新欄位和條目類型的方法init.el

;;-- Create custom fields for FILM entry type ----
(add-to-list 'bibtex-biblatex-field-alist
             '(("director" "Director(s) of a film, video or DVD title")
               ("producer" "Producer of the film title")
               ("actor" "Actor in the film title")
               ("distributor" "Distributor of a film title")))

;; Create FILM entry type
(add-to-list 'bibtex-biblatex-entry-alist
             '("Film" "Film, video or DVD"
               ("title" "year" "type")
               nil
               ("director" "address" "distributor")))

(require 'bibtex)
(bibtex-set-dialect 'biblatex)

相關內容