emacs-orgmode
[Top][All Lists]
Advanced

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

Re: how to export red colored TeX to latex


From: Uwe Brauer
Subject: Re: how to export red colored TeX to latex
Date: Tue, 30 Nov 2021 18:11:28 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

> Hi,
> Uwe Brauer writes:


> Not exactly related, but if it helps, I have defined this custom link
> for colored text segments:

> (NB: I apply two colors for `:face', because normally I use two themes,
> one clear for the day and another dark for the night hours: when my dark
> theme is active, apply a background color. But you can simplify that part to
> your liking):

> (org-link-set-parameters "color"
>                         ;; :display 'full
>                          :face (lambda (path) (when path
>                                                 (if (string= (face-attribute 
> 'default :background) "#282c34")
>                                                     `(:foreground ,path 
> :background "#F5f5f5")
>                                                   `(:foreground ,path))))
>                          :export (lambda (path desc format)
>                                    (cond
>                                     ((eq format 'latex)
>                                      (concat
>                                       "\\textcolor{"
>                                       path
>                                       "}{" desc "}"))
>                                     ((eq format 'html)
>                                      (format "<span
>                                        style=\"color:%s;\">%s</span>"
>                                        path desc)))))

> The link would then look like this, adapting John's solution using a
> LaTeX export snippet:

> [[color:red][@@latex:$\delta \phi = \frac{2 m}{R}$@@]]

Thanks, right now, I don't need links but it is good to know that there is a 
way to use them.

Attachment: smime.p7s
Description: S/MIME cryptographic signature


reply via email to

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