0

I'm using make4ht as a replacement of the old htlatex to convert a tex file into HTML (see this post for detail: Is the htlatex tool of the latest texlive broken?)

With the following command, the html is able to be generated successfully under out/html:

make4ht -d "out/html" "Main.tex"

Unfortunately, I found the following files under the current directory:

Main.4ct
Main.4tc
Main.aux
Main.css
Main.dvi
Main.html
Main.idv
Main.lg
Main.log
Main.tmp
Main.xref

Since these files are not under out, they are now corrupting my version control, is there a ways to avoid this?

2
  • 1
    htlatex is not "defunct", but make4ht is easier to use. Commented Sep 6, 2022 at 7:11
  • you are right, edited
    – tribbloid
    Commented Sep 6, 2022 at 17:54

1 Answer 1

5

There is a method for cleaning the build files discussed on page 5 of the make4ht documentation. It involves using the -m clean option. This is done in a separate call to the command. To chain it together with compilation, you could do:

make4ht -d "out/html" "Main.tex" && make4ht -m clean "Main.tex"

However, personally I would prefer to use other methods to avoid "corrupting" your version control. A good version control system should have built in mechanisms for that. For example, for git you can add those filenames your .gitignore file so that, well, git ignores them.

This way you don't have to constantly regenerate temporary files.

2
  • Thanks a lot! problem solved. I have to admit that it is a weird design tho
    – tribbloid
    Commented Sep 6, 2022 at 17:56
  • 1
    @tribbloid this is just normal design of latex. You need temporary files for various features. It is not reasonable to delete them between particular compilations, it is best to use .gitignore if you don't want them to interfere with git
    – michal.h21
    Commented Sep 6, 2022 at 21:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .