emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Emphasis issues with special blocks and latex


From: User Name
Subject: Emphasis issues with special blocks and latex
Date: Tue, 14 Feb 2023 01:14:46 -0800

I am having several issues with the fontification of emphasis markers in org-special-blocks and inside latex equations in my org-files. 

I have changed `org-emphasis-regexp-components` to be the following...

```
  (with-eval-after-load 'org
    (setcar org-emphasis-regexp-components "\t('\"{[:alpha:]:-“”\[\\") ;; chars for prematch
    (setcar (nthcdr 1 org-emphasis-regexp-components) "\][:alpha:]-_^[:space:]:\t.,!?;''“”\")}/\\“”") ;; chars for postmatch
    (setcar (nthcdr 2 org-emphasis-regexp-components) "\\\\\t\r\n,\"") ;; forbidden chars
    (setcar (nthcdr 3 org-emphasis-regexp-components) ".") ;; body
    (setcar (nthcdr 4 org-emphasis-regexp-components) 5) ;; max newlines
    (org-set-emph-re 'org-emphasis-regexp-components org-emphasis-regexp-components))
```

I would like to be able to intersperse emphasis markers inside of strings, which is why I included alphabetical characters for pre and post-match. I'd like to be able to have *w*or*d* only bold the w & the d if possible, and to be able to use backslashes between emphasized words (eg. ideally =this=/d *be* /so//*cool*! should codify "this", italicize /so/, and bold "cool*). 

The main issue I get is that special-block metalines seem to get font-locked (eg. `#+begin_theorem` becomes `#+begintheorem` and the metalines themselves seem to cause the underlining of the contents within the block. Inside latex equations, I end up with fontlocking if I don't include spaces between underscores, pluses, minuses, or equal signs. I am wondering if there is a way to fix this by adding more forbidden characters (ie. forbid `#+begin_`, and `#+attr_latex` from being or causing emphasis, and forbid emphasis between $$ $$, \begin{} \end{}, \( \), \[ \], $ $) or possibly to include look-around using visual-regexp-sterioids.el. 

Thanks in advance.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]