Export org-mode to HTML: coloring in place

How can I specify a color for a piece of text that Emacs Org-Mode should use when exporting a file to HTML?

eg.

* Here is one bullet
  ** Here is another bullet
       Here is some text that I want in BOLD RED 
       Here is some other text that I want in the default face
+4
source share
4 answers

You do not say if it is disposable or not. CSS stylesheet makes sense if you need styles. To just do what you described once, you can include the HTML red directive in your org file, as shown below:

Here is some text that I want in *@@html:<font color = "red">@@BOLD RED@@html:</font>@@*

See Specifying HTML Tags in the Org Guide.

+7
source

. , , , , org-macros GitHub, .

( LaTeX), ( , Org ), https://github.com/fniessen/org-macros, "bgcolor", "color" "highlight" ( INCLUDE'ing org-macros.setup Org).

:

INCLUDE: path/to/org-macros.setup

Here is some text that I want in *{{{color(red, BOLD RED)}}}*.

, HTML, LaTeX ( ).

+5

CSS, html-, HTML HEAD:

#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="style1.css" />

Take a look at the exported html and classes that are assigned to different levels of org, and you can quickly build a simple stylesheet. There is a good example here: https://gist.github.com/mowen/326524

Here is the link: http://orgmode.org/manual/CSS-support.html#CSS-support

+1
source

Another way.

* Here is one bullet
** Here is another bullet
#+begin_html 
Here is some text that I want in <span style='color:red'>BOLD RED</span>
#+end_html
Here is some other text that I want in the default face
+1
source

Source: https://habr.com/ru/post/1523590/


All Articles