emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Help: How to change faces of words between parenthesis
@ 2024-02-11 13:57 Ypo
  2024-02-11 14:20 ` Ihor Radchenko
  2024-02-13 23:33 ` William Denton
  0 siblings, 2 replies; 4+ messages in thread
From: Ypo @ 2024-02-11 13:57 UTC (permalink / raw)
  To: Org-mode

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

Could it be possible to change the color of words between parentheses?

For example, in:

"mejorar su bienestar psicológico (Cronin et al., 2012; Molero, Fuster, 
Jetten y Moriano, 2011; Outten, Schmitt, García y Branscombe, 2009; 
Pérez-Garín et al., 2016)."

I would like that this part changes into a lighter color, so it doesn't 
distract me when reading:

"(Cronin et al., 2012; Molero, Fuster, Jetten y Moriano, 2011; Outten, 
Schmitt, García y Branscombe, 2009; Pérez-Garín et al., 2016)"


Best regards

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Help: How to change faces of words between parenthesis
  2024-02-11 13:57 Help: How to change faces of words between parenthesis Ypo
@ 2024-02-11 14:20 ` Ihor Radchenko
  2024-02-13 23:33 ` William Denton
  1 sibling, 0 replies; 4+ messages in thread
From: Ihor Radchenko @ 2024-02-11 14:20 UTC (permalink / raw)
  To: Ypo; +Cc: Org-mode

Ypo <ypuntot@gmail.com> writes:

> Could it be possible to change the color of words between parentheses?
>
> For example, in:
>
> "mejorar su bienestar psicológico (Cronin et al., 2012; Molero, Fuster, 
> Jetten y Moriano, 2011; Outten, Schmitt, García y Branscombe, 2009; 
> Pérez-Garín et al., 2016)."
>
> I would like that this part changes into a lighter color, so it doesn't 
> distract me when reading:

(defun yant/apply-custom-faces ()
  (add-to-list 'org-font-lock-extra-keywords '("([^)]+)" . (0 'font-lock-comment-face prepend)) 'append))
(add-hook 'org-font-lock-set-keywords-hook #'yant/apply-custom-faces)

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Help: How to change faces of words between parenthesis
  2024-02-11 13:57 Help: How to change faces of words between parenthesis Ypo
  2024-02-11 14:20 ` Ihor Radchenko
@ 2024-02-13 23:33 ` William Denton
  2024-02-17 19:53   ` Kepa
  1 sibling, 1 reply; 4+ messages in thread
From: William Denton @ 2024-02-13 23:33 UTC (permalink / raw)
  To: Ypo, Emacs Org mode mailing list

On Sunday, February 11th, 2024 at 08:57, Ypo <ypuntot@gmail.com> wrote:

> Could it be possible to change the color of words between parentheses?
> 
> For example, in:
> 
> "mejorar su bienestar psicológico (Cronin et al., 2012; Molero, Fuster, Jetten y Moriano, 2011; Outten, Schmitt, García y Branscombe, 2009; Pérez-Garín et al., 2016)."

For citations in brackets, another approach might be to use Org's citation system with the CSL export processor, and then use András Simonyi's org-cite-csl-activate and customize the face:

https://github.com/andras-simonyi/org-cite-csl-activate

That might involve changing your whole citation process, which is a big step, but citations are on my mind so I thought I'd mention it.

Bill

--
William Denton
https://www.miskatonic.org/
Librarian, artist and licensed private investigator.
Toronto, Canada


> 
> 
> 
> Best regards


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Help: How to change faces of words between parenthesis
  2024-02-13 23:33 ` William Denton
@ 2024-02-17 19:53   ` Kepa
  0 siblings, 0 replies; 4+ messages in thread
From: Kepa @ 2024-02-17 19:53 UTC (permalink / raw)
  To: emacs-orgmode, william

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

Thanks, William

I'm not writing citation. I am studying a text, and it has citations. To 
delete them all, generates friction, while to let them all be, generates 
distraction. So with the help of Ihor (and chatgpt) I have added this 
code to my init file, so they are shadowed:

(defun yant/apply-custom-faces ()
   (add-to-list 'org-font-lock-extra-keywords 
'("(\\([A-Z][a-zA-Z]*[^)]*[0-9]\\{4\\}[^)]*\\))" . (0 'shadow prepend)) 
'append))
(add-hook 'org-font-lock-set-keywords-hook #'yant/apply-custom-faces)


About citations: A time ago I learned to use org-ref, but my PC is not 
very powerful, so Emacs turned to be too slow. Then I stopped working 
with citations.

By now I am adding bibtex properties to my headlines, so in the future I 
can use org-bibtex and probably I will learn about citation with your 
tutorials: https://www.miskatonic.org/2024/01/08/org-citations-basic/

Best regards


On 14/02/2024 0:33, William Denton wrote:
> On Sunday, February 11th, 2024 at 08:57, Ypo<ypuntot@gmail.com>  wrote:
>
>> Could it be possible to change the color of words between parentheses?
>>
>> For example, in:
>>
>> "mejorar su bienestar psicológico (Cronin et al., 2012; Molero, Fuster, Jetten y Moriano, 2011; Outten, Schmitt, García y Branscombe, 2009; Pérez-Garín et al., 2016)."
> For citations in brackets, another approach might be to use Org's citation system with the CSL export processor, and then use András Simonyi's org-cite-csl-activate and customize the face:
>
> https://github.com/andras-simonyi/org-cite-csl-activate
>
> That might involve changing your whole citation process, which is a big step, but citations are on my mind so I thought I'd mention it.
>
> Bill
>
> --
> William Denton
> https://www.miskatonic.org/
> Librarian, artist and licensed private investigator.
> Toronto, Canada
>
>
>>
>>
>> Best regards

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-02-24 15:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-11 13:57 Help: How to change faces of words between parenthesis Ypo
2024-02-11 14:20 ` Ihor Radchenko
2024-02-13 23:33 ` William Denton
2024-02-17 19:53   ` Kepa

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).