summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts/make4ht/mkparams.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/scripts/make4ht/mkparams.lua')
-rwxr-xr-xMaster/texmf-dist/scripts/make4ht/mkparams.lua19
1 files changed, 14 insertions, 5 deletions
diff --git a/Master/texmf-dist/scripts/make4ht/mkparams.lua b/Master/texmf-dist/scripts/make4ht/mkparams.lua
index 0dc74a0ce16..61c522a2406 100755
--- a/Master/texmf-dist/scripts/make4ht/mkparams.lua
+++ b/Master/texmf-dist/scripts/make4ht/mkparams.lua
@@ -2,6 +2,12 @@ local lapp = require "lapp-mk4"
local mkutils = require "mkutils"
local m = {} -- use ugly module system for new lua versions support
+-- these two variables will be used in the version number
+-- progname will be set in get_args
+m.progname = "make4ht"
+-- set the version number before call to process_args()
+m.version_number = "v0.1"
+
m.optiontext = [[
${progname} - build system for tex4ht
Usage:
@@ -43,7 +49,7 @@ local function process_args(args)
end
if args.version ==true then
- print "make4ht version 0.1b"
+ print(string.format("%s version %s", m.progname, m.version_number))
os.exit()
end
@@ -66,14 +72,15 @@ local function process_args(args)
local compiler = args.lua and "dvilualatex" or args.xetex and "xelatex --no-pdf" or "latex"
+ local tex_file = args.filename
local input = mkutils.remove_extension(args.filename)
-
local latex_params = {}
- local tex_file = input
local insert_latex = get_inserter(args,latex_params)
insert_latex("shell-escape","-shell-escape")
local latex_cli_params = args[4] or ""
if not latex_cli_params:match("%-jobname") then
+ -- we must strip out directories from jobname when full path to document is given
+ input = input:match("([^%/]+)$")
table.insert(latex_params,"-jobname="..input)
else
-- when user specifies -jobname, we must change name of the input file,
@@ -117,12 +124,13 @@ local function process_args(args)
--end
local tex4ht = ""
+ local dvi= args.xetex and "xdv" or "dvi"
if args[2] and args[2] ~="" then
tex4ht = args[2]
else
tex4ht = args.utf8 and " -cmozhtf -utf8" or ""
- local xdv = args.xetex and " -.xdv" or ""
- tex4ht = tex4ht .. xdv
+ if args.xetex then tex4ht = tex4ht .. " -.xdv" end
+ -- tex4ht = tex4ht .. xdv
end
local t4ht = args[3] or ""
@@ -146,6 +154,7 @@ local function process_args(args)
,tex4ht_par=tex4ht
,t4ht_par=t4ht
,mode = mode
+ ,dvi = dvi
,build_file = build_file
--,t4ht_dir_format=t4ht_dir_format
}