-----Original Message----- From: Boost [mailto:boost-bounces@lists.boost.org] On Behalf Of Paul A. Bristow Sent: Friday, August 09, 2013 10:14 AM To: boost@lists.boost.org Subject: Re: [boost] How to center an element in Boost QuickBook?
-----Original Message----- From: Boost [mailto:boost-bounces@lists.boost.org] On Behalf Of Rene Rivera Sent: Friday, August 09, 2013 4:33 AM To: boost@lists.boost.org Subject: Re: [boost] How to center an element in Boost QuickBook?
On Thu, Aug 8, 2013 at 8:43 PM, Joel de Guzman
wrote: On 8/8/13 10:55 PM, Niall Douglas wrote:
[def __tick__ [role aligncenter [role green \u2714]]] [def __cross__ [role aligncenter [role red \u2718]]]
The requisite CSS can be found appended to the bottom of this boostbook.css
I've finally got round to trying this with Quickbook 1.7 and I find it very neat to be able to control the alignment, both in text, and most usefully, in tables, so that the heading and/or body text can be centered or even right aligned. (justify seems less useful). /* alignment and coloring use role feature, available from Quickbook 1.7 up. */ /* Add text alignment (see http://www.w3schools.com/cssref/pr_text_text-align.asp) */ span.aligncenter { display: inline-block; width: 100%; text-align: center; } span.alignright { display: inline-block; width: 100%; text-align: right; } span.alignjustify { display: inline-block; width: 15%; text-align: justify; } /* align justify stretches the lines so that each line has equal width within a chosen fraction of page width (here 15%). *Not* useful inside table items as the column width is the full string width. Nor very useful, except to restrict the width. */ Colors are nice too - [role red Some red text] [role blue Some blue text] ... I'd like to add a few to the boostbook.css /* Text colors (names at http://www.w3schools.com/cssref/css_colornames.asp) */ span.red { color: red; } span.green { color: green; } span.lime { color: #00FF00; } span.blue { color: blue; } span.navy { color: navy; } span.yellow { color: yellow; } span.magenta { color: magenta; } span.indigo { color: #4B0082; } span.cyan { color: cyan; } span.purple { color: purple; } span.gold { color: gold; } span.silver { color: silver; } span.grey { color: grey; } It will also be useful to have a few defs in your Quickbook file. [/ ticks and crosses from dingbats http://www.unicodemap.org/range/56/Dingbats/ eg http://www.unicodemap.org/details/0x2714/] [def __tick [role aligncenter [role green \u2714]]] [/ u2714 is a HEAVY CHECK MARK tick (2713 check mark)] [def __cross [role aligncenter [role red \u2718]]] [/ u2718 is a heavy cross] [def __star [role aligncenter [role red \u2736]]] [/ 6-point star]
Will this also produce a pdf version as with other Quickbook docs?
So far, the answer to my other question is not yet. My jamfile contains this pointer to my special css with the above added items (and works for html) xsl:paramhtml.stylesheet=myboostbook.css and I presume this applies to for both html and pdf ? Sadly neither color nor alignment seem to work with generating pdf :-( Is there something that I need to add to <format>pdf:xsl:param specifically for the pdf version? Thanks for any suggestions. Paul --- Paul A. Bristow, Prizet Farmhouse, Kendal LA8 8AB UK +44 1539 561830 07714330204 pbristow@hetp.u-net.com