Add support for markdown-mode #25

Open
opened 2021-10-20 15:51:43 +00:00 by maikol-solis · 1 comment
maikol-solis commented 2021-10-20 15:51:43 +00:00 (Migrated from github.com)

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.

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 commented 2021-12-08 16:21:23 +00:00 (Migrated from github.com)

(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?

(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 in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: tec/LaTeX-auto-activating-snippets#25
No description provided.