Asciidoctor-pdf: Rendering table asciidoc text in 'table' style as set in .yml

Created on 22 Sep 2017  路  3Comments  路  Source: asciidoctor/asciidoctor-pdf

When publishing asciidoc to PDF using asciidoctor-pdf I can set custom text-styles for table-headings and table content in the .yml file. This works OK as long as there are no asciidoc table-cells in play.. My goal is to have a smaller font in tables than in the main text. In the example below I chose a small italic font for table cells..

screen shot 2017-09-21 at 16 36 09

I guess the desired general behaviour is to have the content of all cells more or less the same.. When I change the base style a bit I can get:

screen shot 2017-09-21 at 16 52 52

Quite close, but now all my document text is way too small :-).

Would be great if this can be fixed. If I can help in any way, let me know!


asciidoc source used in the examples:

.An example of asciidoc in a table. Desired is: all text looks the same.
[cols="15,15,35,35a",options="header",role="versiehistorie"]
|===
| Column1 | Column2 a| Column3 | Column4
|Text in first column |Column 2
a|Column 3

  • asciidoc cell
  • defined at the cell level

. first
. second
. Third

| This is the last column.

  • It contains asciidoc
  • And renders in PDF as 'asciidoc text'

. first
. second
. Third

|Tekst in first column, second row | http://www.asciidoctor.org/[mailing list] hyperlink in non-asciidoc cell
a|The very same link in asciidoc cell http://www.asciidoctor.org/[mailing list] defined at cell level!
| This is the last column. It is an asciidoc cell at table-level It contains a link: http://discuss.asciidoctor.org/[mailing list]
|===

duplicate

Most helpful comment

This issue is related to #926.

This is a limitation of the style inheritance in Asciidoctor PDF. It's not exactly clear what to do, since an AsciiDoc table cell is really a separate document. While we could try to inherit the base font size, what happens when it contains an element which has its own font size? I'm just not really sure how to approach this without adding an enormous amount of complexity.

If we could agree to apply a scaling factor, I think that might work.

All 3 comments

This issue is related to #926.

This is a limitation of the style inheritance in Asciidoctor PDF. It's not exactly clear what to do, since an AsciiDoc table cell is really a separate document. While we could try to inherit the base font size, what happens when it contains an element which has its own font size? I'm just not really sure how to approach this without adding an enormous amount of complexity.

If we could agree to apply a scaling factor, I think that might work.

Adding lots of complexity is not the thing to do for sure!

A scaling factor would be perfectly fine I guess.
That might mean: don鈥檛 mix non-asciidoc cell content and asciidoc content if you want to be sure not to get differences between text in different cells. But that is the case right now also and OK to me :)

This issue is being merged with #926.

Was this page helpful?
0 / 5 - 0 ratings