<div dir="ltr">It is somehow a theoretical (i cannot put it to work) possibility to use latexmk with make4ht (described in the documentation: <a href="https://github.com/michal-h21/make4ht#extensions">https://github.com/michal-h21/make4ht#extensions</a>).<div>Maybe this helps.</div><div><br></div><div>Best regards</div><div>Wojtek</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">wt., 19 kwi 2022 o 00:29 Nasser M. Abbasi <<a href="mailto:nma@12000.org">nma@12000.org</a>> napisał(a):<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 4/18/2022 5:21 PM, Michal Hoftich wrote:<br>
<br>
>You can of<br>
> course change that using a build file, where you can declare your own<br>
> modes and declare commands to be executed.<br>
> <br>
> The default is this:<br>
> <br>
> if mode=="draft" then<br>
> Make:htlatex{}<br>
> else<br>
> Make:htlatex{}<br>
> Make:htlatex{}<br>
> Make:htlatex{}<br>
> end<br>
> <br>
<br>
Thanks, but the issue is, how does one know if they<br>
need to run it 1, 2 or 3 times? What code do I need to add<br>
to the above to decide?<br>
<br>
With lualatex, now this is what I do and it works (other option is to<br>
use latexmk, but for some other reasons, I prefer to stick to makefiles<br>
for now).<br>
<br>
------------------------------<br>
lualatex -halt-on-error -interaction=batchmode --shell-escape -file-line-error index.tex<br>
<br>
if grep -E 'Rerun to get it removed|Temporary extra page added at the end|There were undefined references' index.log ; then<br>
echo "Need to RUN one more time...."<br>
lualatex -halt-on-error -interaction=batchmode --shell-escape -file-line-error index.tex<br>
if grep -E 'Rerun to get it removed|Temporary extra page added at the end|There were undefined references' index.log ; then<br>
echo "Need to RUN one more time...."<br>
lualatex -halt-on-error -interaction=batchmode --shell-escape -file-line-error index.tex<br>
fi<br>
fi<br>
-------------------------------<br>
<br>
The above checks after each run if it needs to run again. It does it only<br>
3 times. No need for more.<br>
<br>
I do not know what to check for with tex4ht or how to do the above<br>
in the build lua file you show.<br>
<br>
How to decide?<br>
<br>
> Best regards,<br>
> Michal<br>
<br>
--Nasser<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature">---(___C'></div>