-
Notifications
You must be signed in to change notification settings - Fork 115
更新了使用Python脚本将引注链接到参考文献表的文档。 #363
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
Conversation
✅ 成功部署预览!
|
需要再更新一下文档 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
感谢!有一些修改建议,你可以按需采纳。
@@ -245,44 +245,49 @@ Public Sub ZoteroLinkCitation() | |||
|
|||
## Python 脚本 | |||
|
|||
通过使用 Python 的 pywin32 库,可以在 Python 中实现与 Word 宏类似的功能。 | |||
Python 包[noterools](https://github.com/Syize/noterools)提供了可以 zotero 的引用添加超链接的函数。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Python 包[noterools](https://github.com/Syize/noterools)提供了可以 zotero 的引用添加超链接的函数。 | |
Python 包 [noterools](https://github.com/Syize/noterools) 提供了为 Zotero 的引注添加超链接的方法。 |
from noterools import Word, add_citation_cross_ref_hook, add_cross_ref_style_hook | ||
|
||
if __name__ == '__main__': | ||
# 你想要添加超链接的Word文档路径 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# 你想要添加超链接的Word文档路径 | |
# 你想要添加超链接的 Word 文档路径 |
|
||
### 使用前的注意事项 | ||
|
||
- 本 Python 代码仅对引用格式为 `(作者, 年份)` 的文档做过测试 | ||
- `noterools`实际上也是通过操作 Word 来添加的超链接,由于依赖库的原因其只能在 Windows 环境下使用。 | ||
- 在为`(作者, 年份)`引用格式添加超链接时,`noterools`还会修正参考文献表中没有被正确设置为斜体的刊物名称或出版商名称。*顺序引用格式*目前还不支持此功能。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 在为`(作者, 年份)`引用格式添加超链接时,`noterools`还会修正参考文献表中没有被正确设置为斜体的刊物名称或出版商名称。*顺序引用格式*目前还不支持此功能。 | |
- 在为`(作者, 年份)`引用格式添加超链接时,`noterools`还支持修正参考文献表中没有被正确设置为斜体的刊名或出版商名称。**顺序引用格式目前还不支持此功能**。 |
# 为顺序引用格式添加超链接 | ||
add_citation_cross_ref_hook(word, is_numbered=True) | ||
# 为(作者, 年份)引用格式添加超链接,默认会将参考文献表中没有被正确设置为斜体的刊物名称或出版商设置为斜体 | ||
add_citation_cross_ref_hook(word, is_numbered=False) | ||
# 为(作者, 年份)引用格式添加超链接,不修正参考文献表 | ||
add_citation_cross_ref_hook(word, is_numbered=False, set_container_title_italic=False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
建议仅保留一个例子,其余两个注释掉,并在注释中说明按需取消注释,这样有助于理解。
好的,你可以随时 reopen 或发起新 pr,或是把这个 pr 转为 draft,完成后再 ready for review。 |
好的,感谢建议👍 |
No description provided.