Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latex Double Dollar Sign Rendering Issue #643

Open
FrederickGeek8 opened this issue May 11, 2023 · 2 comments
Open

Latex Double Dollar Sign Rendering Issue #643

FrederickGeek8 opened this issue May 11, 2023 · 2 comments

Comments

@FrederickGeek8
Copy link

Hi there. I've been wanting to use obsidian-html to convert my technical Obsidian notes to HTML so I can easily share with my colleagues. I noticed that it seems like the $$ Latex math block format that the conversion wants looks like.

$$
F_\beta = f(I_\beta)
$$

however in my notes I have it in the format.

$$F_\beta = f(I_\beta)$$

sometimes directly follow plain text, or sometimes on a new line. Both give the same strange result, which looks like the math equation but inline and surrounded by plaintext \( and \)

So

bla bla $$F_\beta = f(I_\beta)$$

becomes
Screenshot 2023-05-11 at 1 52 29 PM

and

bla bla
$$F_\beta = f(I_\beta)$$

becomes
Screenshot 2023-05-11 at 1 53 04 PM

Is this something that can be easily solved in your code? I find that using $$ inline with an equation is better for readability and searching through my notes. It would be a slog to convert all the instances where I used it like that, so I'm hoping something could change in the conversion process.

Thanks!

@dwrolvink
Copy link
Collaborator

Hi Frederick, when I convert this code:

$$F_\beta = f(I_\beta)$$

bla 

$$
F_\beta = f(I_\beta)
$$

I get this:

image

Which seems to be what you are looking for.

This is with obsidianhtml version 3.5.0. You can check yours with obsidianhtml version.

If you are running an older version, try:

pip uninstall obsidianhtml
pip install obsidianhtml
obsidianhtml version 

@Ethan1023
Copy link

Ethan1023 commented May 19, 2023

On version 3.5.2 having text in the same block as a $$ equation causes this problem, e.g. with

test.md:

# Work

## 1.
text

$$1+1=2$$

text

## 2.
text

$$
1+1=
2
$$

text

# Don't work

## 1.
text
$$1+1=2$$
text

## 2.
text
$$1+1=2$$

text

## 3.
text

$$1+1=2$$
text

## 4.
text $$1+1=2$$ text

Running obsidianhtml I get

index.html
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants