1

I use the command "make4ht -e test.mk4 test.tex" to produce a number of html files named "test.html" , "test1.html" etc. This works fine. Now, I would like to have at the end of the process a copy of the file "test.html" named "index.html". Is there a command I could add to the mk4 file that does this?

Best,

Christian

1 Answers1

1

Try this build file:

local mkutils = require "mkutils"
Make:match("test.html", function(filename, par)
  local outputname = "index.html"
  -- support --output-dir option
  if par.outdir ~= ""  then outputname = par.outdir .. "/" .. outputname end
  mkutils.cp(filename, outputname)
end)

It matches the test.html file and uses make4ht internal function mkutils.cp to copy it to the new destination. The par.outdir variable contains destination of the --output-dir option.

michal.h21
  • 50,697