This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
Re: [docbook-apps] Non-breaking space in <menuchoice>
- From: "Bob Stayton" <bobs at sagehill dot net>
- To: "Zbyszek Cybulski" <z dot cybulski at gmail dot com>, "docbook" <docbook-apps at lists dot oasis-open dot org>
- Date: Sat, 16 Apr 2005 09:21:02 -0700
- Subject: Re: [docbook-apps] Non-breaking space in <menuchoice>
- References: <425E7E3C.8060605@gmail.com>
I think the first order of business is to replace the "->" string used to
separate menu items. The hyphen is an invitation to the XSL-FO formatter to
break at that point, which is obviously not desirable. I have been using
→ (right arrow, or → in the DocBook entities) in my
customization, and decided after further testing to check it into CVS. This
is a single character and so it won't break, and it looks far better. It
works in all the XSL-FO processors I tested, and in HTML browsers. The
stylesheets use a parameter named $menuchoice.menu.separator, so you could
customize it yourself.
If you are using FOP, however, just entering the character won't work.
That's because FOP will not find a character from the Symbol font
automatically. You have to put it inside an fo:inline to set the
font-family="Symbol". In the current stylesheet release, this won't work by
just doing it in the parameteter because the stylesheets uses xsl:value-of
to get the parameter value, which loses the fo:inline. In CVS I changed it
to xsl:copy-of, so it will work. In other words, if you are using FOP, you
should download the snapshot release.
http://docbook.sourceforge.net/snapshots/
In the parameter I added normal spaces around the arrow character, because I
think it looks better, and because I wanted to allow line breaks in long
menuchoices. You could change the spaces to   (nonbreaking spaces) in
your customization of the parameter if you want. You could also customize
the template with match="menuchoice" to put the whole thing inside an
<fo:inline keep-together.within-line="always"> if you want to always keep
the set of menuitems together. But again this won't work in FOP because it
doesn't support it.
Bob Stayton
Sagehill Enterprises
DocBook Consulting
bobs@sagehill.net
----- Original Message -----
From: "Zbyszek Cybulski" <z.cybulski@gmail.com>
To: "docbook" <docbook-apps@lists.oasis-open.org>
Sent: Thursday, April 14, 2005 7:29 AM
Subject: [docbook-apps] Non-breaking space in <menuchoice>
> Hi,
>
> Is that possible to force inserting non-breaking spaces when using
> <menuchoice>?
> Or maybe to force an FO-PDF converter not to break lines when rendering
> "->" between <guimenu> and <guimenuitem>?
> In my PDF files, I very often get a sequence of menu options at the end
> of the line, and usually they are broken between '-' and '>'. I'd prefer
> moving the whole menu sequence to a new line instead of breaking the
> sequence.
>
> Thanks for your help,
>
> Zbyszek
>
>