summaryrefslogtreecommitdiff
path: root/biblio/citation-style-language/citeproc-latex.lua
diff options
context:
space:
mode:
Diffstat (limited to 'biblio/citation-style-language/citeproc-latex.lua')
-rw-r--r--biblio/citation-style-language/citeproc-latex.lua35
1 files changed, 19 insertions, 16 deletions
diff --git a/biblio/citation-style-language/citeproc-latex.lua b/biblio/citation-style-language/citeproc-latex.lua
index 19348635b0..cce8f2a191 100644
--- a/biblio/citation-style-language/citeproc-latex.lua
+++ b/biblio/citation-style-language/citeproc-latex.lua
@@ -22,17 +22,6 @@ csl.citations_pre = {}
csl.preview_mode = false -- Whether to use citeproc:preview_citation
-function csl.error(str)
- luatexbase.module_error("csl", str)
-end
-function csl.warning(str)
- luatexbase.module_warning("csl", str)
-end
-function csl.info(str)
- luatexbase.module_info("csl", str)
-end
-
-
function csl.init(style_name, bib_files, lang)
bib_files = util.split(util.strip(bib_files), "%s*,%s*")
@@ -68,10 +57,24 @@ end
function csl.register_citation_info(citation_info)
local citation = core.make_citation(citation_info)
- for _, cite_item in ipairs(citation.citationItems) do
- if not csl.id_map[cite_item.id] then
- table.insert(csl.id_list, cite_item.id)
- csl.id_map[cite_item.id] = true
+ if citation.citationID == "@nocite" then
+ for _, cite_item in ipairs(citation.citationItems) do
+ if cite_item.id == "*" then
+ -- \nocite all items
+ core.uncite_all_items = true
+
+ elseif not csl.uncited_id_map[cite_item.id] then
+ table.insert(csl.uncited_id_list, cite_item.id)
+ csl.uncited_id_map[cite_item.id] = true
+ end
+ end
+
+ else
+ for _, cite_item in ipairs(citation.citationItems) do
+ if not csl.id_map[cite_item.id] then
+ table.insert(csl.id_list, cite_item.id)
+ csl.id_map[cite_item.id] = true
+ end
end
end
end
@@ -137,7 +140,7 @@ end
function csl.bibliography()
if not csl.engine then
- csl.error("CSL engine is not initialized.")
+ util.error("CSL engine is not initialized.")
return
end