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

Abstract with title not possible #698

Closed
mdreier opened this issue Dec 13, 2016 · 5 comments
Closed

Abstract with title not possible #698

mdreier opened this issue Dec 13, 2016 · 5 comments
Assignees
Milestone

Comments

@mdreier
Copy link

mdreier commented Dec 13, 2016

I was trying to create an abstract with a title in order to have different styles for the header and the remaining content. This is the relevant section of my custom style:

abstract:
  font_size: 18
  font_style: normal
  line_height: 1
  padding: [0.3cm, 0, 42, 0]
  title:
    align: left
    font_size: 20
    font_style: bold

(If you wonder about the large font size, I am using this as a workaround for #95).

When I use a non-structured abstract, the (non-title) abstract style is applied correctly.

= Title Lorem ipsum dolor sit amet
John Doe <john.doe@example.com>
v1.3, December 2016
:notitle:

[abstract]
*Headline Lorem ipsum dolor sit amet, consectetaur adipisicing elit, sed doeiusmod* +
Subheadline Lorem ipsum dolor sit amet, consectetaur adipisicing elit, sed doeiusmod tempor incididunt

However, as soon as I include a title in the abstract section, the abstract style is disregarded completely and the section is styled according to the normal heading and content styles.

= Title Lorem ipsum dolor sit amet
John Doe <john.doe@example.com>
v1.3, December 2016
:notitle:

[abstract]
== Headline Lorem ipsum dolor sit amet, consectetaur adipisicing elit, sed doeiusmod
Subheadline Lorem ipsum dolor sit amet, consectetaur adipisicing elit, sed doeiusmod tempor incididunt

Looking at the documentation it should be possible to have an abstract with a title. In case this is relevant, I am using the article document style.

I may be doing this incorrectly, but it looks more like an issue with the PDF generator to me.

@mojavelinux
Copy link
Member

Currently, a section cannot act as an abstract in Asciidoctor (though it does seem to work by chance for the DocBook output). You would need to wrap the abstract in an open block and use a discrete heading as follows.

[abstract]
--
[discrete]
== Headline Lorem ipsum dolor sit amet, consectetaur adipisicing elit, sed doeiusmod

Subheadline Lorem ipsum dolor sit amet, consectetaur adipisicing elit, sed doeiusmod tempor incididunt
--

But what you likely want to do is just add an abstract title:

[abstract]
.Headline Lorem ipsum dolor sit amet, consectetaur adipisicing elit, sed doeiusmod
Subheadline Lorem ipsum dolor sit amet, consectetaur adipisicing elit, sed doeiusmod tempor incididunt

The title for the abstract will be rendered in the soon to be released alpha.14. (See #582).

The first way you tried to write it seems reasonable to me, so I'll see about implementing that in core (and then in Asciidoctor PDF).

@mojavelinux mojavelinux added this to the support milestone Dec 13, 2016
@mojavelinux mojavelinux self-assigned this Dec 13, 2016
@mdreier
Copy link
Author

mdreier commented Dec 14, 2016

I created my example from info given in the asciidoctor user manual, so it may be a limitation only of the PDF part. In any case, you could add the information what is supported to the styling guide.

The first way you described does not work, is that also in the upcoming alpha.14?

@mojavelinux
Copy link
Member

The first way you described does not work, is that also in the upcoming alpha.14?

Yes.

I created my example from info given in the asciidoctor user manual

Uh oh, it looks like that example is incorrect or the manual found a bug in the implementation. Which it is I'm not even sure yet. I'll file an issue in core to deal with it.

@mojavelinux
Copy link
Member

Yes, that does appear to be a limitation in core after all. The AsciiDoc Python manual talks about abstract being a valid special section, so we should support it.

@mojavelinux
Copy link
Member

Filed as #703.

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

No branches or pull requests

2 participants