1

When using org-mode as a front-end to LaTeX, I'm making heavy use of inline code like @@latex:\textit{something italic}@@. Right now, this is mainly displayed as normal text (with proportional font and only \textit appearing monospaced). It would be great if this could be changed in two respects, making it more similar to code blocks that start with, e.g., #+BEGIN_EXPORT latex:

  1. @@latex: and @@ are greyed out;
  2. the content (i.e. \textit{something italic}) is shown using the regular LaTeX font lock.

How can I get to this?

0

I found out that my wishes can be fullfilled with this:

(font-lock-add-keywords 
 'org-mode
 '(("\\(@@latex:\\)\\(.*?\\)\\(@@\\)"
        (1 font-lock-comment-face)
        (2 '(org-latex-and-related))
        (3 font-lock-comment-face))
     ))

A reasonable alternative to (org-latex-and-related) would be (org-block).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.