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

Feature Request: Disable Math Block Override in a File #4

Open
ftiasch opened this issue Jun 22, 2023 · 6 comments
Open

Feature Request: Disable Math Block Override in a File #4

ftiasch opened this issue Jun 22, 2023 · 6 comments
Labels
enhancement New feature or request

Comments

@ftiasch
Copy link

ftiasch commented Jun 22, 2023

I already had lots of files in my Obsidian vault written with LaTeX syntax, and I am going to apply typst syntax in my newly created file.

However, doing so makes many my old files unreadable. Could you please use a piece of special meta data to determine whether to enable/disable math block override in the file?

@fenjalien fenjalien added the enhancement New feature or request label Jun 22, 2023
@fenjalien
Copy link
Owner

I guess something can be set in the front matter to override the override? I'll have a look into it :)

@ftiasch
Copy link
Author

ftiasch commented Jun 23, 2023

@fenjalien Cool! Having something in the front matter should make the transition process smooth.

@fenjalien
Copy link
Owner

sooo after having a look into this I'm afraid its not exactly possible. Currently the function Obsidian calls to render math is overidden. That function only takes the source and whether or not its a block, there is no information on where or which file its used in. So if theres some information in the frontmatter describing the correct behaviour, there is no easy way to check it.

It might be possible to say which ever is the active file is where the math will be rendered, but this would cause any other files rendering math to have the same settings as the active. This could occur when you hover over a link for a preview or you use split screen for multiple files.

That being said it could still be implemented with a warning that it only properly works as intended with only one file being rendered at once.

@ftiasch
Copy link
Author

ftiasch commented Aug 9, 2023

Thanks for your explanation! Then I assume it's OK to postpone until Obsidian provides corresponding API or simply reject my request (

@fenjalien
Copy link
Owner

The API change is unlikely to happen without alot of people asking. Tbh the way I've done it is really hacky and not recommended. I wouldn't mind doing this with a BIG disclaimer attached as I do understand the issue.

@teoc98
Copy link

teoc98 commented May 20, 2024

@ftiasch I've just started using this plugin. I have the same problem, and after seeing this open issue I solved it by not enabling the math block override, and whenever I need to format a math block I use another plugin (typing-transformer-obsidian) to insert

```typst
$  $
```

with a keyboard shortcut.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants