This plugin is a fork of Obsidian Latex Suite.
This plugin only support Windows x86_64.
This plugin is the same as Obsidian Latex Suite, except a new function autoIM.
AutoIM allow you to change your InputMethod languague when you come in or out the math environment. Commonly, you should type an extra Shift
to achieve it.
This is not for those whose first language is English.
For personally reason, this plugin would never be submitted to the community.
If you want to use it, there are two choices:
-
compile from source code, see Build a plugin for detail. Still need
im.exe
from release. -
download Obsidian Latex Suite and replace its file.
download Obsidian Latex Suite and replace its file
You can download Obsidian Latex Suite from community
Obsidian > Settings > Community plugins > Browser
Once you downloaded it, you can see four files at latex-suite file
<vault directory>\.obsidian\plugins\obsidian-latex-suite
Then you can get release zip from this repository. It contain main.js
and im.exe
.
-
For
main.js
, Replacemain.js
in latex-suite file with this version. -
For
im.exe
, put it at wherever you want, but remember its path.
Now you can enter you obsidian, before use autoIM, you need to edit the settings of Latex-Suite, setting the Auto IM Path to the path of im.exe
and reenable Auto IM.
You can find settings in
Obsidian > Settings > Latex Suite > Auto IM Settings
You need to replace main.js
and set path in every valuts you wanted to use autoIM. But they can share im.exe
.
I have no better idea about how to find the math environment efficienty.
I was trying to use the strategy of Latex-Suite but it act strange in my plugin. In fact I am not familiar with typescript, not to say codemirror.
The need of autoIM only come from editing math equation. Integrate the function to Latex-Suite is convinient and simple, especially when Latex-Suite greately accelerated math writing.
Obsidian Plugins are writing in typescript. Typescript cannot change IM itself. It depends on Windows api in C.
There are several ways to using Windows api in Typescript:
-
package
ffi-napi
, I never success on installing it. -
WASI
inWASM
, don't work for unkown reason. -
pacakge
koffi
, it can call functions in dll in javascript. -
nodejs
n-api
, it can also call functions in dll in javascript, faster thankoffi
but need more C skills.
The above two strategies work in nodejs. Saddly, not in Obsidian Plugin. I have no way handling .node
addon by ESBuild.
- run
exe
, in this case is theim.exe
This is the slowest method, but it work. See autoIM Extension File for detail.
In default, the language in text environment is Chinese. If you want to use another language, you just need to change im.exe
.
AutoIM run command im.exe
when coming into text environment, and im.exe 1
when coming into math environment. You can make a new im.exe
and tell autoIM its path by settings.
Thank for Obsidian Latex Suite for its environment and method of detecting mouse moving.
Thank for Auto Shift Input for its method of switching the InputMethod.
Thank for Vim IM Switch for its method of running C program in Obsidian plungins.