emacs-orgmode
[Top][All Lists]
Advanced

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

[O] Merging Faces


From: Florian Beck
Subject: [O] Merging Faces
Date: Mon, 16 Oct 2017 22:56:30 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1

Hello everyone,

how do you add custom face properties to an org buffer?

I want to generate org buffers automatically (displaying verious entries and properties). Specifically, I want the resulting buffer in org mode to handle links, equations, and export. But I want also to add custom background or fonts to parts of the buffer.

The easiest way to see the problem is this:

(let ((entry
       (concat
        "any "
        (propertize "link" 'font-lock-face '(:family "DejaVu Sans Mono"))
" like [[file:some-file]] or equations like \\(\\sqrt{\\frac{1}{(x+y)^2\\), but also /italics/ and *bold text* should be displayed correctly;")))
  (switch-to-buffer-other-window
   "*fb-merging-example")
  (erase-buffer)
  (insert (propertize (concat "1. " entry)
                      'font-lock-face '(:background "yellow")
                      'underline t))
  (insert "\n2. other font:")
  (insert (propertize entry 'font-lock-face '(:family "Symbola")))
  (org-mode))

Two problems:
1. "link" has not the right font. I guess `propertize' doesn't merge face. Is there a way to accomplish this?
2. Links and equations don't have the desired background.

Any help appreciated.




reply via email to

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