File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change 1+ --- translate-zotero.lua – filter to translate elements
2+ --- https://github.com/estedeahora/guri/tree/main/inst/files-pkg/filters/translate-zotero.lua
3+ --- The filter is part of the R package {guri}.
4+ ---
5+ --- Copyright: © 2024 Pablo Santiago SERRATI
6+ --- License: CC-by-nc-sa. The licence for this filter is the same as for the {guri} package
7+ --- (see https://github.com/estedeahora/guri/).
8+
9+ -- Summary:
10+ -- The translate-zotero.lua is a Pandoc Lua filter that translates citation elements (coming
11+ -- from zotero plug-in for word in 'fields').
12+
13+ local stringify = pandoc .utils .stringify
14+
15+ function Cite (cite )
16+
17+ local cite_text = stringify (cite )
18+
19+ for k , citation in ipairs (cite .citations ) do
20+ prefix = stringify (citation .prefix )
21+ if # prefix > 0 then
22+ prefix = stringify (citation .prefix ) .. " "
23+ end
24+ if cite_text :match (' ^%(' .. prefix .. ' [0-9][0-9][0-9]' ) then
25+ citation .mode = " SuppressAuthor"
26+ end
27+ end
28+
29+ return cite
30+ end
You can’t perform that action at this time.
0 commit comments