summaryrefslogtreecommitdiff
path: root/Master/texmf-dist
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-12-11 23:15:24 +0000
committerKarl Berry <karl@freefriends.org>2015-12-11 23:15:24 +0000
commit7b226b60f1c5dce3911375f82c4711dc6ff30fc3 (patch)
tree748db231119c3d8b41dc7101de867c1a6ebb8689 /Master/texmf-dist
parent7870a781c1a56b03d9e4fa902003361b9119b090 (diff)
make4ht (11dec15)
git-svn-id: svn://tug.org/texlive/trunk@39075 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r--Master/texmf-dist/doc/support/make4ht/README7
-rw-r--r--Master/texmf-dist/doc/support/make4ht/changelog.tex66
-rw-r--r--Master/texmf-dist/doc/support/make4ht/make4ht-doc.pdfbin62996 -> 62872 bytes
-rw-r--r--Master/texmf-dist/doc/support/make4ht/make4ht-doc.tex2
-rw-r--r--Master/texmf-dist/doc/support/make4ht/readme.tex5
-rwxr-xr-xMaster/texmf-dist/scripts/make4ht/lapp-mk4.lua14
-rwxr-xr-xMaster/texmf-dist/scripts/make4ht/make4ht3
-rwxr-xr-xMaster/texmf-dist/scripts/make4ht/mkparams.lua34
-rwxr-xr-xMaster/texmf-dist/scripts/make4ht/mkutils.lua14
9 files changed, 115 insertions, 30 deletions
diff --git a/Master/texmf-dist/doc/support/make4ht/README b/Master/texmf-dist/doc/support/make4ht/README
index ab25739d857..c3c689c87ae 100644
--- a/Master/texmf-dist/doc/support/make4ht/README
+++ b/Master/texmf-dist/doc/support/make4ht/README
@@ -88,7 +88,11 @@ htlatex
input
-: input file
+: it is output file name in fact
+
+tex_file
+
+: input TeX file
latex_par
@@ -275,6 +279,7 @@ LaTeX is called only once when `make4ht` is called with
-n,--no-tex4ht Disable dvi file processing with tex4ht command
-s,--shell-escape Enables running external programs from LaTeX
-u,--utf8 For output documents in utf8 encoding
+ -v,--version Print version number
-x,--xetex Use xelatex for document compilation
<filename> (string) Input file name
diff --git a/Master/texmf-dist/doc/support/make4ht/changelog.tex b/Master/texmf-dist/doc/support/make4ht/changelog.tex
index 77fffc0a8dd..b69cd5d7829 100644
--- a/Master/texmf-dist/doc/support/make4ht/changelog.tex
+++ b/Master/texmf-dist/doc/support/make4ht/changelog.tex
@@ -1,30 +1,60 @@
\section{Changelog}\label{changelog}
-\subsection{2015/09/23 version 0.1a}\label{version-0.1a}
-
\begin{itemize}
-\itemsep1pt\parskip0pt\parsep0pt
-\item
- various documentation updates
\item
- \texttt{mozhtf} profile for unicode output is used, this should
- prevent ligatures in the output files
-\end{itemize}
+ 2015/12/06 version 0.1b
-\subsection{2015/06/29 version 0.1}\label{version-0.1}
+ \begin{itemize}
+ \itemsep1pt\parskip0pt\parsep0pt
+ \item
+ modifed lapp library to recognize \texttt{-{}-version} and
+ \item
+ added \texttt{-{}-help} and \texttt{-{}-version} command line
+ options
+ \end{itemize}
+\item
+ 2015/11/30
-\begin{itemize}
-\itemsep1pt\parskip0pt\parsep0pt
+ \begin{itemize}
+ \itemsep1pt\parskip0pt\parsep0pt
+ \item
+ use \texttt{kpse} library for build file locating
+ \end{itemize}
\item
- major README file update
-\end{itemize}
+ 2015/11/17
-\subsection{2015/06/26}\label{section}
+ \begin{itemize}
+ \itemsep1pt\parskip0pt\parsep0pt
+ \item
+ better \texttt{-jobname} handling
+ \end{itemize}
+\item
+ 2015/09/23 version 0.1a
-\begin{itemize}
-\itemsep1pt\parskip0pt\parsep0pt
+ \begin{itemize}
+ \itemsep1pt\parskip0pt\parsep0pt
+ \item
+ various documentation updates
+ \end{itemize}
\item
- added Makefile
+ \texttt{mozhtf} profile for unicode output is used, this should
+ prevent ligatures in the output files
\item
- moved INSTALL instructions from README to INSTALL
+ 2015/06/29 version 0.1
+
+ \begin{itemize}
+ \itemsep1pt\parskip0pt\parsep0pt
+ \item
+ major README file update
+ \end{itemize}
+\item
+ 2015/06/26
+
+ \begin{itemize}
+ \itemsep1pt\parskip0pt\parsep0pt
+ \item
+ added Makefile
+ \item
+ moved INSTALL instructions from README to INSTALL
+ \end{itemize}
\end{itemize}
diff --git a/Master/texmf-dist/doc/support/make4ht/make4ht-doc.pdf b/Master/texmf-dist/doc/support/make4ht/make4ht-doc.pdf
index 028c505ad49..91bd73fe761 100644
--- a/Master/texmf-dist/doc/support/make4ht/make4ht-doc.pdf
+++ b/Master/texmf-dist/doc/support/make4ht/make4ht-doc.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/support/make4ht/make4ht-doc.tex b/Master/texmf-dist/doc/support/make4ht/make4ht-doc.tex
index b2af0201069..9c9a5eeddf8 100644
--- a/Master/texmf-dist/doc/support/make4ht/make4ht-doc.tex
+++ b/Master/texmf-dist/doc/support/make4ht/make4ht-doc.tex
@@ -14,7 +14,7 @@
\title{The \texttt{make4ht} build system}
\author{Michal Hoftich\footnote{\url{michal.h21@gmail.com}}}
-\date{Version 0.1a\\23/09/2015}
+\date{Version 0.1b\\12/11/2015}
\begin{document}
\maketitle
\tableofcontents
diff --git a/Master/texmf-dist/doc/support/make4ht/readme.tex b/Master/texmf-dist/doc/support/make4ht/readme.tex
index c47517c8840..83244743deb 100644
--- a/Master/texmf-dist/doc/support/make4ht/readme.tex
+++ b/Master/texmf-dist/doc/support/make4ht/readme.tex
@@ -104,7 +104,9 @@ Default parameters are:
\item[htlatex]
used compiler
\item[input]
-input file
+it is output file name in fact
+\item[tex\_file]
+input TeX file
\item[latex\_par]
parameters to \texttt{latex}
\item[packages]
@@ -293,6 +295,7 @@ make4ht [options] filename ["tex4ht.sty op." "tex4ht op."
-n,--no-tex4ht Disable dvi file processing with tex4ht command
-s,--shell-escape Enables running external programs from LaTeX
-u,--utf8 For output documents in utf8 encoding
+-v,--version Print version number
-x,--xetex Use xelatex for document compilation
<filename> (string) Input file name
\end{verbatim}
diff --git a/Master/texmf-dist/scripts/make4ht/lapp-mk4.lua b/Master/texmf-dist/scripts/make4ht/lapp-mk4.lua
index 71ed3704077..89d5c7061ac 100755
--- a/Master/texmf-dist/scripts/make4ht/lapp-mk4.lua
+++ b/Master/texmf-dist/scripts/make4ht/lapp-mk4.lua
@@ -52,6 +52,15 @@ local function quit(msg,no_usage)
os.exit(1);
end
+local function help()
+ print(usage)
+ os.exit()
+end
+
+local function version()
+ return {version = true}
+end
+
local function error(msg,no_usage)
quit(arg[0]:gsub('.+[\\/]','')..':'..msg,no_usage)
end
@@ -258,7 +267,10 @@ function process_options_string(str)
end
end
if parm == 'h' or parm == 'help' then
- quit()
+ help()
+ end
+ if parm == "v" or parm == "version" then
+ return version()
end
if aliases[parm] then parm = aliases[parm] end
ps = parms[parm]
diff --git a/Master/texmf-dist/scripts/make4ht/make4ht b/Master/texmf-dist/scripts/make4ht/make4ht
index 22b2e7cf2fb..49b1d0159a5 100755
--- a/Master/texmf-dist/scripts/make4ht/make4ht
+++ b/Master/texmf-dist/scripts/make4ht/make4ht
@@ -1,7 +1,10 @@
#!/usr/bin/env texlua
+-- Package make4ht. Author Michal Hoftich <michal.h21@gmail.com>
+-- This package is subject of LPPL license, version 1.3
kpse.set_program_name("luatex")
+
local make4ht = require("make4ht-lib")
local lapp = require("lapp-mk4")
local mkutils = require("mkutils")
diff --git a/Master/texmf-dist/scripts/make4ht/mkparams.lua b/Master/texmf-dist/scripts/make4ht/mkparams.lua
index 04b2827e102..0dc74a0ce16 100755
--- a/Master/texmf-dist/scripts/make4ht/mkparams.lua
+++ b/Master/texmf-dist/scripts/make4ht/mkparams.lua
@@ -11,12 +11,14 @@ ${progname} [options] filename ["tex4ht.sty op." "tex4ht op." "t4ht op" "latex o
-c,--config (default xhtml) Custom config file
-d,--output-dir (default nil) Output directory
-e,--build-file (default nil) If build file is different than `filename`.mk4
+-h,-- help Display this message
-l,--lua Use lualatex for document compilation
-m,--mode (default default) Switch which can be used in the makefile
-n,--no-tex4ht Disable dvi file processing with tex4ht command
-s,--shell-escape Enables running external programs from LaTeX
-u,--utf8 For output documents in utf8 encoding
-x,--xetex Use xelatex for document compilation
+-v,--version Display version number
]]
local function get_args(parameters, optiontext)
local parameters = parameters or {}
@@ -40,11 +42,16 @@ local function process_args(args)
end
end
+ if args.version ==true then
+ print "make4ht version 0.1b"
+ os.exit()
+ end
+
local outdir = ""
local packages = ""
if args["output-dir"] ~= "nil" then
- outdir = args["output-dir"]
+ outdir = args["output-dir"] or ""
outdir = outdir:gsub('\\','/')
outdir = outdir:gsub('/$','')
end
@@ -62,10 +69,30 @@ local function process_args(args)
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")
- table.insert(latex_params,"-jobname="..input)
- table.insert(latex_params,args[4] or "")
+ local latex_cli_params = args[4] or ""
+ if not latex_cli_params:match("%-jobname") then
+ table.insert(latex_params,"-jobname="..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
+ local newinput
+ local first, rest = latex_cli_params:match("%-jobname=(.)(.*)")
+ if first=='"' then
+ newinput=rest:match('([^"]+)')
+ elseif first=="'" then
+ newinput=rest:match("([^']+)")
+ elseif type(first)== "string" then
+ rest = first.. rest
+ newinput = rest:match("([^ ]+)")
+ end
+ if newinput then
+ input = newinput
+ end
+ end
+ table.insert(latex_params, latex_cli_params)
--table.insert(latex_params,args["shell-escape"] and "-shell-escape")
@@ -111,6 +138,7 @@ local function process_args(args)
local parameters = {
htlatex = compiler
,input=input
+ ,tex_file=tex_file
,packages=packages
,latex_par=table.concat(latex_params," ")
--,config=ebookutils.remove_extension(args.config)
diff --git a/Master/texmf-dist/scripts/make4ht/mkutils.lua b/Master/texmf-dist/scripts/make4ht/mkutils.lua
index ca9e2ff208a..e550ead9801 100755
--- a/Master/texmf-dist/scripts/make4ht/mkutils.lua
+++ b/Master/texmf-dist/scripts/make4ht/mkutils.lua
@@ -248,7 +248,7 @@ env.Make:add("htlatex",function(par)
"\\HCode\\expandafter\\def\\csname tex4ht\\endcsname{#1,html}\\def"..
"\\HCode####1{\\documentstyle[tex4ht,}\\@ifnextchar[{\\HCode}{"..
"\\documentstyle[tex4ht]}}}\\makeatother\\HCode ${tex4ht_sty_par}.a.b.c."..
-"\\input ${input}'"
+"\\input ${tex_file}'"
if os.type == "windows" then
command = command:gsub("'",'')
end
@@ -270,16 +270,20 @@ env.Make:add("htlatex",function(par)
return 0
end
,{correct_exit=0})
-env.Make:add("tex4ht","tex4ht ${tex4ht_par} ${input}", nil, 1)
-env.Make:add("t4ht","t4ht ${t4ht_par} ${input}.${ext}",{ext="dvi"},1)
+env.Make:add("tex4ht","tex4ht ${tex4ht_par} \"${input}\"", nil, 1)
+env.Make:add("t4ht","t4ht ${t4ht_par} \"${input}.${ext}\"",{ext="dvi"},1)
function load_config(settings, config_name)
local settings = settings or main_settings
env.settings = settings
env.mode = settings.mode
- local config_name = config_name or "config.lua"
+ local config_name = kpse.find_file(config_name, 'texmfscripts') or config_name
local f = io.open(config_name,"r")
- if not f then return env, "Cannot open config file" end
+ if not f then
+ print("Cannot open config file", config_name)
+ return env
+ end
+ print("Using build file", config_name)
local code = f:read("*all")
local fn, msg = run(code,env)
if not fn then print(msg) end