Giter Club home page Giter Club logo

obsidian-latex's Introduction

Hello! I'm Wei En, an undergraduate at the National University of Singapore studying Computer Science and Mathematics. I'm currently interested in statistical learning theory and its applications towards robust and efficient machine learning methods, as well as integrating other areas of theoretical computer science into machine learning.

Outside of research, I take an avid interest in open source software engineering and am also passionate in education initiatives targeted at improving access to opportunities for the less privileged. In my free time, I like to brew a fresh cup of coffee/tea, listen to music, and occasionally indulge in other recreational activities!

obsidian-latex's People

Contributors

lishid avatar minusgix avatar ryotaushio avatar wei2912 avatar xldenis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

obsidian-latex's Issues

Preamble not recognised in Obsidian v0.11.3

None of the content in preamble.sty seems to load anymore upon updating to Obsidian v0.11.3, even when reloading Obsidian. It was working fine in v0.11.0, and this isn't due to plugin conflicts as I have tried disabling all other plugins. I currently have Extended MathJax v0.1.0.

Cannot load LaTeX packages into preamble.sty

I'm trying to use the physics package and i tried including this in the preamble.sty:
\usepackage{physics}
and I also tried this:
\require{physics}, which was according to this obsidian forum post.
The example you give does not show how to include some LaTeX package, it only shows how to define a macro. Unless thats not what this extensions can do, can you please explain how to use this extension to use an arbitrary LaTeX package?

Preamble file is not loaded

I have created a preamble.sty file at the root of my project, defining a command via \newcommand and restarted obsidian.
The command is not available in my latex in notes.
Pasting the newcommand directly into the latex block works.
This may be related to the recent v1 update, but i cant say for sure as i wasnt using this plugin before.

Doesn't work on Obsidian mobile.

It doesn't seem that the plugin works at all on Obsidian mobile. I'm using the same preamble.sty on desktop and mobile which works on desktop, but on mobile none of the commands are loaded.

preamble.sty not loading on start; but loads on toggling safe mode

Hi I am on obsidian Desktop v0.14.2, and preamble.sty doesn't load on start.

What would make it work is if I turn on safe mode, and then turn it off. At this point all my custom latex commands would work again. However, if I then close obsidian and re-open it, those commands would be in red again.

I think this is symptomatic of errors on a deep level, could you help me with this? Thanks!

give it a better id

I kept getting a console error from plugin 'obsidian-latex' ...took me a long time to figure out it was this plugin. Is it possible to change the id to something more identifiable?

[Help] Configuring MathJax

Hi. I'm a little bit in the dark about how to use this plugin beyond defining macros.
Is it possible to do things like this: Configuring MathJax?
If so, what should I put in preamble.sty?

And any guidelines on what else I can do beyond just adding macros?

Comments in preamble.sty

This is not an issue but a tip.

We cannot use latex syntax % (comments) in preamble.sty.
But it works with \%.

Thank you.

FR: Option to support additional preamble/includes from frontmatter

Very useful plugin!

Would it be possible to load additional LaTeX on a file-by-file basis based on the frontmatter, using the header-includes field that Pandoc supports? This would make documents work both in Obsidian and pandoc.

Support from this will allow better organization of LaTeX preambles (abstracting out stuff shared between some files but not all).

newcommands not rendering correctly

I'm trying to use this plugin with Obsidian 1.4.14 on macOS, but the commands don't seem to work. Weirdly, it doesn't work when I look at the example file on GitHub either: the example file has "\typing" in red.
I'm not sure if this is an issue just on my end or the plugin has just stopped working as a whole

This is what's in my preamble.sty file
\newcommand{\bb}[1]{\mathbb{#1}}
\newcommand{\bvec}[1]{\mathbf{#1}}
\newcommand{\pardx}[2]{\frac{\partial #1}{\partial #2}}
\newcommand{\ddx}[2]{\frac{d #1}{d #2}}

And this is what it displays after typing "For a function $f : \bb{R} \to \bb{R}$"

Screenshot 2023-09-27 at 2 44 32 PM

This is what the example Markdown file looks like to me

Screenshot 2023-09-27 at 2 48 39 PM

XyJax support

Could we get support for XyJax?

In fact, this has already been mentioned in the issue asking for custom extensions, but it sounded like that was hard to accomplish. Personally, I would already be quite happy if the package XyJax was supported by default.

Plugin not working if the startup note contains latex

Hi, it seems that the plugin will fail to load properly if any displayed notes on Obsidian startup contain math mode code. I'm seeing this behavior on Mac OS, and I think it's probably because this assumption about the event ordering is violated in such cases.

The current workaround for me is to make sure that the startup notes do not contain any math code, but it took me hours to pin down this issue, so I think it may be very helpful for others if you could list this issue and the workaround in the plugin description. It would be very nice if this issue could be fixed in the future. Thanks!

Plugin failed in Obsidian v0.13.19

After updating v0.13.19, preamble.sty does not load. I've tried to reopen the vault, create a new vault or test in another computer. I don't see any log so I don't know what's going wrong. Could you check it, please?

Is there a way to include an entire Mathjax config?

This isn't really an issue per se, but I'm wondering if there's an easy way to adapt this plugin to just use an entirely customized Mathjax configuration. For example, I have something of the following form I use for other previews:

image

Then e.g. I include it in my website in the following way (this gets compiled + embedding as a script on each webpage):
image

Any idea if there's a way to point this plugin at a config like this (or something similar), as opposed to just a list of macros?

Conflict with plugin Calendar

There seems to be a conflict with the plugin Calendar: when both obsidian-latex and calendar are enabled, commands defined in preamble.sty are not recognized. If I disable the Calendar plugin, then it works well again.

I have Obsidian v0.11.1, Calendar v 1.5.1 and Extended Mathjax v0.1.0. Since I don't know from which side the problem comes from, I am also posting on the other plugin bug tracker.

Having issues with mobile.

Having issues with preamble commands working on iPhone and iPad, but works great on MacBook.

Using iCloud for storage.

Doesn't work at all?

Hi I've seen around the internet that this package works great for loading mathjax. However it doesn't seem to have any effect for me.
In my preamble I have

\require{physics}
\newcommand{\typing}[3][\Gamma]{#1 \vdash #2 : #3}

I've disable other plugins to no effect.
$$
\cross
\typing{3}{2}{1}
$$
Both commands show up as red in reading mode.
I can't figure out if I've done something wrong.

I'm on M2 mac. Just wonder if this is a known issue?

Mathtools commands not working

With Mathjax now at version 3.2, it would be nice if we could include mathtools commands in our macro definitions (with mathtools, i would be able to use nearly all of my usual LaTeX macros in Obsidian). However, it appears not to be working. For instance, including \DeclarePairedDelimiters{\p}{(}{)} in the preamble.sty file does not allow \p to be used in Obsidian. But one can check that writing \DeclarePairedDelimiters{\p}{(}{)} \p{a} straight into Obsidian does compile as intended.

I'm using Obsidian v0.12.15.
Thanks!

Custom MathJax extensions

Is it possible to adapt the plugin code to support custom MathJax extensions? For example, following the instructions at XyJax, I can get it to work in my browser (Firefox) but downloading and then trying to load xypic.js in Obsidian stops MathJax rendering altogether.

This is related to the issue 817799583. The two packages being loaded (mhchem and bussproofs) are already loaded by Obsidian, and changing the code to load any package not on the MathJax Extension List stops MathJax rendering.

Conflict with calendar is back

The problem described in #3 came back recently. I have not pinpointed exactly when it started.

The issue looks exactly the sale up to a minor difference : when I open Obsidian, any pre-existing Latex code will not recognize the preamble, however code newly written will recognize it.

FR: Include package setoption by default

Is it possible to have the package setoption loaded into mathjax? This would allow requiring other packages with options i.e. \require[arrowdel]{physics} and so on. I know this is related to the issues with changing the mathjax configuration in general but would it be possible to have just this added?

FR: Add ability to import multiply .sty files

It would be great if you could import multiple preamble files. i.e. all files in a folder or paths to multiple files (ideally both options). This way you can separate out massive preambles into smaller more manageable file.

The best result would be being able to use \usepackage to import other preamble files but this is understandably much more different.

Please let me know if this would be possible or you would welcome a PR with this feature!

Loading mhchem and bussproofs

Hi Xavier ,

I was wondering why you explicitly loading mhchem and bussproofs.
Aren't they bundled with Obsidian (mathjax-full) and autoloaded on first use?

Failed to install

If I try to update the plugin or install it in a new vault via the plugin browser I get the mesage "Failed to isntall Plugin 'Extended MathJax'"

How are mhchem and bussproofs loaded?

Just for my own understanding of how mathjax is loaded by obsidian and how this plugin works, could you explain how the packages are actually loaded?

Setting for preamble.sty location

Hi @xldenis

Thank you for making this plugin - I am finding it super useful.

I do find it slightly untidy to have my preamble in the root of the vault though, and I am wondering if you would implement a setting that can be used to specify the path to the preamble file? Perhaps this could include the option to specify more than one preamble file as well.

If you don't want to implement this yourself, I would be happy to submit a PR for it at some point during the next month.

\left\lVert and \right\rVert not rending correctly

When I have extended MathJax enabled, expressions of the form $\left\lVert ... \right\rVert$ do not render properly. If the ... is sufficiently large, the double vertical bars simply do not render at all. The norm symbols fail to render when $\left\lVert ... \right\rVert$ are used from within a macro defined in preamble.sty or when written directly. The norm symbols also fail when written as $\left\| ... \right\|$. The correct behavior is observed when extended MathJax is turned off.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.