如何设置对'sentence case'的引用?
How to set references to 'sentence case'?
虽然我在 bibliography.bib
中的条目都是句子大小写,但我的参考文献变成标题大小写(红色下划线)。我该如何解决这个问题?
编辑: @user2554330 的回答表明必须编辑 *.csl
文件。由于rmarkdown使用Chicago author-date format for citations and references by default it would be helpful to know where exactly in the *.csl
the 'text case'
编辑可以查到
Rmarkdown 代码:
---
title: 'Untitled'
output: pdf_document
bibliography: "bibliography.bib"
---
Lorem ipsum dolor sit amet [@einstein_ist_1905; @hawking_thermodynamics_1983].
# References
<div id="refs"></div>
bibliography.bib
的内容:
@article{einstein_ist_1905,
title = {Ist die {Trägheit} eines {Körpers} von seinem {Energieinhalt} abhängig?},
volume = {323},
url = {https://s3.amazonaws.com/objects.readcube.com/articles/downloaded/wiley/a56a92baf12b80889d9de6f28f51f22f8bec1a2b366de4e8171f0d47e890d37a.pdf?response-content-disposition=attachment%3B%20filename%3D%22Einstein-1905-Annalen_der_Physik.pdf%22&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIS5LBPCM5JPOCDGQ%2F20170830%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20170830T124037Z&X-Amz-Expires=127162&X-Amz-SignedHeaders=host&X-Amz-Signature=3de93a7b9a7edbcc0676232820c448641df14f4a22d339ad07a8cc06200d7632},
doi = {doi:10.1002/andp.19053231314},
urldate = {2017-08-30},
journal = {Ann. Phys.},
author = {Einstein, Albert},
year = {1905},
pages = {639--641},
file = {a56a92baf12b80889d9de6f28f51f22f8bec1a2b366de4e8171f0d47e890d37a.pdf:C\:\Users\jay\Zotero\storage\TTPHSMIX\a56a92baf12b80889d9de6f28f51f22f8bec1a2b366de4e8171f0d47e890d37a.pdf:application/pdf}
}
@article{hawking_thermodynamics_1983,
title = {Thermodynamics of black holes in anti-de {Sitter} space},
volume = {87},
issn = {0010-3616, 1432-0916},
url = {http://link.springer.com/10.1007/BF01208266},
doi = {10.1007/BF01208266},
language = {en},
number = {4},
urldate = {2017-10-13},
journal = {Communications in Mathematical Physics},
author = {Hawking, S. W. and Page, Don N.},
month = dec,
year = {1983},
pages = {577--588},
file = {57cae4b908ae3ac722b1eaa1.pdf:C\:\Users\jay\Zotero\storage\DZ38DDCK\57cae4b908ae3ac722b1eaa1.pdf:application/pdf}
}
Session 信息
> sessionInfo()
R version 3.5.2 (2018-12-20)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_3.5.2 backports_1.1.3 rprojroot_1.3-2 htmltools_0.3.6 tools_3.5.2
[6] yaml_2.2.0 Rcpp_1.0.0 rmarkdown_1.8 knitr_1.21 xfun_0.4
[11] digest_0.6.18 evaluate_0.12
> rmarkdown::pandoc_version()
[1] ‘1.19.2.1’
# MiKTeX 2.9
您可以使用 YAML header 中的 csl
字段指定您想要的样式,例如
---
title: 'Untitled'
output: pdf_document
bibliography: "bibliography.bib"
csl: the-astronomical-journal.csl
---
大量 collection 样式可在 http://zotero.org/styles, and more details of bibliography handling are at https://rmarkdown.rstudio.com/authoring_bibliographies_and_citations.html 浏览。
编辑添加:如果你有一个 csl
文件,除了大写外都很好,那么只需删除像 text-case="capitalize-first"
、text-case="title"
和 [=16= 这样的行] 在处理不良案例的字段上,您在 bib
文件中使用的任何大写字母都将被复制到参考书目中。
进一步编辑:如果您的目标是 PDF 输出,您可以使用 natbib
或 biblatex
来生成您的参考书目,并使用任何适用于这些的 BibTeX 样式。您甚至可以使用命令行命令 latex makebst
来制作您自己的自定义样式。如果您选择将样式 foo.bst
与 natbib
结合使用,您的 YAML 应该看起来像
---
title: 'Untitled'
output:
pdf_document:
citation_package: natbib
bibliography: "bibliography.bib"
biblio-style: foo
---
与 csl
样式相比,它的优势在于它会尊重 bib
文件中的大写标记,同时允许根据您的喜好进行更改。
虽然我在 bibliography.bib
中的条目都是句子大小写,但我的参考文献变成标题大小写(红色下划线)。我该如何解决这个问题?
编辑: @user2554330 的回答表明必须编辑 *.csl
文件。由于rmarkdown使用Chicago author-date format for citations and references by default it would be helpful to know where exactly in the *.csl
the 'text case'
编辑可以查到
Rmarkdown 代码:
---
title: 'Untitled'
output: pdf_document
bibliography: "bibliography.bib"
---
Lorem ipsum dolor sit amet [@einstein_ist_1905; @hawking_thermodynamics_1983].
# References
<div id="refs"></div>
bibliography.bib
的内容:
@article{einstein_ist_1905,
title = {Ist die {Trägheit} eines {Körpers} von seinem {Energieinhalt} abhängig?},
volume = {323},
url = {https://s3.amazonaws.com/objects.readcube.com/articles/downloaded/wiley/a56a92baf12b80889d9de6f28f51f22f8bec1a2b366de4e8171f0d47e890d37a.pdf?response-content-disposition=attachment%3B%20filename%3D%22Einstein-1905-Annalen_der_Physik.pdf%22&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIS5LBPCM5JPOCDGQ%2F20170830%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20170830T124037Z&X-Amz-Expires=127162&X-Amz-SignedHeaders=host&X-Amz-Signature=3de93a7b9a7edbcc0676232820c448641df14f4a22d339ad07a8cc06200d7632},
doi = {doi:10.1002/andp.19053231314},
urldate = {2017-08-30},
journal = {Ann. Phys.},
author = {Einstein, Albert},
year = {1905},
pages = {639--641},
file = {a56a92baf12b80889d9de6f28f51f22f8bec1a2b366de4e8171f0d47e890d37a.pdf:C\:\Users\jay\Zotero\storage\TTPHSMIX\a56a92baf12b80889d9de6f28f51f22f8bec1a2b366de4e8171f0d47e890d37a.pdf:application/pdf}
}
@article{hawking_thermodynamics_1983,
title = {Thermodynamics of black holes in anti-de {Sitter} space},
volume = {87},
issn = {0010-3616, 1432-0916},
url = {http://link.springer.com/10.1007/BF01208266},
doi = {10.1007/BF01208266},
language = {en},
number = {4},
urldate = {2017-10-13},
journal = {Communications in Mathematical Physics},
author = {Hawking, S. W. and Page, Don N.},
month = dec,
year = {1983},
pages = {577--588},
file = {57cae4b908ae3ac722b1eaa1.pdf:C\:\Users\jay\Zotero\storage\DZ38DDCK\57cae4b908ae3ac722b1eaa1.pdf:application/pdf}
}
Session 信息
> sessionInfo()
R version 3.5.2 (2018-12-20)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_3.5.2 backports_1.1.3 rprojroot_1.3-2 htmltools_0.3.6 tools_3.5.2
[6] yaml_2.2.0 Rcpp_1.0.0 rmarkdown_1.8 knitr_1.21 xfun_0.4
[11] digest_0.6.18 evaluate_0.12
> rmarkdown::pandoc_version()
[1] ‘1.19.2.1’
# MiKTeX 2.9
您可以使用 YAML header 中的 csl
字段指定您想要的样式,例如
---
title: 'Untitled'
output: pdf_document
bibliography: "bibliography.bib"
csl: the-astronomical-journal.csl
---
大量 collection 样式可在 http://zotero.org/styles, and more details of bibliography handling are at https://rmarkdown.rstudio.com/authoring_bibliographies_and_citations.html 浏览。
编辑添加:如果你有一个 csl
文件,除了大写外都很好,那么只需删除像 text-case="capitalize-first"
、text-case="title"
和 [=16= 这样的行] 在处理不良案例的字段上,您在 bib
文件中使用的任何大写字母都将被复制到参考书目中。
进一步编辑:如果您的目标是 PDF 输出,您可以使用 natbib
或 biblatex
来生成您的参考书目,并使用任何适用于这些的 BibTeX 样式。您甚至可以使用命令行命令 latex makebst
来制作您自己的自定义样式。如果您选择将样式 foo.bst
与 natbib
结合使用,您的 YAML 应该看起来像
---
title: 'Untitled'
output:
pdf_document:
citation_package: natbib
bibliography: "bibliography.bib"
biblio-style: foo
---
与 csl
样式相比,它的优势在于它会尊重 bib
文件中的大写标记,同时允许根据您的喜好进行更改。