Using fopub to output conditional xref format

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Using fopub to output conditional xref format

otavio
Hello,

I am using fopub to generate PDF output for the document we are working on, most of it is working fine but I'd like to have xref output using different formats for:

* figures
* tables

where I want just the label (e.g: Figure 1.1, Table 2.3) and

* chapter
* sections

to keep using label and title, as currently done.

I am totally dumb regarding DocBook stylesheet so I am asking here if someone can guide me on how to do it?
Reply | Threaded
Open this post in threaded view
|

Re: Using fopub to output conditional xref format

mojavelinux
Administrator

If I'm not mistaken, this can be controlled by passing additional xsl parameters to the xslt processor. You can look in the fopub script for where those get passed.

If you are going to do any hacking on the DocBook fo pipeline (i.e. fopub) I highly recommend reading up the docs from SageHill about how it's done. It's always an expedition trying to figure how to do it.

http://www.sagehill.net/docbookxsl/index.html

fopub gives you the tools all setup, so all you need to do is customize.

-Dan

Reply | Threaded
Open this post in threaded view
|

Re: Using fopub to output conditional xref format

otavio
mojavelinux wrote
If I'm not mistaken, this can be controlled by passing additional xsl
parameters to the xslt processor. You can look in the fopub script for
where those get passed.
Yes; I succeed to pass some options to the script and I found how to globally change the style of xref.

mojavelinux wrote
If you are going to do any hacking on the DocBook fo pipeline (i.e. fopub)
I highly recommend reading up the docs from SageHill about how it's done.
It's always an expedition trying to figure how to do it.

http://www.sagehill.net/docbookxsl/index.html

fopub gives you the tools all setup, so all you need to do is customize.
Yes, this is where I am now. I am trying to understand how I can conditionally do it.

I am a complete newcomer as DocBook user. I am more used to LaTeX than DocBook so it has been difficult to get it customized as I am still learning it.

I've been pondering if fopub is the best longterm solution for my use case or if asciidoctor-pdf will eventually be the definitive answer for it. Can you let me know your thoughts on this?
Reply | Threaded
Open this post in threaded view
|

Re: Using fopub to output conditional xref format

mojavelinux
Administrator

On Fri, Jan 2, 2015 at 4:45 AM, otavio [via Asciidoctor :: Discussion] <[hidden email]> wrote:
I am a complete newcomer as DocBook user. I am more used to LaTeX than DocBook so it has been difficult to get it customized as I am still learning it.

Join the club. I always feel like a newbie using DocBook. That said, in my experience, once you customize it a few times, you at least gain the faith that with enough perseverance, you'll locate the template to hack and be able to come out with something that works.

 I've been pondering if fopub is the best longterm solution for my use case or if asciidoctor-pdf will eventually be the definitive answer for it. Can you let me know your thoughts on this?

I have a very strong opinion on the topic. I do not believe the DocBook toolchain is a sound economic investment. (We support it in Asciidoctor to the extent of leveraging existing investments in publishing pipelines*).

With DocBook, you end up investing way more than you get out of it...and you never quite get what you want in the end. It's frustrating. There are just too many layers of abstraction and limited to no access to a *real* programming language. Using a programming language may seem more complex at first, but at least it makes things possible (hence Asciidoctor PDF).

The way forward is either Asciidoctor PDF or Asciidoctor LaTeX. Keep in mind that Asciidoctor PDF is still a very green pasture. Prawn is a relatively young PDF generation library and thus Asciidoctor PDF has to weather bumps in that road. Asciidoctor LaTeX is very interesting because once you get the LaTeX generated, you can leverage your existing knowledge and the mature technology of the LaTeX toolchain. The converter is still evolving, but that's a much more straightforward problem to solve than replacing the whole toolchain as Asciidoctor PDF aims to do.

I hope that helps!

Cheers,

-Dan

* I also think DocBook is a decent transfer format, in the way that we use XML for web services
Reply | Threaded
Open this post in threaded view
|

Re: Using fopub to output conditional xref format

otavio
mojavelinux wrote
On Fri, Jan 2, 2015 at 4:45 AM, otavio [via Asciidoctor :: Discussion] <
[hidden email]> wrote:
> I am a complete newcomer as DocBook user. I am more used to LaTeX than
> DocBook so it has been difficult to get it customized as I am still
> learning it.


Join the club. I always feel like a newbie using DocBook. That said, in my
experience, once you customize it a few times, you at least gain the faith
that with enough perseverance, you'll locate the template to hack and be
able to come out with something that works.

 I've been pondering if fopub is the best longterm solution for my use case
> or if asciidoctor-pdf will eventually be the definitive answer for it. Can
> you let me know your thoughts on this?

I have a very strong opinion on the topic. I do not believe the DocBook
toolchain is a sound economic investment. (We support it in Asciidoctor to
the extent of leveraging existing investments in publishing pipelines*).

With DocBook, you end up investing way more than you get out of it...and
you never quite get what you want in the end. It's frustrating. There are
just too many layers of abstraction and limited to no access to a *real*
programming language. Using a programming language may seem more complex at
first, but at least it makes things possible (hence Asciidoctor PDF).
I see; and I tend to agree :-)

It seems very complex and hard to get something really good from it.

The way forward is either Asciidoctor PDF or Asciidoctor LaTeX. Keep in
mind that Asciidoctor PDF is still a very green pasture. Prawn is a
relatively young PDF generation library and thus Asciidoctor PDF has to
weather bumps in that road. Asciidoctor LaTeX is very interesting because
once you get the LaTeX generated, you can leverage your existing knowledge
and the mature technology of the LaTeX toolchain. The converter is still
evolving, but that's a much more straightforward problem to solve than
replacing the whole toolchain as Asciidoctor PDF aims to do.
Yes, it does.

I've been working on the LaTeX backend and it looks promising. The output is still quite ugly but I do like LaTeX as it gives us a lot of freedom while is more or less fast to hack.

The PDF engine looks very nice but it is still hard for me to understand how we could customize it more.

From what I could grasp from the Atlas rendering system, used by O'Reilly, it seems it relies on HTML as intermediate format for all outputs and it seems very interesting as we could rely on the existing and mature HTML output we already have.

Did you ever consider it?
Reply | Threaded
Open this post in threaded view
|

Re: Using fopub to output conditional xref format

mojavelinux
Administrator

> From what I could grasp from the Atlas rendering system, used by O'Reilly, it seems it relies on HTML as intermediate format for all outputs and it seems very interesting as we could rely on the existing and mature HTML output we already have.
>
> Did you ever consider it?

To my knowledge, Atlas' rendering system is proprietary, so it's of little use to this project, though certainly an option for authors.

There are Asciidoctor users that take an HTML-to-PDF approach. For simple documents, the default stylesheet produces nice output when using print to PDF in the browser. You can hack the CSS and HTML to refine it as needed. Many users leverage a custom converter & stylesheet for HTML output already, so certainly a viable option.

The key for us is to continue to make output customization possible in a variety of ways. The more control--and the more examples--the easier publishing will become. There's still much to explore.

Cheers,

-Dan