asciidoctor / asciidoctor-pdf

:page_with_curl: Asciidoctor PDF: A native PDF converter for AsciiDoc based on Asciidoctor and Prawn, written entirely in Ruby.
https://docs.asciidoctor.org/pdf-converter/latest/
MIT License
1.14k stars 500 forks source link

Subtitle partitioning not working #1328

Closed SandMann1 closed 5 years ago

SandMann1 commented 5 years ago

My existing documents with subtitle partitioning, e.g = Main title:Subtitle now (beta 6) is tranlated to main title "Main title:Subtitle". Should be main title "Main title" and subtitle "Subtitle".

Can't find any other open issues or changelog notes related to this.

mojavelinux commented 5 years ago

You seem to be missing a space after the separator, which is required.

= Main title: Subtitle

That has always been a requirement to my knowledge. It's also something that is handled by core, not by Asciidoctor PDF.

mojavelinux commented 5 years ago

The user manual states:

Note that a space is always appended to the value of the title-separator (making the default value of the title-separator effectively a single colon).

PascalDutch commented 5 years ago

I am also experiencing this issue, using = title: subtitle does not seem to work

SandMann1 commented 5 years ago

Yes, you are correct. The example I gave was incorrect, my documents have this space. Why this was not working for my existing documents I am not sure. I suspect that maybe my build configuration at some point was changed so that :doctype: was article, not book. When :doctype: article the issue is still there, but perhaps more of an intended behavior. I'l close the issue as my problem is resolved.

SandMann1 commented 5 years ago

Reopen as I just saw PascalDutch's comment. @PascalDutch I think the behavior is different related to :doctype: but I can't be sure if subtitle worked before when :doctype: article. Do you?

PascalDutch commented 5 years ago

I use :doctype: book and it is not working. I can't tell if it ever worked with :doctype: article since I have never used that type.

SandMann1 commented 5 years ago

I can't find any documentation specifying the correlation between support for subtitle partitioning and doctype attribute. But as i said, it works for doctype book at my end now. Asciidoctor version 2.0.10 and asciidoctor-pdf 1.5.0 beta 6.

mojavelinux commented 5 years ago

I suspect that maybe my build configuration at some point was changed so that :doctype: was article, not book.

The default doctype in Asciidoctor PDF has always been article (as it is for all converters). The difference is that the article doctype is now fully respected, which means the title joins the first page of the body instead of on a separate page.

I can't find any documentation specifying the correlation between support for subtitle partitioning and doctype attribute.

Subtitle partitioning is only supported in Asciidoctor PDF when the title page is used (either the doctype is book or the title-page attribute is set).

When :doctype: article the issue is still there, but perhaps more of an intended behavior.

As of now, that is by design. If you'd like subtitle partitioning to work for the article doctype, please open a separate issue with that subject.

mojavelinux commented 5 years ago

I use :doctype: book and it is not working.

I don't believe this to be true as we have tests that verify it does work. Please provide a complete example so that we can determine if there's a use case being overlooked by the test suite.

PascalDutch commented 5 years ago

Here is my configuration, the AsciiDoctor root file (there might be some Dutch words in the text):

= SomeTitle: Subtitle 
:title: SomeTitle
:version: 0.1
:update: 16 oktober 2019
:version-label: Versie
:author: Pascal
:mail: mail@mail.com
:last-update-label: Laatst geüpdatet
:bibliography-database: db_citaten_stage.bib
:bibliography-style: apa
:bibtex-style: apa
:bibliography-tex-style: numeric
:bibtex-order: appearance
:title-logo-image: image:img1.png[pdfwidth=4.25in,align=center]
Pascal  <mail@mail.com>
v{version}, {update}
// :organization: someOrganization
:doctype: book
:front-cover-image: image:img2.png[]
// Settings:
:experimental:
:reproducible:
:icons: font
:listing-caption: Listing
:sectnums:
:toc: macro
:toclevels: 3
:toc-title: Inhoudsopgave
:chapter-label:
:stem: latexmath
:align-text: left

//Captures
:appendix-caption: Bijlage
:caution-caption: Waarschuwing
:example-caption: Voorbeeld
:figure-caption: Figuur
:image-caption: Afbeelding
:important-caption: Belangrijk
:last-update-label: Laatst geupdate
:note-caption: Notitie
:table-caption: Tabel
:untitled-label: Ongetiteld
:version-label: Versie
:warning-caption: Waarschuwing
:preface-caption: Samenvatting

ifeval::["{asciidoctor-version}" < "1.5.7"]
:legacy-footnoteref:
endif::[]
ifdef::backend-pdf[]
:pdf-theme: onderzoekSjabloon-theme.yml
:pdf-themesdir: sjablonen
:source-highlighter: coderay
endif::[]

//:rouge-style: github]

// Voorblad
include::voorblad.adoc[]

// Versiebeheer
include::versiebeheer.adoc[]

// Samenvatting
include::samenvatting.adoc[]

toc::[]

// Verklarende woordenlijst
include::woordenlijst.adoc[]

include::inleiding.adoc[]

include::hoofdstuk1.adoc[]

include::hoofdstuk2.adoc[]

== Bronnen
[.text-left]
bibliography::[]

YAML file (I think this theme might be the problem):

extends: default
page:
  layout: portrait
  margin: [0.75in, 1in, 0.75in, 1in]
  size: Book
base:
  font-color: #333333
  font-family: Noto Serif
vertical-spacing: $base-line-height-length
header:
  font_color: 999999
  height: 0.5in
  recto:
    columns: "<40% =20% >40%"
    right:
      content: '_{organization}_'
    center:
      content: image:img.png[pdfwidth=0.50in]
  verso:
    columns: $header_recto_columns
    left:
      content: $header_recto_right_content
    center:
      content: $header_recto_center_content
heading:
  font-color: #262626
  font-size: 17
  font-style: bold
  line-height: 1.2
  margin-bottom: $vertical-spacing
link:
  font-color: #333333
  # font-style: bold
outline-list:
  indent: $base-font-size * 1.5
  text-align: left
footer:
  height: 0.45in
  recto:
    right:
      content: '{section-or-chapter-title} | {page-number}'
  verso:
    left:
      content: '{page-number} | {chapter-title}'

Using with:

Asciidoctor PDF 1.5.0.beta.6 using Asciidoctor 2.0.10 [https://asciidoctor.org]
Runtime Environment (ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux-gnu]) (lc:UTF-8 fs:UTF-8 in:UTF-8 ex:UTF-8)
mojavelinux commented 5 years ago

The subtitle is not working because you are overriding the title using:

:title: SomeTitle

Take that away and it will work.

PascalDutch commented 5 years ago

It works, such a simple fix. Thanks for the support!

mojavelinux commented 5 years ago

Excellent!