From 39207a02179eab0fca34dfb7bb8dbbb6215fdc7a Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 21 Jan 2022 22:58:35 +0000 Subject: citation-style-language (21jan22) git-svn-id: svn://tug.org/texlive/trunk@61687 c570f23f-e606-0410-a88d-b1316a301751 --- .../source/latex/citation-style-language/README.md | 68 ++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 Master/texmf-dist/source/latex/citation-style-language/README.md (limited to 'Master/texmf-dist/source/latex/citation-style-language') diff --git a/Master/texmf-dist/source/latex/citation-style-language/README.md b/Master/texmf-dist/source/latex/citation-style-language/README.md new file mode 100644 index 00000000000..c89a928bcb3 --- /dev/null +++ b/Master/texmf-dist/source/latex/citation-style-language/README.md @@ -0,0 +1,68 @@ +# `citeproc-lua` + +## Create an engine instance +```lua +local citeproc = require("citeproc") +local engine = citeproc.new(sys, style) +``` + +The `sys` is a table which must contain `retrieveLocale()` and `retrieveItem()` functions. Thet are called to feed the engine with inputs. + + + +## `updateItems()` + +The `updateItems()` method refreshes the registry of the engine. +```lua +params, result = engine:updateItems(ids) +``` +The `ids` is just a list of `id`s. +```lua +ids = {"ITEM-1", "ITEM-2"} +``` + + +## `makeCitationCluster()` + +The `makeCitationCluster()` method is called to generate a citation of (possibly) multiple items. + +```lua +params, result = engine:makeCitationCluster(cite_items) +``` + +The `cite_items` is a list of tables which contain the `id` and other options (not implemented). + +```lua +cite_items = { + { id = "ITEM-1" }, + { id = "ITEM-2" } +} +``` + +Returns: +```lua +"(D’Arcus, 2005; Bennett, 2009)" +``` + +The more complicated method `processCitationCluster()` is not implemented yet. + +## `makeBibliography()` + +The `makeBibliography()` method produces the bibliography and parameters required for formatting. +```lua +result = engine:makeBibliography() +``` + +Returns: +```lua +result = { + { + hangingindent = false, + ["second-field-align"] = false, + }, + { + '
B. D’Arcus, Boundaries of Dissent: Protest and State Power in the Media Age, Routledge, 2005.
', + '
F.G. Bennett Jr., “Getting Property Right: ‘Informal’ Mortgages in the Japanese Courts,” Pac. Rim L. & Pol’y J., vol. 18, Aug. 2009, pp. 463–509.
' + } +} +``` -- cgit v1.2.3