Show custom ‘#+BEGIN’ … ‘#+END’ environments (advanced commands, org blocks, theorems)

Can one configure Logseq to parse custom ‘#+BEGIN’ … ‘#+END’ instances. Take this example from the orgmode manual

#+BEGIN_proof
  ...
  Therefore, any even number greater than 2 is the sum of two primes.
#+END_proof

Currently, after exiting the block, the text “Therefore, […]” will be rendered, but the lines #+BEGIN_proof and #+END_proof will be hidden. In Emacs, that syntax is parsed by org export mechanism to produce proper latex, so I would like to be able to keep some pages with this kind of math environment (theorem, lemma, proposition) and have some indication that its there when not editing a block.

Does anyone have any idea of how to achieve this? I looked into the source code on github but couldn’t really pinpoint where to tackle the issue. In the definition of block-commands-map in commands.cljs, the comment

    ;; Allow user to modify or extend, should specify how to extend.

gave me hope that it shouldn’t be difficult, but even after having gone through other files (like html_parser.cljs) I am still at a loss.

1 Like

I also would be very interested in this. I’ve been trying to reproduce the style of admonition callouts in Obsidian. While this can sort of be done using macros, being able to define custom environments whose contents are parsed as Markdown would make things much cleaner and easier.

as far as I know, the feature above

(advanced commands, org blocks, theorems)

seems to depend on org babel, which is a prime example of literate programming, in Emacs, including features like code block embedding and execution, result capture and display, session management, and parameter passing. Developed over decades, it supports a multitude of languages. Implementing this in Logseq seems very difficult. Hope this helps you.