Login  Register

Re: Flexibility of PDF Output and Hyphenation

Posted by shahryareiv on Feb 28, 2017; 3:53pm
URL: https://discuss.asciidoctor.org/Flexibility-of-PDF-Output-and-Hyphenation-tp5303p5315.html

If I may put my two cents in, I think that asciidoctor-latex is still not mature enough to support more than simple publishing needs. Actually, I think it does not even claim more. I tried it with academic documents and things are usually more complicated than its features. There are many content types and many options in rendering those types. At the same time asciidoctor-latex introduces " extended syntax " that I am not sure if I want to break compatibility of my asciidoc documents with that (except they get (? got) included in the asciidoc format).

I also consider asciidoctor-pdf rendering and its associated styling mechanism something as "good-enough" for simple publishing, but the level of customization is not what you want to publish, let's say a book, with. So, the other  viable choice is Asciidoc >>(asciidoctor)>> DocBook >>(dblatex + your customization)>> Latex >>(xe/pdflatex + your latex library )>> PDF .

IMHO, the important thing in this chain or any other chain is that the fundamental strength of asciidoc, that is user defined roles (and/or costume styles + modules) should be transferred downstream and the above chain could do most of this, although no so neat and easy. Why we need that? because of the very specific publishing needs you may need. For example, I need to have a very specially styled part for my "summary points" section. How can I define that? there is no internal style in asciidoc for that but I just need to to add ".summary" to the head of a block and I will see in Docbook that "<simpara role="summary"> ..." or in HTML "<p class="summary"> and then I can take care of how to typeset and style that specific content.

In the above mentioned chain, everything is asciidoc (including the roles, ids) is converted to docbook very clean and clearly (that has been the basic purpose of asciidoc, as far as I know). DBlatex is quite a mature convertor from docbook to latex but it is based on xslt and python and its maintenance does not seem to be very active (I have a feeling that the support might end some years ahead). The things in dblatex are somehow complicated and XSL things are not my favorite way of doing things. But anyway if you find that dblatex does not have the specific convertor for your "summary" section then you can add lines of xslt to dblatex to have a special conversion for <simpara> with role="summary" to something that you want in Latex. Then of course you need to write your latex macro, something like : \mySummary{}. Please note that even without your custom code (in xslt and latex), still the chain does a plenty of conversions in a good enough way.

I have used the above chain to typeset something like this (http://bit.ly/1R1uy0r). Almost everything (even the colophon) was originated in Asciidoc. The exceptions was, of course the cover, the figures, and the tables. I was not happy with how the tables are being translated down the stream and I had not time to write my own xslt convertor. So I just used the hack that asciidoctor has to send direct latex code (for PDF route not the HTML one).

The amount of typesetting features developed in Tex family is huge and I think that it takes Asciidoc-pdf a very long way/energy/contribution to reach that maturity in publishing, except that asciidoctor-pdf finds a way to internalize the whole latex chain.

There is also one more chain and that is Asciidoc >>>> HTML >> something >> PDF. There are HTML to PDF convertors such as Prince ( I noticed it being common with some academic publishers but not sure how fine it works). I know that W3C CSS Paged specifications are growing (https://www.w3.org/TR/css3-page/) but I guess still we need time for that to catch up with Tex maturity and fineness.

Personally, I think that Asciidoc >>>> HTML >> something >> PDF is the future. Asciidoc to HTML conversion is perfect and includes all the semantics specified in the original document. No need to have two paths (HTML and Docbook). One can convert an asciidoc flavored HTML to PDF (or other formats) any time later.  There are so many tools to work with HTML. HTML to Latex should be easier than Docbook to Latex due to tool options or at least the same. Meanwhile, we can wait for HTML to PDF through CSS Paged to get mature, without missing other things.