Color for Text

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Color for Text

Conrad
Hello,

I refer to https://discuss.asciidoctor.org/Asciidoctor-pdf-color-question-td4313.html#a5825.

How can I colorize text? If I understand the thread correctly there will be maybe a solution. The thread is from 2016.

I am using the downloadable version of AsciidoctorJ and I did not finde a stylesheet for pdf.

I tried "[red]#this is printed in red#" and it works with AsciidocFX, but not with AsciidoctorJ. Unfortunately the solution with AsciidocFX causes other problems (e.g. lack of TOC).

Conrad
Reply | Threaded
Open this post in threaded view
|

Re: Color for Text

habamax
Recent asciidoctor-pdf can have it. You should define a role in your theme and then use it:

For example, I have the following in my theme:

role:
  big:
    font_size: $base_font_size_large
  small:
    font_size: $base_font_size_small
  smaller:
    font_size: $base_font_size_small * 0.8
  tiny:
    font_size: $base_font_size_small * 0.5
  red:
    font_color: #ff0000
  green:
    font_color: #00aa00
  blue:
    font_color: #0000ff
  cyan:
    font_color: #00cccc
  pink:
    font_color: #cc00cc
  brown:
    font_color: #A0522D


Then in asciidoctor file:

[green]#Green text#
Reply | Threaded
Open this post in threaded view
|

Re: Color for Text

Conrad
Thank you. I will try this.

Are you (re)using a Standard theme? Could you tell me which one? I never used a pdf-theme, that's why I am asking.
Reply | Threaded
Open this post in threaded view
|

Re: Color for Text

habamax
At first I have used completely non-standard theme...

Now I just redefine some stuff, like brand colors, title-page, header and footer. :)


Check: https://github.com/asciidoctor/asciidoctor-pdf/#themes

Reply | Threaded
Open this post in threaded view
|

Re: Color for Text

mojavelinux
Administrator
> Now I just redefine some stuff, like brand colors, title-page, header and footer. :)

I love to hear that this new feature is proving helpful! Yeah!

-Dan

On Fri, Jan 24, 2020 at 12:20 AM habamax [via Asciidoctor :: Discussion] <[hidden email]> wrote:
At first I have used completely non-standard theme...

Now I just redefine some stuff, like brand colors, title-page, header and footer. :)


Check: https://github.com/asciidoctor/asciidoctor-pdf/#themes




If you reply to this email, your message will be added to the discussion below:
https://discuss.asciidoctor.org/Color-for-Text-tp7509p7527.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML


--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux
Reply | Threaded
Open this post in threaded view
|

Re: Color for Text

habamax
> I love to hear that this new feature is proving helpful! Yeah!

Yes, indeed! Default theme as of now looks beautiful. (this is subjective of course, but nevertheless)