diff options
author | Karl Berry <karl@freefriends.org> | 2018-05-03 21:04:48 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2018-05-03 21:04:48 +0000 |
commit | d20905e40a1f1c00c8b4d268ecaafcef47953e7a (patch) | |
tree | 904da60a00b88366bbc0b5aef7adc62c08838164 /Master/texmf-dist/scripts/make4ht/extensions/latexmk_build.lua | |
parent | 14d1c94af4e8acce4d5d6854b6988834d8ab4dac (diff) |
make4ht (3may18)
git-svn-id: svn://tug.org/texlive/trunk@47598 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts/make4ht/extensions/latexmk_build.lua')
-rw-r--r-- | Master/texmf-dist/scripts/make4ht/extensions/latexmk_build.lua | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/Master/texmf-dist/scripts/make4ht/extensions/latexmk_build.lua b/Master/texmf-dist/scripts/make4ht/extensions/latexmk_build.lua new file mode 100644 index 00000000000..bf4dcdde5a4 --- /dev/null +++ b/Master/texmf-dist/scripts/make4ht/extensions/latexmk_build.lua @@ -0,0 +1,31 @@ +-- use Latexmk in first LaTeX call +-- only in the first call, because we don't need to execute biber, etc. in the subsequent +-- LaTeX calls, these are only for resolving the cross-references +local M = {} +function M.modify_build(make) + local used = false + local first + local build_seq = make.build_seq + -- find first htlatex call in the build sequence + for pos,v in ipairs(build_seq) do + if v.name == "htlatex" and not first then + first = pos + end + end + -- if htlatex was found + if first then + -- add dummy latexmk call to the build sequence + make:latexmk {} + -- replace name, command and type in the first htlatex + -- call with values from the dummy latexmk call + local replaced = build_seq[first] + local latexmk = build_seq[#build_seq] + replaced.name = latexmk.name + replaced.command = latexmk.command + replaced.type = latexmk.type + -- remove the dummy latexmk + table.remove(build_seq) + end + return make +end +return M |