-
Notifications
You must be signed in to change notification settings - Fork 841
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
中文参考文献顺序有误 #152
Comments
还有一些多音字,如曾,也给放到了ceng。 |
原来是这样啊,那以后还是要检查一下了 |
同样遇到了这个问题。鉴于中文作者姓氏遇到多音字是较为可能的情形,作者是否有可能采用添加拼音信息域或类似做法,规定一些姓氏中常见多音字的默认读音? 不胜感谢! 您的忠实用户 |
Zotero 目前使用的 |
原来如此,了解了,非常感谢! 我去Zotero Forum上开个帖子…… |
最近 |
在 MS Word 中使用 Zotero 插件可以实现参考文献按拼音排序,但在 Pandoc 或 Quarto 中使用同一份 CSL 文件,参考文献列表无法按照拼音排序,而是按照汉字的 Unicode 值排序的,请问这个问题有解决办法吗? |
设置了 可以考虑说服这些项目的作者支持该功能,或者自己实现发 PR。 |
@zepinglee 感谢回复,设置了 |
这个大致是 UCA,我自己的 zepinglee/citeproc-lua 所依赖的 michal-h21/lua-uca 目前也没有实现中文的。 |
分享一个粗糙的 Python 脚本,通过处理 # Sort the Chinese bibliographies in Word document based on Pinyin
# The script assumes that the bibliography starts with the keyword "参考文献"
# The script will lead to the rot of cross-references and disappear of hyperlinks
from docx import Document
from pypinyin import pinyin, Style
# Open the document
doc = Document("input.docx")
paras = doc.paragraphs
# Look for keyword to find the start of the bibliography
for i, para in enumerate(paras):
if "参考文献" in para.text:
biblio_start = i + 1
break
# Separate the bibliography and the rest of the document
front_matter = paras[:biblio_start]
links = [p.text for p in paras[biblio_start:]]
# Append all the bibliography entries to name_list
name_list = [(link, link.split(' ')[0]) for link in links]
# Function to handle special cases
def special_pinyin(name):
if name.startswith('曾'):
return 'zeng'
else:
return "".join([i[0] for i in pinyin(name, style=Style.TONE3)])
# Sort name_list by turning it into a list of tuples
sorted_references = sorted(name_list, key=lambda x: special_pinyin(x[1]))
# Re-write the sorted references back into paras
for i, item in enumerate(sorted_references):
paras[biblio_start + i].text = item[0]
doc.save('output.docx') |
你好,我发现自动生成的中文文献顺序有误,应该是按中文作者首字母顺序排列,但我这里的第一条文献排序出错,其他文献正常。
这里第一条首字母是S,后面从C开始。
The text was updated successfully, but these errors were encountered: