From 7b8bd496c62a5a8e18fb7a038217d4118c02b1e2 Mon Sep 17 00:00:00 2001
From: Norbert Preining <norbert@preining.info>
Date: Tue, 13 Dec 2022 03:02:44 +0000
Subject: CTAN sync 202212130302

---
 macros/luatex/latex/scikgtex/scikgtex.sty | 149 ++++++++++++++++++++++++++++++
 1 file changed, 149 insertions(+)
 create mode 100644 macros/luatex/latex/scikgtex/scikgtex.sty

(limited to 'macros/luatex/latex/scikgtex/scikgtex.sty')

diff --git a/macros/luatex/latex/scikgtex/scikgtex.sty b/macros/luatex/latex/scikgtex/scikgtex.sty
new file mode 100644
index 0000000000..9f94c11a1b
--- /dev/null
+++ b/macros/luatex/latex/scikgtex/scikgtex.sty
@@ -0,0 +1,149 @@
+%% ----------------------------------------------------------------
+%% scikgtex --- Scientific Knowledge Graph TeX (SciKgTeX) is a 
+%% LuaLaTeX package which makes it possible to annotate specific
+%% research contributions in scientific documents. SciKGTeX will 
+%% enrich the document by adding marked contributions to PDF
+%% metadata in a structured XMP format which can be picked up by 
+%% Search Engines and Knowledge Graphs.
+%% More information on how to use the package can be found here: 
+%% https://github.com/Christof93/SciKGTeX#readme
+%%
+%% Author: Christof Bless
+%% E-mail: christofbless@gmail.com
+%% Released under the MIT License 
+%% See https://opensource.org/licenses/MIT
+%% ----------------------------------------------------------------
+%% 
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{scikgtex}[2022/11/13 v2.1.1]
+
+\def\useignorespacesandallpars#1\ignorespaces\fi{%
+#1\fi\ignorespacesandallpars}
+
+\makeatletter
+\def\ignorespacesandallpars{%
+  \@ifnextchar\par
+    {\expandafter\ignorespacesandallpars\@gobble}%
+    {}%
+}
+\makeatother
+
+\RequirePackage{suffix}
+\RequirePackage{hyperref}
+
+\errorcontextlines=5
+
+\directlua {
+  SciKGTeX = require('scikgtex')
+}
+
+\newcommand{\addmetaproperty}[2][]{%
+  \directlua{%
+    local new_property = "\luaescapestring{\unexpanded{#2}}"%
+    local ns = "\luaescapestring{\unexpanded{#1}}"%
+    SciKGTeX:add_property(new_property, ns)%
+  }%
+  \ignorespaces
+}%
+
+\newcommand{\newpropertycommand}[2][]{%
+  \directlua{%
+    local new_property = "\luaescapestring{\unexpanded{#2}}"%
+    local ns = "\luaescapestring{\unexpanded{#1}}"%
+    SciKGTeX:make_new_command(new_property, ns)%
+  }%
+  \ignorespaces
+}%
+
+\newcommand{\metatitle}[2][]{%
+  \directlua{%
+    local value = "\luaescapestring{\unexpanded{#2}}"%
+    SciKGTeX.XMP:set_title(value)%
+  }%
+  #2%
+}%
+
+\WithSuffix\newcommand\metatitle*[2][]{%
+  \directlua{%
+    local value = "\luaescapestring{\unexpanded{#2}}"%
+    SciKGTeX.XMP:set_title(value)%
+  }%
+  \ignorespaces
+}%
+
+\newcommand{\metaauthor}[2][]{%
+  \directlua{%
+    local value = "\luaescapestring{\unexpanded{#2}}"%
+    SciKGTeX.XMP:add_author(value)%
+  }%
+  #2%
+}%
+
+\WithSuffix\newcommand\metaauthor*[2][]{%
+  \directlua{%
+    local value = "\luaescapestring{\unexpanded{#2}}"%
+    SciKGTeX.XMP:add_author(value)%
+  }%
+  \ignorespaces
+}%
+
+\newcommand{\researchfield}[2][]{%
+  \directlua{%
+    local value = "\luaescapestring{\unexpanded{#2}}"%
+    SciKGTeX.XMP:set_researchfield(value)%
+  }%
+  #2%
+}%
+
+\WithSuffix\newcommand\researchfield*[2][]{%
+  \directlua{%
+    local value = "\luaescapestring{\unexpanded{#2}}"%
+    SciKGTeX.XMP:set_researchfield(value)%
+  }%
+  \ignorespaces
+}%
+
+\newcommand{\uri}[2]{%
+  \directlua{%
+    local label = "\luaescapestring{\unexpanded{#2}}"%
+    local uri = "\luaescapestring{\unexpanded{#1}}"%
+    SciKGTeX:print_entity(uri, label)%
+  }%
+}%
+
+\newcommand{\contribution}[3][]{%
+  \directlua{%
+    local contrib_n = "\luaescapestring{\unexpanded{#1}}"%
+    local property = "\luaescapestring{\unexpanded{#2}}"%
+    local value = "\luaescapestring{\unexpanded{#3}}"%
+    SciKGTeX.XMP:add_annotation(contrib_n, property, value, 'annotation-id')%
+  }%
+  #3%
+}%
+
+\WithSuffix\newcommand\contribution*[3][]{%
+  \directlua{%
+    local contrib_n = "\luaescapestring{\unexpanded{#1}}"%
+    local property = "\luaescapestring{\unexpanded{#2}}"%
+    local value = "\luaescapestring{\unexpanded{#3}}"%
+    SciKGTeX.XMP:add_annotation(contrib_n, property, value, 'annotation-id')%
+  }%
+  \ignorespaces
+}%
+
+\newpropertycommand{researchproblem}
+\newpropertycommand{result}
+\newpropertycommand{method}
+\newpropertycommand{objective}
+\newpropertycommand{conclusion}
+ 
+%% Copyright (C) 2022 by Christof Bless <christofbless@gmail.com>
+%% 
+%% This work may be distributed and/or modified under the
+%% conditions of the MIT License.
+%% 
+%% This work consists of the file scikgtex.sty
+%% and the lua file               scikgtex.lua.
+%% 
+%%
+%% End of file `scikgtex.sty'.
-- 
cgit v1.2.3

