Login  Register

Asciidoctor-pdf style overwrite possible?

Posted by Claudius Heine on Aug 01, 2018; 10:44am
URL: https://discuss.asciidoctor.org/Asciidoctor-pdf-style-overwrite-possible-tp6439.html

Hi,

I am currently writing a presentation with asciidoctor-revealjs and
also like to generate a handout from this using asciidoctor-pdf.

I have some bash code passages that need to be executed in different
contexts, so I choose to add classes to those code passages like this:

  [.greencode, source, bash]
  ----
  include::source.sh[tag=some-tag]
  ----

And then use the customcss attribute to change the background color of
this code segment like this:

  .greencode code {
      background-color: darkgreen;
  }

And that works great!

But how can I do something similar in the pdf output?

If I understand the documentation about the pdf styling correctly, then
its only possible to change the background of all code passages and not
just selectively. Is there a way around this or did I overlooked
something?

Thanks!
Claudius

--
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-54 Fax: (+49)-8142-66989-80 Email: [hidden email]

            PGP key: 6FF2 E59F 00C6 BC28 31D8 64C1 1173 CB19 9808 B153
                              Keyserver: hkp://pool.sks-keyservers.net

signature.asc (849 bytes) Download Attachment