summaryrefslogtreecommitdiff
path: root/support/make4ht
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2022-03-23 03:01:06 +0000
committerNorbert Preining <norbert@preining.info>2022-03-23 03:01:06 +0000
commit8a64caefc9bb0d4afe66b6bf09cf8f283a5e386e (patch)
treec6574d20d0007892968e557a7984fbfb1a5e7664 /support/make4ht
parent51119d11f3700a5be7da086dacad56dd219a5c90 (diff)
CTAN sync 202203230301
Diffstat (limited to 'support/make4ht')
-rw-r--r--support/make4ht/changelog.tex19
-rw-r--r--support/make4ht/extensions/make4ht-ext-preprocess_input.lua5
-rw-r--r--support/make4ht/formats/make4ht-odt.lua4
-rwxr-xr-xsupport/make4ht/make4ht2
-rw-r--r--support/make4ht/make4ht-doc.pdfbin153809 -> 154182 bytes
-rw-r--r--support/make4ht/mkparams.lua14
6 files changed, 38 insertions, 6 deletions
diff --git a/support/make4ht/changelog.tex b/support/make4ht/changelog.tex
index d4a50d29cf..1d579d4514 100644
--- a/support/make4ht/changelog.tex
+++ b/support/make4ht/changelog.tex
@@ -3,6 +3,25 @@
\begin{itemize}
\item
+ 2022/02/22
+
+ \begin{itemize}
+ \tightlist
+ \item
+ version \texttt{0.3l} released.
+ \item
+ fixed issues with filenames on Windows.
+ \end{itemize}
+\item
+ 2022/03/01
+
+ \begin{itemize}
+ \tightlist
+ \item
+ use \texttt{rmarkdown} package to process \texttt{.rmd} files in the
+ \texttt{preprocess\_input} extension (thanks to James Clawson).
+ \end{itemize}
+\item
2022/02/18
\begin{itemize}
diff --git a/support/make4ht/extensions/make4ht-ext-preprocess_input.lua b/support/make4ht/extensions/make4ht-ext-preprocess_input.lua
index 3155a8a781..306c7bf772 100644
--- a/support/make4ht/extensions/make4ht-ext-preprocess_input.lua
+++ b/support/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/support/make4ht/formats/make4ht-odt.lua b/support/make4ht/formats/make4ht-odt.lua
index 01a587aff4..3f0ee3aaa8 100644
--- a/support/make4ht/formats/make4ht-odt.lua
+++ b/support/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/support/make4ht/make4ht b/support/make4ht/make4ht
index b938fdede1..7d579fafea 100755
--- a/support/make4ht/make4ht
+++ b/support/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/support/make4ht/make4ht-doc.pdf b/support/make4ht/make4ht-doc.pdf
index 665ad1fea4..bf3b9a4795 100644
--- a/support/make4ht/make4ht-doc.pdf
+++ b/support/make4ht/make4ht-doc.pdf
Binary files differ
diff --git a/support/make4ht/mkparams.lua b/support/make4ht/mkparams.lua
index e330b6a0ab..ed766f9770 100644
--- a/support/make4ht/mkparams.lua
+++ b/support/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