Andrej90
Andrej90

Reputation: 9

Problem with PDF Output (creating bible with xsl-fo and xml)

Good day, first: I am a beginner about what I want to ask:

I've been trying XSL-FO for some time, but I usually reach my limits. I am working on a bible and also using XML. But now there are design problems, so from the PDF.

I would like the PDF to have the following output: http://www.freie-bibel.de/official/projekt/hag2latex8.png It latex of course, but output should be similar. Especially the verses should be on the outside. The footnotes fall out.

However, I am not quite succeeding. For editing the files you can look here: https://xsltfiddle.liberty-development.net/nb9PtDi/95

Does anyone have any ideas and can help me? Thank you very much!

Upvotes: 0

Views: 210

Answers (2)

Toshihiko Makita
Toshihiko Makita

Reputation: 1304

Here is example that uses AH Formatter fo:float extension. The prefix axf: means AH Formatter extension. ( xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" )

  <xsl:template match="VERSE">
    <xsl:apply-templates/>
    <xsl:text> </xsl:text>
  </xsl:template>

  <xsl:template match="VERSE/text()">
    <xsl:if test="not(preceding-sibling::node()) and not(parent::*/@vnumber = 1)">
      <fo:float axf:float-x="column-outside" axf:float-offset-x="-2em">
        <fo:block-container width="2em" top="-1lh">
          <fo:block line-height.conditionality="discard" text-align="center" text-align-last="center" padding-top="-1lh">
            <fo:inline font-weight="bold" font-size="0.9em">
              <xsl:value-of select="parent::*/@vnumber"/>
            </fo:inline>
          </fo:block>
        </fo:block-container>
      </fo:float>
    </xsl:if>
    <fo:inline font-style="{$Schriftschnitt}">
      <xsl:value-of select="."/>
    </fo:inline>
  </xsl:template>

The screen shot:

AH Formatter GUI

Upvotes: 1

Tony Graham
Tony Graham

Reputation: 8068

If you are using AH Formatter, you could put the verse number in an fo:change-bar-begin (see https://www.antenna.co.jp/AHF/help/en/ahf-ext.html#fo.change-bar-begin) and specify change-bar-placement="alternate" to get the correct positions (see https://www.w3.org/TR/xsl11/#change-bar-placement).

I don't know if John 11:35 (https://en.wikipedia.org/wiki/Jesus_wept) is as short in German, but this technique would have trouble with two verse numbers on one line. How does the LaTeX version handle that?

(With AH Formatter, you could also do that dropped chapter number (see https://www.antenna.co.jp/AHF/help/en/ahf-ext.html#DropCapitals), though if it is just a number and not the initial letter of a word, you could also do it with an fo:float.)

Upvotes: 0

Related Questions