Is it possible to use a latex file as a ressource?

In a terminal, with the command

pandoc file.tex -f latex -t html --mathjax -o file.html

I can convert a latex file into a html one and then use this as a resource for some page in my hugo website. It is not clear to me if I can use directly file.tex as a resource and delegate the pandoc conversion (latex->html) to Hugo.

I see in the docs that pandoc can be used as a markup language recognized by Hugo (given that one has pandoc installed), but I am under the impression that this is a different story.

Any input here is welcome. :slight_smile:

Pandoc is in the list of content formats. You should probably search for pandoc instead of latex to get behind the technical intricacies of how to structure the html generation, but it looks like the answer to your question is yes :wink:

1 Like

Thanks for considering my question… but I kept digging and I think that unfortunately the answer to my question is NO. I’m really not an expert so any of the following might be wrong, poorly formulated, or both. If someone who reads this knows better than me, it would be very kind to correct me if I am wrong, or confirm that I understood correctly if this is the case.

As fare as I understand, one needs to distinguish two things:

  1. the external helper pandoc,
  2. the content format pandoc markdown.

It does not seem that one can pass options to (the external helper) pandoc when used within Hugo (or more precisely one always passes one single option: --mathjax), see the doc and this discussion on GitHub where it has been decided (and motivated!).

If I understand correctly that means that, in Hugo, one can only use pandoc to convert pandoc markdown to html. Pandoc offers in principle many other possibilities but in order to exploit them one would need to pass the corresponding options.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.