asciidoctor / asciidoctorj-pdf

AsciidoctorJ PDF bundles the Asciidoctor PDF RubyGem (asciidoctor-pdf) so it can be loaded into the JVM using JRuby.
Apache License 2.0
35 stars 17 forks source link

Text disappears from title page after upgrade to 2.x #74

Closed timtebeek closed 2 years ago

timtebeek commented 2 years ago

When I switch from 1.6.2 to 2.0.6 my PDF title page no longer shows the document title.

Not really sure how much detail to include, but we are creating PDFs with a custom theme; here's the start of the asciidoc:

:doctype: book
:pdf-theme: acme-book
:source-highlighter: coderay
:listing-caption: Listing
ifndef::imagesdir[:imagesdir: images]
:back-cover-image: image:../themes/acme-cover-achterkant.svg[]

:author: Wile E. Coyote et al.
:lang: en
:orgname: acme
:keywords: keyword1, keyword2

= ACME Something something: With more details on the next line

That last line does show up when using 1.6.2, but disappears when we use 2.0.6.

Specifically in our theme we're using:

title-page:
  align: right
  background-image: acme-cover-voorkant.svg
  title:
    margin-top: -316
    margin-left: 70
    margin-right: -5
    font:
      family: GT-Walsheim
      color: #02B4E0
      size: 40
      style: bold
  subtitle:
    font:
      family: GT-Walsheim
      color: #000000
      size: 14
      style: bold_italic
    margin-top: 15
    margin-left: 100
    margin-right: -5
  revision:
    display: none
  authors:
    display: none

Any help or pointers appreciated, as I'm not seeing anything relevant in the logs either.

abelsromero commented 2 years ago

I am no expert in theming but I did some testing and the margin-top: -316 seem to be "working now" and it puts the title outside of the page, while in v1.6.2 it's ignored.

Based on the docs, it should be positive https://docs.asciidoctor.org/pdf-converter/latest/theme/measurement-units/.

abelsromero commented 2 years ago

Btw, attributes should go below the title or be passed as part of an attributes intances to the API.

And in case of doubts, I'd suggest to address them in https://asciidoctor.zulipchat.com/, it will get much more visibility and help from ppl.

TH-RBK commented 2 years ago

Hi, we haven even more problems with 2.0.6 and a theme. It seems, that

I think the whole theme.yml is not used anymore.

With 1.6.2 everything worked fine.

Any ideas?

abelsromero commented 2 years ago

V2.x no longer supports deprecated attributes pdf-style and pdf-stylesdir, only pdf-them and pdf-themesdir.

If you can provide a full reproducer we can dig further. For instance, is this is maven plugin? In that case, this PR may provide hints https://github.com/asciidoctor/asciidoctor-maven-examples/pull/135/files.

timtebeek commented 2 years ago

I am no expert in theming but I did some testing and the margin-top: -316 seem to be "working now" and it puts the title outside of the page, while in v1.6.2 it's ignored.

Based on the docs, it should be positive https://docs.asciidoctor.org/pdf-converter/latest/theme/measurement-units/.

Oh wow; that was indeed the issue! Weird how that ever got into the theme in the first place; I'm only maintaining what a colleague did previously. Thanks for helping solve this one!

Btw, attributes should go below the title or be passed as part of an attributes intances to the API.

Not sure I quite understand what you're saying, even after reading up on attributes. Perhaps it helps to note both my snippets above come from separate files?

And in case of doubts, I'd suggest to address them in https://asciidoctor.zulipchat.com/, it will get much more visibility and help from ppl.

Thanks, will do! Here's a first follow up question.

I'd consider this issue closed on my behalf; not sure about what @TH-RBK tagged onto this one. I guess it'd be OK to close this one and if needed open another.

abelsromero commented 2 years ago

Perhaps it helps to note both my snippets above come from separate files?

That makes sense, if it was a single file. Keep in mind Asciidoctor is not 100% strict and supports some inconsistencies, but this may change at some point. For a formal view about the structure of a doc header, you can check https://docs.asciidoctor.org/asciidoc/latest/document/header/.

Thanks, will do! Here's a first follow up question.

Welcome!

TH-RBK commented 2 years ago

V2.x no longer supports deprecated attributes pdf-style and pdf-stylesdir, only pdf-them and pdf-themesdir.

If you can provide a full reproducer we can dig further. For instance, is this is maven plugin? In that case, this PR may provide hints https://github.com/asciidoctor/asciidoctor-maven-examples/pull/135/files.

That was the reason. Now it works thanks a lot!!!