DSSSL to PDF and Postscript

1. Is passivetex is offered as RPM
2. Where do I find the user customizable variables?
3. How do I set the paper type?
4. How do I get justified output?
5. How do I generate entries in the PDF Document Info?
6. How do I generate bookmarks?
7. How do I show the bookmark entries expanded?
8. How do I control the level of expanded bookmark subtrees?
9. How do I change the link appearance from boxed to coloured?
10. How do I change the link colour?
11. How do I influence hyphenation?
12. How do I generate PDF thumbnails?
13. How do generate two sided output?
14. How do I get two-side mode to work properly?
15. How do I get the title page recto and verso pages to work correctly in two-side mode?
16. How do I get a separate header page for each chapter?
17. Hyphenation in German
18. Footnotes at bottom of page
19. Breaking long url's in pdf
20. Links for paper based output in DSSSL
21. Modify the first page of a chapter in DSSSL
1.

Is passivetex is offered as RPM

Peter Eisentraut


> Does anyone know if passivetex is offered as RPM, either an official one or
> something people have put together.

Try the rpmfind utility

2.

Where do I find the user customizable variables?

The default styleheet files contain two files (for HTML and print output) named dbparam.dsl. Locate these files and look carefully over them. A few of the user customizable variables are mentioned below.

3.

How do I set the paper type?

Set the following in your customization stylesheet:

(define %paper-type% "A4")

The default stylesheet sets this to "USletter".

4.

How do I get justified output?

Set the following in your customization stylesheet:

(define %default-quadding% 'justify)

(the default stylesheet sets this to 'start, which means left-justified).

5.

How do I generate entries in the PDF Document Info?

Create a file jadetex.cfg in your working directory which looks like:

\hypersetup{pdftitle={Some Title},
            pdfsubject={Some Subject},
            pdfauthor={Some Author}
           }

You should consult the documentation of hyperref.sty for a complete and more detailled description of the possible configuration options.

6.

How do I generate bookmarks?

Perform the following steps (works with at least V1.69 of the DSSSL stylesheets):

  • Use openjade to process your SGML file

  • Use a line like pdfpagemode=UseOutlines in your jadetex.cfg file (See

    How do I generate entries in the PDF Document Info?

    for the general layout of the file jadetex.cfg)

  • If you are writing a <book> include the following lines in your customization layer:

    (declare-characteristic heading-level
      "UNREGISTERED::James Clark//Characteristic::heading-level" 2)
    

    If you are writing an <article> don't use these lines.

7.

How do I show the bookmark entries expanded?

Use the following line in your jadetex.cfg file:

bookmarksopen=true

(See

How do I generate entries in the PDF Document Info?

for the general layout of the file jadetex.cfg)

8.

How do I control the level of expanded bookmark subtrees?

Use the following line in your jadetex.cfg file:

bookmarksopenlevel=level

and choose an appropriate value for level (See

How do I generate entries in the PDF Document Info?

for the general layout of the file jadetex.cfg).

9.

How do I change the link appearance from boxed to coloured?

Use the following line in your jadetex.cfg file:

colorlinks=true

(See

How do I generate entries in the PDF Document Info?

for the general layout of the file jadetex.cfg)

10.

How do I change the link colour?

Use the following line in your jadetex.cfg file:

linkcolor=blue

and choose an appropriate value for linkcolor. For this to work you have to set colorlinks=true too (and remember that entries in jadetex.cfg have to be comma separated - not white space separated! See

How do I generate entries in the PDF Document Info?

for the general layout of the file jadetex.cfg).

11.

How do I influence hyphenation?

The file jadetex.cfg can contain TeX code, so one possible solution is to specify the words you wish to hyphenate in jadetex.cfg in a special way like:

\hyphenation{hyph-enate-me}

(See

How do I generate entries in the PDF Document Info?

for the general layout of the file jadetex.cfg).

12.

How do I generate PDF thumbnails?

tbd.

13.

How do generate two sided output?

Set the following in your customization stylesheet:

(define %two-side% #t)

(this is set already in the default stylesheet files).

14.

How do I get two-side mode to work properly?

tbd.

15.

How do I get the title page recto and verso pages to work correctly in two-side mode?

tbd.

16.

How do I get a separate header page for each chapter?

tbd.

17.

Hyphenation in German

Jirka Kosek


> simple Problem: I have a German written document. I uses <book
> lang="de"> for declaring it (is that the mistake?). How can I create a PDF
> with a correct hyphenation? Evertime I create PDFs it has no
> hyphentation at all.

You must turn on hyphenation in stylesheet. There is parameter for doing it in both XSL and DSSSL stylesheets, look for it in documentation.

Isn't that easy to find. At http://jadetex.sourceforge.net/ you can read:

Why doesn't hyphenation work?

Remember that your text must be fully justified (quadding: #t), hyphenation must be on, hyphenation?: #t, and a current language must be selected (e.g., language: 'EN) for JadeTeX to perform hyphenation.

"quadding" is required. Please, in suse-both.dsl use:

    (define %hyphenation% #t)
(define %default-quadding% 'justify)
    

You can copy suse-both.dsl in you working directory change it and say: db2pdf --style suse-both.dsl document.sgml

> Second issue is support for hyphenation in formating tools. If you are > using JadeTeX or PassiveTeX you shouldn't have problems as your TeX > setup probably comes with German hyphenation patterns.

Yes, pattern are dumped in (AFAIK). Otherwise use `texconfig' or adjust /etc/texmf/language.dat and call fmtutil manually:

    fmtutil --byfmt jadetex

You can find some info in my slides

It is primary focused for Central and Eastern European languages, but many informations are usable for other languages as well.

18.

Footnotes at bottom of page

Holger Rauch



> What I'm wondering, is if there is markup, along the lines of 
> <footnote>, that will put notes at bottom of pages, instead of in 
> a seperate "Notes" section at the end of a rendered document?

What you are mentioned has nothing to do with the <footnote> element. It has something to do with the style sheets. In case you are using DSSSL style sheets, add the following parameter to your customization layer:

(define bop-footnotes #t)

This only works with the TeX backend, however.

19.

Breaking long url's in pdf

???

Enough talking, here's the hack for XSL 1.48 (it inserts hairline-spaces between every character in an URL): add it in your XSL driver file.

The first part is a (slightly) modified version of a part of fo/xref.xsl; the second is almost exactly like the hack created by Nikolai Grigoriev found on Yahoo! group XSL-FO.

    <!-- colored / hyphenated links -->
    <xsl:template match="ulink">
        <fo:basic-link external-destination="{@url}"
                xsl:use-attribute-sets="xref.properties"
                color="#0000AA">
            <xsl:choose>
                <xsl:when test="count(child::node())=0">
                    <xsl:value-of select="@url" />
                </xsl:when>
                <xsl:otherwise>
                    <xsl:apply-templates />
                </xsl:otherwise>
            </xsl:choose>
        </fo:basic-link>
        <xsl:if test="count(child::node()) != 0">
            <fo:inline hyphenate="true">
                <xsl:text> (</xsl:text>
                <!--<xsl:value-of select="@url"/>-->
                <xsl:call-template 
	           name="intersperse-with-zero-spaces">
                    <xsl:with-param name="str" select="@url"/>
                </xsl:call-template>
                <xsl:text>)</xsl:text>
            </fo:inline>
        </xsl:if>
    </xsl:template>

    <!-- Actual space intercalation: recursive -->
    <xsl:template name="intersperse-with-zero-spaces">
        <xsl:param name="str"/>
        <xsl:variable name="spacechars">
 &#x9;&#xA;&#x2000;&#x2001;&#x2002;
 &#x2003;&#x2004;&#x2005;
 &#x2006;&#x2007;&#x2008;&#x2009;
&#x200A;&#x200B;
        </xsl:variable>

        <xsl:if test="string-length($str) &gt; 0">
            <xsl:variable name="c1"
                    select="substring($str, 1, 1)"/>
            <xsl:variable name="c2"
                    select="substring($str, 2, 1)"/>

            <xsl:value-of select="$c1"/>
            <xsl:if test="$c2 != '' and
                    not(contains($spacechars, $c1) or
                    contains($spacechars, $c2))">
                <xsl:text>&#x200A;</xsl:text>
            </xsl:if>

            <xsl:call-template name="intersperse-with-zero-spaces">
                <xsl:with-param name="str" 
	  select="substring($str, 2)"/>
            </xsl:call-template>
        </xsl:if>
    </xsl:template>
20.

Links for paper based output in DSSSL

Norm Walsh



| I'm currently using the docbook DSSSL stylesheets 1.72
| with openjade and tex to produce pdf and postscript documents.
|
| Any suggestions on rendering links on paper would be welcome,
| Thanks in advance,

It can be done, but you'll probably have to do a little customization. Basically, you need to change the xref generating text to output

(element-page-number-sosofo target)

where target is the element pointed to by the linkend.

21.

Modify the first page of a chapter in DSSSL

Juan R. Migoya



>   How can I modify the first page of each chapter to be more
> beautiful. The default one is just like:
>
>                         Chapter 1. Introduction
>
>         I'd like a big chapter number (1) inside a light gray square and
> the title of chapter (Introduction) in italic below chapter's number.

This is what I have for render the Chapter title (I hope there isn't nothing more you need in other customization file)

;; Títtle for Chapter
;; It's changed only for chapter title.
(define ($component-title$)
  (let* ((info (cond
  ((equal? (gi) (normalize "appendix"))
   (select-elements (children (current-node)) (normalize "docinfo")))
  ((equal? (gi) (normalize "article"))
   (node-list-filter-by-gi (children (current-node))
      (list (normalize "artheader")
            (normalize "articleinfo"))))
  ((equal? (gi) (normalize "bibliography"))
   (select-elements (children (current-node)) (normalize "docinfo")))
  ((equal? (gi) (normalize "chapter"))
   (select-elements (children (current-node)) (normalize "docinfo")))
  ((equal? (gi) (normalize "dedication"))
   (empty-node-list))
  ((equal? (gi) (normalize "glossary"))
   (select-elements (children (current-node)) (normalize "docinfo")))
  ((equal? (gi) (normalize "index"))
   (select-elements (children (current-node)) (normalize "docinfo")))
  ((equal? (gi) (normalize "preface"))
   (select-elements (children (current-node)) (normalize "docinfo")))
  ((equal? (gi) (normalize "reference"))
   (select-elements (children (current-node)) (normalize "docinfo")))
  ((equal? (gi) (normalize "setindex"))
   (select-elements (children (current-node)) (normalize "docinfo")))
  (else
   (empty-node-list))))
  (exp-children (if (node-list-empty? info)
      (empty-node-list)
      (expand-children (children info)
         (list (normalize "bookbiblio")
        (normalize "bibliomisc")
        (normalize "biblioset")))))
  (parent-titles (select-elements (children (current-node)) 
	  (normalize "title")))

  (info-titles   (select-elements exp-children (normalize "title")))
  (titles        (if (node-list-empty? parent-titles)
       info-titles
       parent-titles))
  (subtitles     (select-elements exp-children (normalize "subtitle"))))

    ;; ==================== Changed for Chapter ======================
    (if (equal? (gi) (normalize "chapter"))
 (make sequence
   ;; Parrafo con "Capitulo n"
   (make paragraph
     font-family-name: %title-font-family%
     ;; font-weight: 'bold
     font-weight: 'semi-light
     font-size: (HSIZE 6)
     space-before: 0pt
     ;; space-after: (* (HSIZE 6) %head-before-factor% )
     space-after: 1cm
     quadding: 'end
     heading-level: (if %generate-heading-level% 1 0)
     keep-with-next?: #t
     (if (string=? (element-label) "")
  (empty-sosofo)
  (make sequence
    line-spacing: (* (HSIZE 1) %line-spacing-factor%)
    (literal (gentext-element-name-space (current-node)))
      (make sequence
         font-size: (* (HSIZE 6) 2.5)
         font-weight: 'bold
         color: light-blue
   (literal (element-label))))))
        ;; Quito el punto (gentext-label-title-sep (gi))

   ;; Para with chapter title
  (make paragraph
     font-family-name: %title-font-family%
     font-weight: 'bold
     font-size: (HSIZE 6)
     line-spacing: (* (HSIZE 1) %line-spacing-factor%)
     ;; space-before: (* (HSIZE 10) %head-before-factor%)
     space-before: 0.5cm
     ;; space-after:  (* (HSIZE 14) %head-before-factor%)
     ;; se suma al 1cm anterior
     space-after: 1.5cm
     start-indent: 0pt
     first-line-start-indent: 0pt
     quadding: 'end
     heading-level: (if %generate-heading-level% 1 0)
     keep-with-next?: #t
     (if (node-list-empty? titles)
     (element-title-sosofo) ;; get a default!
     (with-mode chapter-title-mode
   (make sequence
   (process-node-list titles))))))

  ;; If not chapter:
  (make sequence
   (make paragraph
     font-family-name: %title-font-family%
     font-weight: 'bold
     font-size: (HSIZE 4)
     line-spacing: (* (HSIZE 4) %line-spacing-factor%)
     space-before: (* (HSIZE 4) %head-before-factor%)
     start-indent: 0pt
     first-line-start-indent: 0pt
     quadding: %component-title-quadding%
     heading-level: (if %generate-heading-level% 1 0)
     keep-with-next?: #t

     (if (string=? (element-label) "")
  (empty-sosofo)
  (literal (gentext-element-name-space (current-node))
      (element-label)
      (gentext-label-title-sep (gi))))

     (if (node-list-empty? titles)
  (element-title-sosofo) ;; get a default!
  (with-mode component-title-mode
    (make sequence
      (process-node-list titles)))))

   (make paragraph
     font-family-name: %title-font-family%
     font-weight: 'bold
     font-posture: 'italic
     font-size: (HSIZE 3)
     line-spacing: (* (HSIZE 3) %line-spacing-factor%)
     space-before: (* 0.5 (* (HSIZE 3) %head-before-factor%))
     space-after: (* (HSIZE 4) %head-after-factor%)
     start-indent: 0pt
     first-line-start-indent: 0pt
     quadding: %component-subtitle-quadding%
     keep-with-next?: #t

     (with-mode component-title-mode
       (make sequence
  (process-node-list subtitles))))))))

;; Chapter-Title Mode
(mode chapter-title-mode
  (element title
    (make sequence
      (process-children))))

It may be just your starting point :-)