Skip to content

Commit

Permalink
Fix 7073a if names require braces
Browse files Browse the repository at this point in the history
* See toBibtex.person, braces seem necessary if no family name is detected
* Addresses #106
  • Loading branch information
mwmclean committed Sep 25, 2024
1 parent 5e5d7d4 commit b824e45
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
2 changes: 1 addition & 1 deletion R/toBiblatex.R
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ EncodedNameListToLaTeX <- function(name.list, encoding = "UTF-8")
{
formatted.text <- format_author(name.list)
out <- encoded_text_to_latex(formatted.text, encoding)
if (grepl("^[?]", out))
if (grepl("^[{]?[?]", out))
return(formatted.text)
return(out)
}
27 changes: 18 additions & 9 deletions tests/testthat/test-tobiblatex.R
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
bib = BibEntry(bibtype = "article",
key = "shiotsuki2011kasai",
title = "葛西賢太著,『現代瞑想論-変性意識がひらく世界-』",
author = "塩,亮子 and 葛西,賢太",
journal = "宗教と社会",
volume = 17,
pages = "67--69",
year = 2011,
publisher = "「宗教と社会」学会")
bib <- c(BibEntry(bibtype = "article",
key = "shiotsuki2011kasai",
title = "葛西賢太著,『現代瞑想論-変性意識がひらく世界-』",
author = "塩,亮子 and 葛西,賢太",
journal = "宗教と社会",
volume = 17,
pages = "67--69",
year = 2011,
publisher = "「宗教と社会」学会"),
BibEntry(bibtype = "article",
key = "hiromitsu2022altered",
title = "意識状態の変容と脳内ネットワーク",
author = "弘光健太郎 and ヒロミツケンタロウ",
journal = "鶴見大学仏教文化研究所紀要",
volume = 27,
pages = "53--66",
year = 2022,
publisher = "鶴見大学"))

test_that("toBiblatex doesn't replace CJK character name lists with ???? (#106)",
{
Expand Down

0 comments on commit b824e45

Please sign in to comment.