Closed Perangelot closed 2 years ago
Hello,
Thanks for writing up a good issue report.
The images are exported to markdown according to this template:
<img src="/image-folder/name-of-img" alt="LaTeX-code" class="org-svg" />
. This has all images be put on a new line.
img
elements do not show up on new lines by default. I would have to guess that the CSS in your theme is setting display: block;
for all img
elements (or something similar).
You can see on this ox-hugo's dvisvgm test page that the inline image rendering (the a + b
formula) is rendering correctly: https://ox-hugo.scripter.co/test/posts/equations-exported-to-svg/ (Markdown file exported by ox-hugo).
Here's the Org source of that test, for the inline and block equations part:
Example of an inline equation: \[ a + b \]
Example of a block equation:
\begin{equation}
C = W\log_{2} (1+\mathrm{SNR})
\end{equation}
Can you also share the Markdown file generated when you export that MWE?
@Perangelot I have cleaned up my earlier comments, edited my last comment, and moved the discussion related to SVG foreground/background colors to https://github.com/kaushalmodi/ox-hugo/discussions/612.
@Perangelot I have added your inline equation example to the same test and it's rendering inline. So it looks like what I guessed initially.. something to do with your CSS:
Thanks for your fast answer! I now completely left out the .css
file and still got the same result, so I think it is the theme I am using rather then the styling (which would be weird anyway because it only defines the APA
citation style). If I find out something new, I'll get back to you. About the black color: I'm on it.
Okay, I've got it working now, it actually was the .css
file and your predication about the img
block was absolutely correct. I somehow misread .csl
file... Sorry for the hassle, you helped me out a lot!
First of all: Thank you for all the great effort you put into this package! I am surely not the only one who appreciates this so much. I have a request concerning formulae and drawing
tikz
pictures. If this was solved, I could finally write proper formulae in my blog!Actual Behavior
Using the option
#+tex:dvisvgm
, LaTeX images are created, which works fine in general. There are just two caveats:org-preview-images
, not generated with the emacs theme colors, but in black with no background. This is, in principle, what you want, but those who use a dark theme like me need other colors (I, for example, need the font color to be light gray).<img src="/image-folder/name-of-img" alt="LaTeX-code" class="org-svg" />
. This has all images be put on a new line. It happens often times that you need the image in-line, though, e.g. when you use in-line formulas.Expected Behavior
How to Reproduce the Issue
In org-mode
In markdown
In org-mode: HTML output: