summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts/make4ht/make4ht-htlatex.lua
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-01-23 21:55:17 +0000
committerKarl Berry <karl@freefriends.org>2020-01-23 21:55:17 +0000
commitf74db910cfdba799460326738cc42e0ee57c3366 (patch)
tree95fc397a27f88691852418443c83f224ebe991bf /Master/texmf-dist/scripts/make4ht/make4ht-htlatex.lua
parent0b9bafc4f15f46c47c222b08f16cb2c276358cdc (diff)
make4ht (23jan20)
git-svn-id: svn://tug.org/texlive/trunk@53514 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts/make4ht/make4ht-htlatex.lua')
-rwxr-xr-xMaster/texmf-dist/scripts/make4ht/make4ht-htlatex.lua21
1 files changed, 19 insertions, 2 deletions
diff --git a/Master/texmf-dist/scripts/make4ht/make4ht-htlatex.lua b/Master/texmf-dist/scripts/make4ht/make4ht-htlatex.lua
index 214972e8bb9..f141070406b 100755
--- a/Master/texmf-dist/scripts/make4ht/make4ht-htlatex.lua
+++ b/Master/texmf-dist/scripts/make4ht/make4ht-htlatex.lua
@@ -51,11 +51,17 @@ Make.latex_command = "${htlatex} --interaction=${interaction} ${latex_par} '\\ma
"\\documentstyle[tex4ht]}}}\\makeatother\\HCode ${tex4ht_sty_par}.a.b.c."..
"\\input \"\\detokenize{${tex_file}}\"'"
+Make.plain_command = '${htlatex} --interaction=${interaction} ${latex_par}' ..
+"'\\def\\Link#1.a.b.c.{\\expandafter\\def\\csname tex4ht\\endcsname{\\expandafter\\def\\csname tex4ht\\endcsname{#1,html}\\input tex4ht.sty }}" ..
+"\\def\\HCode{\\futurelet\\HCode\\HChar}\\def\\HChar{\\ifx\"\\HCode\\def\\HCode\"##1\"{\\Link##1}\\expandafter\\HCode\\else\\expandafter\\Link\\fi}" ..
+"\\HCode ${tex4ht_sty_par}.a.b.c.\\input \"\\detokenize{${tex_file}}\"'"
+
local m = {}
-function m.htlatex(par)
- local command = Make.latex_command
+function m.htlatex(par, latex_command)
+ -- latex_command can be also plain_command for Plain TeX
+ local command = latex_command or Make.latex_command
local devnull = " > /dev/null 2>&1"
if os.type == "windows" then
command = command:gsub("'",'')
@@ -72,4 +78,15 @@ function m.htlatex(par)
return Make.testlogfile(par)
end
+function m.httex(par)
+ local newpar = {}
+ for k,v in pairs(par) do newpar[k] = v end
+ -- change executable name from *latex to *tex
+ newpar.htlatex = newpar.htlatex:gsub("latex", "tex")
+ -- plain tex command doesn't support etex extensions
+ -- which are necessary for TeX4ht. just quick hack to fix this
+ if newpar.htlatex == "tex" then newpar.htlatex = "etex" end
+ return m.htlatex(newpar, Make.plain_command)
+end
+
return m