0

I'm using kaobook to produce a book that I'm publishing on LeanPub. LeanPub provides the option to upload an HTML-formatted table of contents.

Is there any way I can output just the table of contents in HTML format from my .tex files?

I know that with some effort, I can output the entire document to HTML, then extract just the index, but I would like to make this an automated process, for easy reproducibility.

Is this even theoretically possible, considering that the ToC is built from metadata for the entire document?

5
  • Depending on your comfort with programming, a .toc to html converter would not be a difficult thing to write.
    – Don Hosek
    Commented Jun 24, 2020 at 17:03
  • @DonaldHosek: That's a good thought. I could probably throw that together pretty quickly.
    – Flimzy
    Commented Jun 24, 2020 at 17:06
  • 1
    Maybe not even programming is necessary, but a RegExp that can be used with e.g. sed or even Notepad++
    – TobiBS
    Commented Jun 24, 2020 at 18:20
  • I have a nearly complete program to do this now, and I think this is actually the best answer, since it turns out LeanPub supports very limited HTML for their TOCs. I think it's unlikely that any LaTeX-generated HTML would work well.
    – Flimzy
    Commented Jun 24, 2020 at 18:33
  • So a custom program to produce the HTML is the solution I went with. If @DonaldHosek wants to post an answer to this effect, I'm happy to accept it. Otherwise I can do the same myself later--if such a suggestion truly counts as an answer on this site.
    – Flimzy
    Commented Jun 25, 2020 at 8:24

0

You must log in to answer this question.

Browse other questions tagged .