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

Add support for markdown-mode #25

Open
maikol-solis opened this issue Oct 20, 2021 · 1 comment
Open

Add support for markdown-mode #25

maikol-solis opened this issue Oct 20, 2021 · 1 comment

Comments

@maikol-solis
Copy link

Hi!

As a naïve way to make laas to work with markdown-mode I modify the laas-mathp function (https://github.com/tecosaur/LaTeX-auto-activating-snippets/blob/master/laas.el#L60) to use laas-org-mathp to know if we are in a latex block in Markdown documents.

(defun laas-mathp ()
  "Determine whether point is within a LaTeX maths block."
  (cond
   ((derived-mode-p 'latex-mode) (texmathp))
   ((derived-mode-p 'org-mode) (laas-org-mathp))
   ((derived-mode-p 'markdown-mode) (laas-org-mathp))
   (t (message "LaTeX-auto-activated snippets does not currently support math in any of %s"
               (aas--modes-to-activate major-mode))
      nil)))

At least in my tests, everything is working fine. I can trigger all the snippets without problems.

I don't know if it's worth it to add it in into master.

Thanks.

@ymarco
Copy link
Collaborator

ymarco commented Dec 8, 2021

(Sorry for late response)
What? laas-org-mathp is defined with the org-element api, right? How the hell does this work in markdown?
Maybe texmathp would work in markdown, I'm not familiar with whether markdown allows things like straight up \begin{align} blocks, but laas-org-mathp?

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

No branches or pull requests

2 participants