Indentation in asciidoctor-pdf

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Indentation in asciidoctor-pdf

oddhack
I understand (in principle, anyway) how to use a custom role to indent text in HTML output, but it's not clear how to do this with the YML theming support for asciidoctor-pdf. My reading of https://github.com/asciidoctor/asciidoctor-pdf/blob/master/docs/theming-guide.adoc is that I can change style parameters, but only on a global basis for all pages or all "prose" content - not specialized to user-defined roles, which "only apply to inline phrases and only support changing the font properties". Am I missing something here? If so, a minimal example would be helpful.

N.b. we have been using un-labelled descriptive lists ("  :: text") to indent equations. Apparently this no longer works in asciidoctor 2, so we'll have to migrate eventually.
Reply | Threaded
Open this post in threaded view
|

Re: Indentation in asciidoctor-pdf

mojavelinux
Administrator
Jon,

The theming goals for Asciidoctor PDF started out very modest, and have mostly remained that way due to limitations in the PDF generation library. While the theming system is inspired by CSS, it's not CSS, and thus doesn't come anywhere close to what can be done with CSS in the browser.

The idea of the theming system has always been to provide reasonable defaults and the ability to configure the stylistic aspects such as font family, size, and color, border size and width, background color or image, and so forth. What it cannot do is fundamentally change the layout of the elements on the page. Those are essentially fixed layouts.

> not specialized to user-defined roles

Currently, user-defined roles only apply to inline elements (and even that was a recent addition).

We could consider allowing left/right margins to be controlled using a role on the block. This would be an enhancement.

> N.b. we have been using un-labelled descriptive lists ("  :: text") to indent equations. Apparently this no longer works in asciidoctor 2, so we'll have to migrate eventually.

I strongly advise against abusing the semantics for the purpose of layout. This is not a good practice. But to help you with the transition, you can restore the existing behavior using "{empty}:: text" (you just need something in the slot before the delimiter.

-Dan

p.s. Knowing there are limitations to how much a PDF can be themed using Asciidoctor PDF, we're beginning to explore alternative approaches.

On Sat, Aug 17, 2019 at 3:58 PM oddhack [via Asciidoctor :: Discussion] <[hidden email]> wrote:
I understand (in principle, anyway) how to use a custom role to indent text in HTML output, but it's not clear how to do this with the YML theming support for asciidoctor-pdf. My reading of https://github.com/asciidoctor/asciidoctor-pdf/blob/master/docs/theming-guide.adoc is that I can change style parameters, but only on a global basis for all pages or all "prose" content - not specialized to user-defined roles, which "only apply to inline phrases and only support changing the font properties". Am I missing something here? If so, a minimal example would be helpful.

N.b. we have been using un-labelled descriptive lists ("  :: text") to indent equations. Apparently this no longer works in asciidoctor 2, so we'll have to migrate eventually.


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Indentation-in-asciidoctor-pdf-tp7096.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML


--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux
Reply | Threaded
Open this post in threaded view
|

Re: Indentation in asciidoctor-pdf

oddhack
Thanks. I understand the design principle on not mixing structure and layout, but given the choice between abusing it, and not being able to accomplish something like the layout we were after, we did it anyway. We're in no great rush to migrate to asciidoctor 2, and hopefully there will be better PDF options, or more explicit margin control as you allude to, by that point.