BibLaTeX:更改引用的完成方式並替換引文中的 URL 標籤

BibLaTeX:更改引用的完成方式並替換引文中的 URL 標籤

我正在使用 \parencite 並且它正在工作,但我想知道是否可以:

1 - 在作者和年份之間加上逗號。從(世界衛生組織,1986)到(世界衛生組織,1986)

2 - 在參考文獻中使用首字母縮略詞(或手動替換來編寫任何內容),即使在參考書目中它不是首字母縮略詞。從(世界衛生組織,1986)到(世界衛生組織,1986)

和:

3- 如何將參考書目引文中的“URL”替換為“Disponível em”。

範例:來自

“世界衛生組織(1986)。渥太華健康促進憲章。URL:blabla(acedido em 31/03/2015)。”

「世界衛生組織(1986 年)。《渥太華健康促進憲章》。Disponível em:blabla(acedido em 31/03/2015)。

4- 顯示重複作者。

代碼:

\documentclass{article}
\usepackage[portuguese]{babel}
\usepackage{csquotes}
\usepackage[backend=biber,style=authoryear]{biblatex}
\addbibresource{\jobname.bib}
\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@online{WHO1,
    author = {World{\ }Health{\ }Organization},
    title = {The Ottawa Charter for Health Promotion},
    year = {1986},
    url = {http://www.who.int/healthpromotion/conferences/previous/ottawa/en/},
    urldate = {2015-03-31},
}
@online{WHO2,
    author = {World{\ }Health{\ }Organization},
    title = {The Ottawa Charter for Health Promotion},
    year = {1987},
    url = {http://www.who.int/healthpromotion/conferences/previous/ottawa/en/},
    urldate = {2015-03-31},
}
\end{filecontents}

\begin{document}

\parencite{WHO1}
...
\parencite{WHO2}

\printbibliography

\end{document}

結果:

在此輸入影像描述

期望的結果:

(世界衛生組織,1986 年)...(世界衛生組織,1987 年)

參考文獻

世界衛生組織(1986)。渥太華健康促進憲章。處理方式:blabla(2015 年 3 月 31 日造訪)。

世界衛生組織(1987)。渥太華健康促進憲章。處理方式:blabla(2015 年 3 月 31 日造訪)。

(我不得不使用 blabla 因為我僅限於兩個連結)

答案1

要在引文標籤中的名稱和年份之間加上逗號:

\renewcommand\nameyeardelim{\addcomma\addspace}

若要在引文中使用不同的作者姓名,請新增

shortauthor = {WHO}

到相關的參考書目條目。

如果您希望作者姓名在參考書目中重複,而不是被第一個實例之後的行替換,請傳遞biblatexpackage 選項dashed=false。 [謝謝喬恩對(4)的解釋。

對於標籤,你應該, 我思考, 能夠說

\DefineBibliographyStrings{portuguese}{url={Disponível em}}

然而,這似乎不起作用,而添加urlseen={been there, done that},雖然在其他方面是不可取的,但確實具有看起來有效的優點。

所以看來您必須重新定義欄位格式,因為該欄位不使用url bibstring而是使用\mkbibacro{URL}。一種方法是使用

\DeclareFieldFormat{url}{\bibstring{url}\addcolon\space\url{#1}}

bibstring它被修改為以與類似字段格式相同的方式使用urlseen.然而,它讓我無法理解bibstring url在這種情況下應該做什麼,所以這看起來更像是駭客而不是正確的解決方案。

\begin{filecontents}{\jobname.bib}
@online{WHO1,
    author = {{World Health Organization}},
    shortauthor = {WHO},
    title = {The {Ottawa} Charter for Health Promotion},
    year = {1986},
    url = {http://www.who.int/healthpromotion/conferences/previous/ottawa/en/},
    urldate = {2015-03-31},
}
@online{WHO2,
    author = {{World Health Organization}},
    shortauthor = {WHO},
    title = {The {Ottawa} Charter for Health Promotion},
    year = {1987},
    url = {http://www.who.int/healthpromotion/conferences/previous/ottawa/en/},
    urldate = {2015-03-31},
}
\end{filecontents}
\documentclass[portuguese]{article}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[backend=biber,style=authoryear,dashed=false]{biblatex}
\addbibresource{\jobname.bib}
\renewcommand\nameyeardelim{\addcomma\addspace}
\DefineBibliographyStrings{portuguese}{%
  url={Disponível em},
}
\DeclareFieldFormat{url}{\bibstring{url}\addcolon\space\url{#1}}
\begin{document}
\parencite{WHO1}

\parencite{WHO2}
\printbibliography
\end{document}

所以這只是部分答案。 (有人提到過「每個問題一個問題」規則嗎?有助於保持網站整潔...)

3 位和 1 個 hack 的演示

答案2

我相信您想更改鍵“urlseen”,它指出了,所以您應該給出的命令是:

\DefineBibliographyStrings{portuguese}{urlseen={Disponível em}}

相關內容