emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: User Name <name58564@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Emphasis issues with special blocks and latex
Date: Tue, 14 Feb 2023 01:14:46 -0800	[thread overview]
Message-ID: <CAJx74Lhp1uPQRZuJW8Si-A60tqBjpyk6soX2RidR7MhfaC287w@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1871 bytes --]

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.

[-- Attachment #2: Type: text/html, Size: 2138 bytes --]

             reply	other threads:[~2023-02-15 12:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-14  9:14 User Name [this message]
2023-02-16 12:26 ` Emphasis issues with special blocks and latex Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJx74Lhp1uPQRZuJW8Si-A60tqBjpyk6soX2RidR7MhfaC287w@mail.gmail.com \
    --to=name58564@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).