Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to control where prose indent is applied #2034

Closed
odrotbohm opened this issue Apr 15, 2022 · 15 comments
Closed

Allow to control where prose indent is applied #2034

odrotbohm opened this issue Apr 15, 2022 · 15 comments
Assignees
Milestone

Comments

@odrotbohm
Copy link

Defining a prose.indent property causes the first line of every paragraph indented. However, in books that first line indentation is often skipped for the first paragraph after a heading, table, image, i.e. if the preceding content element is not a paragraph in turn.

It would be nice if one could choose between these application modes of the setting.

@mojavelinux
Copy link
Member

Can you point me a book that uses this style so that I can study it?

@odrotbohm
Copy link
Author

Screenshot 2022-04-15 at 23 48 45

Does this help?

@mojavelinux
Copy link
Member

Can you cite which book that is an in which reader you are using to view it?

@mojavelinux
Copy link
Member

@mojavelinux
Copy link
Member

Both Chicago and APA require the indentation on the first paragraph, so there are clearly two styles.

As far as the code is concerned, we do have the ability to check if the previous sibling is a paragraph, so technically its possible to support. Though we do need to decide how this is going to be expressed in the theme. To keep with the CSS theme, we could using something like prose_first_of_group_indent which would allow you to zero it out for the first paragraph in a sequence of paragraphs. The other option would be to focus on the indent key itself, such as prose_indent_style: full-out.

@mojavelinux
Copy link
Member

mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Apr 18, 2022
…ent paragraph if prose-adjacent-text-indent key is set in theme
@mojavelinux
Copy link
Member

Here's what I propose. If prose-text-indent is set, then it is applied to every paragraph. If prose-adjacent-text-indent is set, it is only applied to a paragraph that follows an adjacent paragraph.

prose:
  margin-inner: 0
  adjacent-text-indent: 10.5

Does that sound reasonable?

@mojavelinux mojavelinux self-assigned this Apr 18, 2022
@mojavelinux mojavelinux added this to the v2.0.0 milestone Apr 18, 2022
@odrotbohm
Copy link
Author

Thanks for all this research, Dan. Happy to let you decide here, as you're by far more intimate in how the inter-relationship of configured properties works in other places already.

@mojavelinux
Copy link
Member

Thanks for the feedback Oliver.

I was thinking that since we use the term "inner" to refer to the margin between adjacent paragraphs, we should stick with that terminology here as well. That could help make the key more intuitive.

prose:
  margin-inner: 0
  inner-text-indent: 10.5

Unless there is an objection, I'll move forward with this proposal.

mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Apr 18, 2022
…ent paragraph if prose-adjacent-text-indent key is set in theme
@mojavelinux
Copy link
Member

When coming back to this with fresh eyes, I realized that the placement of the "inner" keyword is not consistent between the two terms, which could be confusing. I propose making it parallel:

prose:
  margin-inner: 0
  text-indent-inner: 10.5

The inner qualifier means it only applies at the intersection of two adjacent paragraphs.

@odrotbohm
Copy link
Author

I can confirm this now works as expected. Happy to adjust configuration property name as you see fit.
Screenshot 2022-04-19 at 10 43 09

@mojavelinux
Copy link
Member

That looks great! Thanks for sharing!

@odrotbohm
Copy link
Author

I have a tiny follow-up for this one: Asciidoctor Bibtex extension renders each entry as paragraph, which now causes all entries but the first one to be indented (see below). I fully understand why it renders the way it renders and am afraid that it's hard to fix without Bibtex fundamentally changing the way it renders the entries.

Do you see a short-term workaround accidentally?

Screenshot 2022-04-26 at 14 32 47

@mojavelinux
Copy link
Member

As I've expressed before, asciidoctor-bibtex should be generating the bibliography as a list, not as separate paragraphs. If that extension were producing a list, you would not get this behavior.

@odrotbohm
Copy link
Author

Using asciidoctor/asciidoctor-bibtex#84 as a hacky workaround for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants