summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2022-04-05 22:20:31 +0000
committerKarl Berry <karl@freefriends.org>2022-04-05 22:20:31 +0000
commit4c6781299b7ccd2769b41e5fcbb75c8f451e1061 (patch)
treefb5d662a36d30dd8744ec10242e5c9abac77c0d9 /Master/texmf-dist/scripts
parent980b7410cdd2e14152f006fdc1baa5041263b0b9 (diff)
make4ht (22mar22)
git-svn-id: svn://tug.org/texlive/trunk@62953 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts')
-rw-r--r--Master/texmf-dist/scripts/make4ht/extensions/make4ht-ext-preprocess_input.lua5
-rw-r--r--Master/texmf-dist/scripts/make4ht/formats/make4ht-odt.lua4
-rwxr-xr-xMaster/texmf-dist/scripts/make4ht/make4ht2
-rwxr-xr-xMaster/texmf-dist/scripts/make4ht/mkparams.lua14
4 files changed, 19 insertions, 6 deletions
diff --git a/Master/texmf-dist/scripts/make4ht/extensions/make4ht-ext-preprocess_input.lua b/Master/texmf-dist/scripts/make4ht/extensions/make4ht-ext-preprocess_input.lua
index 3155a8a7810..306c7bf7728 100644
--- a/Master/texmf-dist/scripts/make4ht/extensions/make4ht-ext-preprocess_input.lua
+++ b/Master/texmf-dist/scripts/make4ht/extensions/make4ht-ext-preprocess_input.lua
@@ -5,12 +5,13 @@ local mkutils = require "mkutils"
local commands = {
knitr = { command = 'Rscript -e "library(knitr); knit(\'${tex_file}\', output=\'${tmp_file}\')"'},
- pandoc = { command = 'pandoc -f ${input_format} -s -o \'${tmp_file}\' -t latex \'${tex_file}\''}
+ pandoc = { command = 'pandoc -f ${input_format} -s -o \'${tmp_file}\' -t latex \'${tex_file}\''},
+ render = { command = 'Rscript -e "library(rmarkdown); render(\'${tex_file}\', output_file=\'${tmp_file}\')"'}
}
local filetypes = {
rnw = {sequence = {"knitr"} },
rtex = {sequence = {"knitr"}},
- rmd = {sequence = {"knitr", "pandoc"}, options = {input_format = "markdown"}},
+ rmd = {sequence = {"render"}},
rrst = {sequence = {"knitr", "pandoc"}, options = {input_format = "rst"}},
md = {sequence = {"pandoc"}, options = {input_format = "markdown"}},
rst = {sequence = {"pandoc"}, options = {input_format = "rst"}},
diff --git a/Master/texmf-dist/scripts/make4ht/formats/make4ht-odt.lua b/Master/texmf-dist/scripts/make4ht/formats/make4ht-odt.lua
index 01a587aff47..3f0ee3aaa89 100644
--- a/Master/texmf-dist/scripts/make4ht/formats/make4ht-odt.lua
+++ b/Master/texmf-dist/scripts/make4ht/formats/make4ht-odt.lua
@@ -73,10 +73,10 @@ function Odtfile:pack()
lfs.chdir(self.archivelocation)
-- make temporary mime type file
self:make_mimetype()
- mkutils.execute(zip_command .. " -q0X '" .. self.name .. "' " .. self.mimetypename)
+ mkutils.execute(zip_command .. ' -q0X "' .. self.name .. '" ' .. self.mimetypename)
-- remove it, so the next command doesn't overwrite it
self:remove_mimetype()
- mkutils.execute(zip_command .." -r '" .. self.name .. "' *")
+ mkutils.execute(zip_command ..' -r "' .. self.name .. '" *')
lfs.chdir(currentdir)
mkutils.cp(self.archivelocation .. "/" .. self.name, self.name)
mkutils.delete_dir(self.archivelocation)
diff --git a/Master/texmf-dist/scripts/make4ht/make4ht b/Master/texmf-dist/scripts/make4ht/make4ht
index b938fdede1e..7d579fafeaa 100755
--- a/Master/texmf-dist/scripts/make4ht/make4ht
+++ b/Master/texmf-dist/scripts/make4ht/make4ht
@@ -29,7 +29,7 @@ make4ht [options] filename ["tex4ht.sty op." "tex4ht op." "t4ht op" "latex op"]
-- set version number. the template should be replaced by the
-- actual version number by the build script
-local version = "v0.3k"
+local version = "v0.3l"
mkparams.version_number = version
local args = mkparams.get_args()
diff --git a/Master/texmf-dist/scripts/make4ht/mkparams.lua b/Master/texmf-dist/scripts/make4ht/mkparams.lua
index e330b6a0abd..ed766f97708 100755
--- a/Master/texmf-dist/scripts/make4ht/mkparams.lua
+++ b/Master/texmf-dist/scripts/make4ht/mkparams.lua
@@ -93,6 +93,18 @@ local function get_format_extensions(format_string)
return format, extensions
end
+
+-- try to make safe filename
+local function escape_filename(input)
+ -- quoting don't work on Windows, so we will just
+ if os.type == "windows" then
+ return '"' .. input .. '"'
+ else
+ -- single quotes are safe in Unix
+ return "'" .. input .. "'"
+ end
+end
+
-- detect if user specified -jobname in arguments to the TeX engine
-- or used the --jobname option for make4ht
local function handle_jobname(input, args)
@@ -108,7 +120,7 @@ local function handle_jobname(input, args)
input = input:match("([^%/^%\\]+)$")
-- input also cannot contain spaces, replace them with underscores
input = input:gsub("%s", "_")
- table.insert(latex_params,"-jobname='"..input.. "'")
+ table.insert(latex_params,"-jobname=".. escape_filename(input))
else
-- when user specifies -jobname, we must change name of the input file,
-- in order to be able to process correct dvi file with tex4ht and t4ht