AsciidocFX icon indicating copy to clipboard operation
AsciidocFX copied to clipboard

PDF Text Color

Open nLz00 opened this issue 1 year ago • 4 comments

Hi, i have problems setting up text colors. The preview for PDF shows colored text, the actual output not.

tests in a fresh editor:

[blue]#*BLAU*# +
[yellow]#*GELB*# +
[red]*ROT*

nLz00 avatar Apr 05 '24 13:04 nLz00

For pdf theming you should define a asciidoctor-pdf theme and colors you want to use. Please check https://discuss.asciidoctor.org/Color-for-Text-td7509.html

rahmanusta avatar May 08 '24 20:05 rahmanusta

I really dont know how to do this. I cant find a *.yml file in which it could find place. Further help appreciated.

nLz00 avatar Jul 03 '24 08:07 nLz00

Please ask on https://discuss.asciidoctor.org/ since it is Asciidoctor specific question

rahmanusta avatar Jul 03 '24 20:07 rahmanusta

My settings cannot freely set the color for a specific WORD. I can only set it according to the defined blocks, such as Header1, Header2, Header3 and so on.

Create theme file

custom-color-theme.yml

# FOR Asciidoctor-PDF 2.x
extends: default-with-font-fallbacks

# Set the base text color
base_font_color: #333333

heading:
# Color for H1 headings
  h1_font_color: #1a73e8
# Color for H2 headings  
  h2_font_color: #1a73e8
# Color for H3 headings  
  h3_font_color: #1a73e8
# Color for links  
link:
  font_color: #0000ee
# Color for literal text or code
literal:
  font_color: #d63384

demo3.adoc

= Asciidoc Theme Custom Color Demo
:pdf-themesdir: {docdir}
:pdf-fontsdir: GEM_FONTS_DIR;
:pdf-theme: custom-color

== Test Level 2

This is a Test 2.

This is a Link https://docs.asciidoctor.org/pdf-converter/latest/theme/[Asciidoctor PDF Theming]

=== Test Level 3

This is a Test 3.

AsciidocFx open demo3.adoc

PDF -> Save 003

Show PDF Color

004

custom-color-theme.yml and demo3.adoc must be placed in the same directory.

life888888 avatar Aug 19 '24 15:08 life888888