mahmooz · 2022-04-15 14:26
i tried using `#+INCLUDE: "fitted.tex" export latex` from [https://emacs.stackexchange.com/questions/40707/embed-external-latex-file-in-org-mode](https://emacs.stackexchange.com/questions/40707/embed-external-latex-file-in-org-mode) but its just not working, any ideas?
Mixermassiv · 2022-04-17 20:18
If you want it to be inserted before \begin{document}
#+LaTeX_HEADER: \input{fitted.tex}
If you want it inline
#+LaTeX: \input{fitted.tex}
mahmooz · 2022-04-18 11:11
this doesnt work when exporting to html
Mixermassiv · 2022-04-18 11:15
What do you mean exactly? These are `tex` files. If you are talking about latex-fragments being exported by `ox-html`, you will need to put your preamble in `org-format-latex-header`, escaping the backslashes.
mahmooz · 2022-04-18 11:29
>so i can modify this variable to allow org mode to also export the latex in the included files to html? because the latex code only seems to get rendered when exporting to latex and not html
Mixermassiv · 2022-04-18 12:43
You need to understand first that LaTeX and html are in principle incompatible. The only thing you can do is create LaTeX images and embed them into your html. At the moment, this works for LaTeX-code wrapped in dollar signs and environments, but not for source-blocks (let alone whole `.tex` files, as in your case!). You will need to set `#+options: tex:[picture mode]` in your preamble. `#+options: tex:dvipng` should work, but `#+options: tex:dvisvgm` is preferable; you will need to change the `svg` part in `org-preview-latex-process-alist` to `xelatex` then, though. If you have done that, the images are embedded correctly, but some might have equation numbers you don't want. I'm on a mission to fix this and will post a guide on how to do it exactly on my blog. To get a first idea how this might look, see https://opensource-philosophy.com/posts/functional-completeness-vom-08.04.2022/