biblatex:在程式/書名中保留大寫

biblatex:在程式/書名中保留大寫

我正在使用 Biblatex-APA/Biber 和 LyX 以及由 Mendeley 生成的 Bibtex 檔案。我可以毫無問題地產生參考書目,但我想更改 inproceedings/booktitle 的參考樣式。目前,我的參考資料如下:

Cole, R., Purao, S., Rossi, M. & Sein, M. (2005). Being proactive: Where action research meets design research. In Proceedings of the 26th international conference on information systems.

來自我的 Bibtex 檔:

@inproceedings{Cole2005,
   author = {Cole, Robert and Purao, Sandeep and Rossi, Matti and Sein, Maung},
   booktitle = {Proceedings of the 26th International Conference on Information Systems},
   title = {{Being proactive: Where action research meets design research}},
   year = {2005}
}

現在我想保留我的訴訟程序/書名的大寫以獲得以下結果:

Cole, R., Purao, S., Rossi, M. & Sein, M. (2005). Being proactive: Where action
research meets design research. In Proceedings of the 26th International Conference
on Information Systems.

我嘗試過以下方法,但沒有成功。

\DeclareFieldFormat[inproceedings]{booktitle}{#1}

有什麼建議麼?

答案1

從參考書目樣式文件中apa.bbx

\DeclareFieldFormat[inproceedings]{booktitle}{#1}

不起作用,因為該booktitle欄位設定為\printfield[apacase]{booktitle},其中apacase格式指令定義為

\DeclareFieldFormat{apacase}{\MakeSentenceCase*{#1}}

booktitle若要保留條目類型中欄位的來源大小寫,@inproceedings您可以重新定義booktitle參考書目巨集或apacase文件序言中的指令。後一種方法的例子是:

\DeclareFieldFormat{apacase}{%
  \ifboolexpr{ test {\ifentrytype{inproceedings}}
    and ( test {\ifcurrentfield{booktitle}}
          or test {\ifcurrentfield{booksubtitle}} ) }
    {#1}{\MakeSentenceCase*{#1}}}

若要避免在除原始標題 ( origtitle) 和標題附加元件之外的所有內容中使用句子大小寫

\DeclareFieldFormat{apacase}{#1}

反而。由於biblatex-apa僅依賴帶有星號的變體,因此\MakeSentenceCase*您可以透過添加\DeclareCaseLangs{}到序言並使用檔案hyphenation中的欄位來避免所有句子大小寫bib

請注意,您可以避免透過欄位保護某些單字不被向下轉換subtitle。例如:

   title = {Being proactive},
   subtitle = {Where action research meets design research},

答案2

只需將問題字母放在花括號中即可保留特定的大寫字母。所以

@inproceedings{Cole2005,
   author = {Cole, Robert and Purao, Sandeep and Rossi, Matti and Sein, Maung},
   booktitle = {{Proceedings} of the 26th {International} {Conference} on {Information} {Systems}},
   title = {{Being proactive: Where action research meets design research}},
   year = {2005}
}

會做這項工作。但大多數時候,將整行放在花括號中會更容易,就像標題一樣。

答案3

當我在尋找一個方便的解決方案時(至少對我來說),我編寫了一個 Python 腳本來解析由 Mendeley 生成的本地 bib 檔案。腳本將書名放在兩個大括號中。

import re
import fileinput

library = 'path/to/file'

import re

def re_sub_verbose(pattern, replace, string):
  def substitute(match):
    return match.expand(replace)

  result = re.sub(pattern, substitute, string)

  return result

for line in fileinput.input(library, inplace=1):
    print re_sub_verbose("booktitle = \{(.*)\},", "booktitle = {{\\1}},", line)

相關內容