cursorless icon indicating copy to clipboard operation
cursorless copied to clipboard

[Help] Getting Mathfly in VSCode Working

Open davidleejy opened this issue 1 year ago β€’ 17 comments

Hi,

I happened to come across a fascinating YouTube video that demonstrates how LaTeX math can be typed in VSCode with the help of MathFly and Talon (https://www.youtube.com/watch?v=v0j2_W97_s0) and went ahead to try setting up MathFly + Cursorless. My hope is that such a setup would help speed up my efforts to digitize my math material and also do math directly in a commo typesetting framework.

Thus far, I've managed to get cursorless working in VSCode; I know this because I can see Talon hats above characters in text files opened in VSCode.

Next, I tried to install mathfly (https://github.com/mrob95/mathfly-talon) by cloning the entire repository into ~/.talon/users/mathfly-talon. However, unfortunately, I don't seem to be able to use mathfly commands in VSCode, which led me to seeking help here.

Is there something extra I need to do in Cursorless to enable mathfly commands in VSCode?

Do I need to modify the context set in mathfly scripts so that mathfly commands are considered by Talon and Cursorless when I issue voice commands in VSCode?

How can a user check what scripts are active in Talon/Cursorless?

Thank you for reading. πŸ˜„

davidleejy avatar May 20 '24 19:05 davidleejy

Glad you liked the video! πŸ™ŒπŸ˜Š

Did you follow all the steps in the cursorless installation instructions? Do cursorless commands work? Eg "take air"

pokey avatar May 20 '24 20:05 pokey

Thanks @pokey for sharing that video and for writing in to have a look at my situation πŸ˜ƒ .

Did you follow all the steps in the cursorless installation instructions? Do cursorless commands work? Eg "take air"

Yes, I followed the installation steps, and can perform cursorless commands like "take air". I am also able to see Talon hats above characters in the editor.

davidleejy avatar May 21 '24 10:05 davidleejy

Ok. Which mathfly command did you try, and what happens when you try it? And does anything appear in your talon log?

pokey avatar May 21 '24 10:05 pokey

Saying "greek alpha" in command mode, Talon doesn't catch it – the subtitles (that I've enabled) show text other than "greek alpha".

Saying "greek alpha" in dictation mode, Talon catches it fine and prints the string "greek alpha" in the .tex file in VSCode.

Saying "begin equation" in command mode, akin to the saying "greek alpha" in command mode, Talon doesn't catch it – the subtitles show text other than "begin equation".

I'm not sure if I have to say a certain phrase to enable "mathfly mode", if there's such a thing?

davidleejy avatar May 21 '24 10:05 davidleejy

You need to use my fork of mathfly in order for it to work with Cursorless; looks like your link above is the mainline mathfly. Btw worth asking on the #maths channel in the Talon slack workspace to see if anyone has improved on my fork; it was very much just a proof of concept

pokey avatar May 21 '24 10:05 pokey

I have replaced the mainline mathfly with your fork of mathfly. After I say "wake up", and Talon wakes up and is in command mode, what should I say next to test if the mathfly scripts are working? At the moment, it doesn't seem to be working :( I have restarted Talon and VSCode.

davidleejy avatar May 21 '24 13:05 davidleejy

"greek alpha" should work if you're in a .tex file in VSCode

pokey avatar May 21 '24 14:05 pokey

and really any of the commands from my video should work I think

pokey avatar May 21 '24 14:05 pokey

Yep, I am in a .tex file, but none of the latex commands work. Saying "document class article", "greek alpha", "begin equation" while Talon is in command mode causes Talon to interpret these as if I were saying other things (I am able to see Talon printing its interpretation on-screen as subtitles).

By any chance do I need to install any other VSCode extensions? Like any LaTeX related extensions?

davidleejy avatar May 21 '24 16:05 davidleejy

Huh strange. Might be easiest to drop into one of our Discord meet-ups (link; calendar (times in UTC))

pokey avatar May 21 '24 17:05 pokey

Hi @maxbruening, couldn't help but notice that your fork of mathfly has been under active development recently, and was wondering if it would be all right to bounce off an issue I'm facing in getting @pokey 's mathfly to work.

I have:

  • Installed Talon.
  • Installed the Cursorless extension, Talon extension, and LaTeX Workshop extension in VSCode.
  • Installed MacTex package for VSCode's LaTeX Workshop extension to use.

and am able to use Cursorless in VSCode, and successfully compile .tex files into pdf files through VSCode. I am on Mac OS Sonoma & VSCode version 1.89.1.

It would appear that every mathfly-related component is working as expected except for mathfly's script.

If you happen to recall whether additional steps were needed to get mathfly to work, or modifications to the mathfly scripts (e.g., modified the script's "active context" setting), please feel free to let me know.

Thanks for reading, and hope you have a pleasant day. πŸ˜„

davidleejy avatar May 24 '24 02:05 davidleejy

I would definitely recommend dropping into one of our Cursorless meet-ups to debug. It's a bit hard to for us to figure out what's going on without a screenshare

pokey avatar May 24 '24 11:05 pokey

I would definitely recommend dropping into one of our Cursorless meet-ups to debug. It's a bit hard to for us to figure out what's going on without a screenshare

Would be happy to consider virtually meeting some of the people who have worked on or contributed cursorless, and maybe chat with some cursorless users. Is the cursorless meet-up schedule available somewhere online? I did a cursory google search for cursorless meet ups to no avail.

davidleejy avatar May 25 '24 05:05 davidleejy

https://github.com/cursorless-dev/cursorless/issues/2349#issuecomment-2123079598

pokey avatar May 25 '24 07:05 pokey

Agree with pokey that dropping in on the cursorless meetups makes most sense. Generally, the talon slack channel can also be super helpful. But if pokey is telling you he is willing to help in person, I would take him up on the offer, it will be hard to find more competent help ;)

maxbruening avatar May 25 '24 13:05 maxbruening

Thanks @pokey and @maxbruening, will look into joining a cursorless meetup as soon as possible πŸ˜„. Any days (Tues/ Thurs/Sun) that might possibly be more conducive for troubleshooting with newcomers? Cheers, and have a great week ahead.

davidleejy avatar May 27 '24 06:05 davidleejy

Thanks @pokey and @maxbruening, will look into joining a cursorless meetup as soon as possible πŸ˜„. Any days (Tues/ Thurs/Sun) that might possibly be more conducive for troubleshooting with newcomers? Cheers, and have a great week ahead.

Nope they're all great times for troubleshooting with newcomersβ€”that's what they're for 😊

pokey avatar May 27 '24 09:05 pokey