#!/usr/bin/env perl

my ($file) = @ARGV;

# To install: 
# mvn latex:inj -Dlatex.injections=latex4ht
# on the root 
# then move to the folder where to start at and issue sth like: 
# $ ln -s ../../../latex4ht latex4ht
# Note that this will be erased and created anew by mvn process-resources, 
# but this can be prevented by modifying the second line of the filtered. 


                   
# usage: ./latex4ht <file> 
# The following at least works, although worse than make4ht -l manualLMP mathjax
# ./latex4ht manualLMP 



# derived from htlatex (2024-01-23-13:46), generated from tex4ht-mkht.tex
# Copyright 2009-2020 TeX Users Group
# Copyright 2003-2009 Eitan M. Gurari
#
# This work may be distributed and/or modified under the
# conditions of the LaTeX Project Public License, either
# version 1.3 of this license or (at your option) any
# later version. The latest version of this license is in
#   http://www.latex-project.org/lppl.txt
# and version 1.3 or later is part of all distributions
# of LaTeX version 2003/12/01 or later.

my $prefixTex4ht = sprintf("$[prefixTex4ht]", "$[tex4htStyOptions]");
system("$[latex2pdfCommand] -output-format=dvi -no-pdf -jobname=$file $[latex2pdfOptions] '$[prefixDvi]$prefixTex4ht\\input{$file}'");
# -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/ seems irrelevant. 
system("tex4ht -f/$file -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/ $[tex4htOptions]");
system("t4ht   -f/$file $[t4htOptions]"); ## -d~/WWW/temp/ -m644 

