diff options
Diffstat (limited to 'tex/context/base/lpdf-fmt.lua')
-rw-r--r-- | tex/context/base/lpdf-fmt.lua | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/tex/context/base/lpdf-fmt.lua b/tex/context/base/lpdf-fmt.lua index 8250ce775..197e24ce9 100644 --- a/tex/context/base/lpdf-fmt.lua +++ b/tex/context/base/lpdf-fmt.lua @@ -17,7 +17,8 @@ local report_backend = logs.reporter("backend","profiles") local backends, lpdf = backends, lpdf -local codeinjections = backends.pdf.codeinjections -- normally it is registered +local codeinjections = backends.pdf.codeinjections + local variables = interfaces.variables local viewerlayers = attributes.viewerlayers local colors = attributes.colors @@ -626,10 +627,6 @@ end lpdf.registerdocumentfinalizer(flushoutputintents,2,"output intents") -directives.register("backend.format", function(v) - codeinjections.setformat(v) -end) - function codeinjections.setformat(s) local format, level, profile, intent, option, filename = s.format or "", s.level or "", s.profile or "", s.intent or "", s.option or "", s.file or "" @@ -713,6 +710,19 @@ function codeinjections.setformat(s) end end +directives.register("backend.format", function(v) -- table ! + local tv = type(v) + if tv == "table" then + codeinjections.setformat(v) + elseif tv == "string" then + codeinjections.setformat { format = v } + end +end) + +function commands.setformat(s) + codeinjections.setformat(s) +end + function codeinjections.getformatoption(key) return formatspecification and formatspecification[key] end |