Closed habamax closed 4 years ago
You're correct that the table / table cell settings don't inherit into an AsciiDoc table cell. That's because an AsciiDoc table cell is effectively a separate / sub document. It would be extremely difficult to have it inherit the settings because it would require the converter for every other block to check if it is inside of a table and change the behavior accordingly. I'm happy to be proven wrong.
Got it. Let us hope we will resolve it sometime in the future.
@mojavelinux: just replied to your remark in #852: making this a scale (%) in the yaml (for both adoc and non-adoc table content) would be great.
Hi, I'm affected by the problem as well and would be very happy to see a fix.
The solution based on a scaling factor would already be very useful. Alternatively I could imagine that being able to apply a custom style (as discussed in #483 ) would also work and allow for more flexibility
It took me a bit to figure out that this was the cause of my inability to format a
table cells.
Is there a workaround? I'm trying to figure out if there's a way to add some specificity to the cells so that I can apply a small font_size
to the a
cells.
@mojavelinux Can you point me to the relevant code where the sub-document rendering is triggered? I'd like to try my hand at adding this feature.
Update: It looks like the below link points to where the a
cell rendering is triggered. Let me know if I'm on the wrong path.
https://github.com/asciidoctor/asciidoctor-pdf/blob/master/lib/asciidoctor-pdf/converter.rb#L1683-L1686
Hi @DaneWeber,
Did you have the opportunity to look at this yet? Maybe we can come up with a 'simple solution' (affecting only text-size...). Would be wonderful. Not Ruby-savvy here, but if I can help, I'd love to.
Are there any news or solutions for this issue?
I understand the difficulties that could arise when using sections, etc. inside the cell so maybe inheriting the font size could be optional via a separate setting in the theme. This would make it work at least when just simple formatting like lists or images are used. Also the proposed scale factor would be fine.
It somehow works when using the docbook/FOP toolchain but I don't know to which extend.
If we ignore the style overrides from elements in the cell, this is rather easy to implement. I have submitted a proposal that merely inherits the font properties from the table (like other cells). See https://github.com/asciidoctor/asciidoctor-pdf/pull/1678
It somehow works when using the docbook/FOP toolchain but I don't know to which extend.
This is not a helpful statement since that's a completely different technology. You're comparing apples to oranges.
Thx, will test it as soon as it lands into master.
I think I can implement a very crude font scaling for elements that define their own font size. They would be scaled by the ratio of the table font size to the base font size. It may miss some cases, but we can deal with those.
Since this change is rather significant, I think we may need to consider a global setting to disable this behavior.
They would be scaled by the ratio of the table font size to the base font size. It may miss some cases, but we can deal with those.
Sounds good!
I think I can implement a very crude font scaling for elements that define their own font size. They would be scaled by the ratio of the table font size to the base font size. It may miss some cases, but we can deal with those.
This sounds good, thank you!
It somehow works when using the docbook/FOP toolchain but I don't know to which extend.
This is not a helpful statement since that's a completely different technology. You're comparing apples to oranges.
Yes, but maybe they should produce a rather similar output when using similar style/template settings and using the same asciidoc source. There are other features which work well with Asciidoctor-PDF but do not seem to work with docbook/FOP (e.g. column headers).
I'm glad you like the idea.
maybe they should produce a rather similar output when using similar style/template settings and using the same asciidoc source.
Aside from the AsciiDoc source, there's nothing similar about these technologies. They have completely different ways of working and of styling. You could say that you're able to do something with FOP and you'd like to be able to do it with Asciidoctor PDF. And that's useful. But just because it works in FOP doesn't mean it does or can work here in this converter.
Let's say that by default the font properties inherit from table (which also means the font of nested blocks will be scaled). To disable this behavior, you can set table_asciidoc_cell_style: initial
in the theme. In this case, initial
means to reset the styling back to what it would be initially, ignoring the table cell styles. In other words, initial
means "don't inherit".
I think this PR is ready to go.
Thx, looks good for me
The only "issue" is that literal cells are not affected:
I will just stop using literal cells and for me issue is closed, thank you again!
You're right that literal cells are something entirely different. They take on the size of the code block, not the table cell (though it might be reasonable to consider scaling that font size too).
Thank you!
You're welcome!
If you'd like to file that follow-up issue for literal table cells, go ahead.
Theme file snippet:
Asciidoctor snippet:
How it looks like:
I believe that font size specified for table should be applied to all cells.