Thanks for the patch Don, I've committed it to the trunk:

https://code.google.com/p/asciidoc/source/detail?r=1f9094f7d4c6bcc64c9d371b5ead56215fe15c6b


Cheers, Stuart


On 30/07/12 10:29, DonM wrote:
On Sunday, July 29, 2012 10:52:10 AM UTC-4, DonM wrote:

    I am making indented paragraphs using the role attribute as described in the
    FAQ. This works for single file HTML using asciidoc and htmlhelp using a2x.
    For PDF, the FAQ says:

        This applies to HTML outputs not PDF. To achieve the same results with
        PDF outputs you will need to customize the DocBook XSL Stylesheets to
        render indented paragraphs from DocBook |simpara| elements containing
        the the |role="indented"| attribute.


    I don't know how to do that. Can anyone point me to an example? Or more 
info?

    I am using fop though that is not cast in concrete (it seemed to be the
    easiest to get up and running).


After some experimenting (and moderate gnashing of teeth), I created this
solution, based on the example in faq 62, "Using roles to select fonts for PDF".

Create a custom xsl wrapper called for example customfop.xsl, like this:

<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
                xmlns:fo="http://www.w3.org/1999/XSL/Format";>
  <xsl:import href="C:/Asciidoc/asciidoc-8.6.7/docbook-xsl/fo.xsl"/>
  <xsl:template match="simpara[@role='indented']">
   <fo:block start-indent="3em">
     <xsl:apply-templates/>
   </fo:block>
  </xsl:template>
</xsl:stylesheet>

You will need to modify the path of the xsl:import to match your environment.
Then run a2x like this (windows example):

|python a2x.py -f pdf --fop --xsl-file=customfop.xsl input.txt

|

This gives you a solution that works with the same markup in asciidoc html,
docbook html (& htmlhelp & chunked), and fop pdf.

Perhaps this or something like this could be included in faq 33 on indented
paragraphs. Or why not include this in the distributed dokbook-xsl/fo.xsl. If
all the role based solutions in faq 33 were included in the standard
distribution, the faq could be one line, explaining to use [role="indented"].

--
You received this message because you are subscribed to the Google Groups
"asciidoc" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/asciidoc/-/eMgB4tvRb_oJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/asciidoc?hl=en.

--
You received this message because you are subscribed to the Google Groups 
"asciidoc" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/asciidoc?hl=en.

Reply via email to