1

How to change the font size of a specific table in Asciidoc (PDF)?

I already tried a custom role:

role:
    small:
        font-size: 10

Table:

[.small]
[options="header"]
|===
|Vielfachheit |Feldname |Beschreibung |XML-Tag
|1 |Einzelsicht | |view (Tag)
|===

But it didn't change anything.

EDIT:

Looks like this isn't possible according to a similar question: Is there any way to change the text size (font size) of specific blocks when you using asciidoc?

Michael
  • 2,528
  • 3
  • 21
  • 54

1 Answers1

0

Your solution does work when converting to html but not when converting to pdf. It is currently not possible to set a custom roles to a table with with PDF styling, see https://docs.asciidoctor.org/pdf-converter/latest/theme/custom-role/

Custom roles only apply to paragraphs and inline phrases.

The solution you have is to set the role directly to the text:

[options="header"]
|===
|[.small]#Vielfachheit# |Feldname |Beschreibung |XML-Tag
|1 |[.small]#Einzelsicht# | |view (Tag)
|===

Obvisouly the readability is not good but it does work and you do that for only a few cells this might be ok.

Note: I do not know why you want to change the font size for one single table but if you want to highlight it differently than the rest you could also put it inside an example block or a sidebar

Kiroul
  • 465
  • 2
  • 9
  • Changing the font size is one technique to get a wide table to fit within the available space. The other alternative would be to adjust the table design, such as flipping the rows/cells, or splitting into two tables, using acronyms, etc. – eskwayrd May 12 '22 at 16:38