diff --git a/src/guide/xml/ch02.xml b/src/guide/xml/ch02.xml index b5a663182..6c228439e 100755 --- a/src/guide/xml/ch02.xml +++ b/src/guide/xml/ch02.xml @@ -896,10 +896,6 @@ purpose: -In addition, the stylesheets support profiling on several common attributes -that are not explicitly for effectivity: xml:lang, revisionflag, -and role. - DocBook places no constraints on the values used for effectivity and the stylesheets don’t either. You’re free to use “cat” and “dog” @@ -949,6 +945,22 @@ some common text. Options are introduced with the That is unlikely to work well. + +
+Other common Attributes +In addition, the stylesheets support profiling on several common attributes +that are not explicitly for effectivity: xml:lang, revisionflag, +and role. + + + The role Attribute is multivalued +Please note that the stylesheets treat the role attribute as +multivalued, similar to the class attribute in HTML. It +may contain a sequence of tokens, seperated by whitespace. This allows you, for example, +to classify a section as informal which should be printed in +landscape orientation with the following value for it's role +attribute: role='informal landscape'. +
@@ -1484,7 +1496,27 @@ presentation, in the printed version. The resulting HTML document can be formatted directly with a CSS paged-media formatter. +
+
+Landscape orientation in print output +The default orientation for pages in print output is portrait. You can switch to +landscape orientation with landscape as a token within the +role attribute + +See the note about the multivalued role Attribute in . +. +This may apply to the whole book or +article, or to individual chapter, section or +appendix elements. You can also print individual tables or figures in landscape, +if they are to wide for portrait pages. For wide tables, you should use the orient attribute with the value land, +because it is provided precisely for this purpose. +However, in the interests of a uniform solution, the role attribute with the value landscape can also be used for tables. + +For legacy reasons, the landscapeFigure processing instruction from the XSLT 1.0 stylesheets is also supported for figure and +informalfigure elements, as described +in Chapter 18 of Bob Staytons Complete Guide. +
@@ -1635,4 +1667,3 @@ has a background color.
- diff --git a/src/guide/xml/ch04.xml b/src/guide/xml/ch04.xml index 3dcb7bc16..8de93a3af 100644 --- a/src/guide/xml/ch04.xml +++ b/src/guide/xml/ch04.xml @@ -610,6 +610,13 @@ attribute to the root element (if it doesn’t already have one).
If it isn’t preserved, relative references to other documents will be resolved against the static base URI of the stylesheet and not the URI of the original document. That’s unlikely to be correct. +You must also take into account that no XInclude processing has taken place at this time. +If you are using modular DocBook, the transform-original pipeline is usually a bad choice, +because it only operates on the root document, but not on the fragments referenced by XInclude. +If it is absolutely necessary to use a transform-original pipeline together with modular DocBook, +you can use Saxons -x switch to enable XInclude when parsing the document (see ). +Otherwise, however, the transform-before pipeline is usually the better choice +for modular DocBook documentsModular DocBookprocessing pipelines. diff --git a/src/main/scss/page-setup.scss b/src/main/scss/page-setup.scss index b227fe041..2d47c55bd 100644 --- a/src/main/scss/page-setup.scss +++ b/src/main/scss/page-setup.scss @@ -801,6 +801,17 @@ html.book-style .book .list-of-titles { counter-reset: page; } +/* ============================================================ */ +/* Support for landscape orientation */ + +@page landscape { + size: landscape; +} + +.landscape { + page: landscape; +} + /* ============================================================ */ html.article-style > header { diff --git a/src/main/xslt/modules/attributes.xsl b/src/main/xslt/modules/attributes.xsl index b53d13f85..9d7c1b46f 100644 --- a/src/main/xslt/modules/attributes.xsl +++ b/src/main/xslt/modules/attributes.xsl @@ -28,13 +28,20 @@ + + + + + + + @@ -44,8 +51,15 @@ + + + + + + + + select="f:attributes(., $attr, (local-name(.), 'division', @status, $landscape), ())"/> @@ -56,8 +70,15 @@ |db:preface|db:chapter|db:appendix" mode="m:attributes" as="attribute()*"> + + + + + + + + select="f:attributes(., $attr, (local-name(.), 'component', @status, $landscape), ())"/> @@ -70,8 +91,15 @@ + + + + + + + + select="f:attributes(., $attr, (local-name(.), @status, $landscape), ())"/> @@ -174,7 +202,7 @@ - + @@ -208,7 +236,7 @@ - + @@ -332,13 +360,21 @@ + + + + + + + - + Unit Test: article.016

Unit Test: article.016

Content in landscape orientation (for PDF)

\ No newline at end of file diff --git a/src/test/resources/expected/book.014.html b/src/test/resources/expected/book.014.html new file mode 100644 index 000000000..c655aa227 --- /dev/null +++ b/src/test/resources/expected/book.014.html @@ -0,0 +1,6 @@ +Fun with landscape orientation

Fun with landscape orientation

A series of book unit test that checks landscape orientation.

Chapter 1Purpose of this Book

This book contains a table with two wide columns. + The table won't fit on a regular, portrait-oriented page which is about 160 or 170mm wide (assuming A$ paper size). + This is why it is printed in landscape orientation in PDF output. + But as always, there are different ways to achieve this goal.

The whole book should be printed in landscape orientation

This is a very wide column (120mm)

The second column is also wide (80mm)

The caption for ths table should be printed in the same orientation as the table itself.

This is a regular para below the very wide table. + It has nothing to say, but will show the orientation within the firts chapter of this book

Chapter 2Second Chapter

The second chapter will end this book, which is very short indeed. It does not tell us anything about the outside world, + it's only purpuse is to show the effect of PDF pages in landscape orientation.

\ No newline at end of file diff --git a/src/test/resources/expected/book.015.html b/src/test/resources/expected/book.015.html new file mode 100644 index 000000000..f44bce060 --- /dev/null +++ b/src/test/resources/expected/book.015.html @@ -0,0 +1,6 @@ +More fun with landscape orientation

More fun with landscape orientation

A series of book unit test that checks landscape orientation.

Chapter 1Purpose of this Book

This book contains a table with two wide columns. + The table won't fit on a regular, portrait-oriented page which is about 160 or 170mm wide (assuming A$ paper size). + This is why it is printed in landscape orientation in PDF output. + But as always, there are different ways to achieve this goal.

Only this chapter should be printed in landscape orientation

This is a very wide column (120mm)

The second column is also wide (80mm)

The caption for ths table should be printed in the same orientation as the table itself.

This is a regular para below the very wide table. + It has nothing to say, but will show the orientation within the firts chapter of this book

Chapter 2Second Chapter

The second chapter will end this book, which is very short indeed. It does not tell us anything about the outside world, + it's only purpuse is to show the effect of PDF pages in landscape orientation.

\ No newline at end of file diff --git a/src/test/resources/expected/book.016.html b/src/test/resources/expected/book.016.html new file mode 100644 index 000000000..2b33c0269 --- /dev/null +++ b/src/test/resources/expected/book.016.html @@ -0,0 +1,10 @@ +Still more fun with landscape orientation

Still more fun with landscape orientation

A series of book unit test that checks landscape orientation.

Chapter 1Purpose of this Book

This book contains a table with two wide columns. + The table won't fit on a regular, portrait-oriented page which is about 160 or 170mm wide (assuming A$ paper size). + This is why it is printed in landscape orientation in PDF output. + But as always, there are different ways to achieve this goal.

This table with it's caption should be printed in landscape orientation

This is a very wide column (120mm)

The second column is also wide (80mm)

+

We use the table's orient Attribute

+

The caption for ths table should be printed in the same orientation as the table itself.

This is a regular para below the very wide table. + It has nothing to say, but will show the orientation within the firts chapter of this book

This is a very wide column (120mm)

The second column is also wide (80mm)

+

We use the table's role Attribute

+

The caption for ths table should be printed in the same orientation as the table itself.

Chapter 2Second Chapter

The second chapter will end this book, which is very short indeed. It does not tell us anything about the outside world, + it's only purpuse is to show the effect of PDF pages in landscape orientation.

\ No newline at end of file diff --git a/src/test/resources/expected/book.017.html b/src/test/resources/expected/book.017.html new file mode 100644 index 000000000..5a51283b0 --- /dev/null +++ b/src/test/resources/expected/book.017.html @@ -0,0 +1,6 @@ +Landscape orientation, revisited

Landscape orientation, revisited

A series of book unit test that checks landscape orientation.

Purpose of this Book

This book contains a table with two wide columns. + The table won't fit on a regular, portrait-oriented page which is about 160 or 170mm wide (assuming A$ paper size). + This is why it is printed in landscape orientation in PDF output. + But as always, there are different ways to achieve this goal.

This article should be printed in landscape orientation

This is a very wide column (120mm)

The second column is also wide (80mm)

The caption for ths table should be printed in the same orientation as the table itself.

This is a regular para below the very wide table. + It has nothing to say, but will show the orientation within the firts chapter of this book

Second Chapter

The second chapter will end this book, which is very short indeed. It does not tell us anything about the outside world, + it's only purpuse is to show the effect of PDF pages in landscape orientation.

\ No newline at end of file diff --git a/src/test/resources/expected/book.018.html b/src/test/resources/expected/book.018.html new file mode 100644 index 000000000..384a0c8f3 --- /dev/null +++ b/src/test/resources/expected/book.018.html @@ -0,0 +1,2 @@ +Fun with landscape orientend graphics

Fun with landscape orientend graphics

A series of book unit test that checks landscape orientation.

Chapter 1Purpose of this Book

The folowing figure should be printed in landscape orientation

A duck in its full beauty

This is a regular paragraph below the figure, it shoud be in portrait orientation.

Chapter 2Second Chapter

The second chapter will end this book, which is very short indeed. It does not tell us anything about the outside world, + it's only purpuse is to show the effect of PDF pages in landscape orientation.

\ No newline at end of file diff --git a/src/test/resources/xml/article.016.xml b/src/test/resources/xml/article.016.xml new file mode 100644 index 000000000..4de3f1801 --- /dev/null +++ b/src/test/resources/xml/article.016.xml @@ -0,0 +1,5 @@ + +
+ Unit Test: article.016 + Content in landscape orientation (for PDF) +
diff --git a/src/test/resources/xml/book.014.xml b/src/test/resources/xml/book.014.xml new file mode 100644 index 000000000..f93cc81e0 --- /dev/null +++ b/src/test/resources/xml/book.014.xml @@ -0,0 +1,46 @@ + + + + Fun with landscape orientation + + A series of book unit test that checks landscape orientation. + + + + + Purpose of this Book + This book contains a table with two wide columns. + The table won't fit on a regular, portrait-oriented page which is about 160 or 170mm wide (assuming A$ paper size). + This is why it is printed in landscape orientation in PDF output. + But as always, there are different ways to achieve this goal. + The whole book should be printed in landscape orientation + + + + + + + This is a very wide column (120mm) + The second column is also wide (80mm) + + + + + The caption for ths table should be printed in the same orientation as the table itself. + + + This is a regular para below the very wide table. + It has nothing to say, but will show the orientation within the firts chapter of this book + + + + Second Chapter + The second chapter will end this book, which is very short indeed. It does not tell us anything about the outside world, + it's only purpuse is to show the effect of PDF pages in landscape orientation. + + + + + diff --git a/src/test/resources/xml/book.015.xml b/src/test/resources/xml/book.015.xml new file mode 100644 index 000000000..8f463b817 --- /dev/null +++ b/src/test/resources/xml/book.015.xml @@ -0,0 +1,46 @@ + + + + More fun with landscape orientation + + A series of book unit test that checks landscape orientation. + + + + + Purpose of this Book + This book contains a table with two wide columns. + The table won't fit on a regular, portrait-oriented page which is about 160 or 170mm wide (assuming A$ paper size). + This is why it is printed in landscape orientation in PDF output. + But as always, there are different ways to achieve this goal. + Only this chapter should be printed in landscape orientation + + + + + + + This is a very wide column (120mm) + The second column is also wide (80mm) + + + + + The caption for ths table should be printed in the same orientation as the table itself. + + + This is a regular para below the very wide table. + It has nothing to say, but will show the orientation within the firts chapter of this book + + + + Second Chapter + The second chapter will end this book, which is very short indeed. It does not tell us anything about the outside world, + it's only purpuse is to show the effect of PDF pages in landscape orientation. + + + + + diff --git a/src/test/resources/xml/book.016.xml b/src/test/resources/xml/book.016.xml new file mode 100644 index 000000000..d3e19b0ac --- /dev/null +++ b/src/test/resources/xml/book.016.xml @@ -0,0 +1,73 @@ + + + + Still more fun with landscape orientation + + A series of book unit test that checks landscape orientation. + + + + + + Purpose of this Book + This book contains a table with two wide columns. + The table won't fit on a regular, portrait-oriented page which is about 160 or 170mm wide (assuming A$ paper size). + This is why it is printed in landscape orientation in PDF output. + But as always, there are different ways to achieve this goal. + This table with it's caption should be printed in landscape orientation + + + + + + + This is a very wide column (120mm) + The second column is also wide (80mm) + + + + We use the table's orient Attribute + + + + + + The caption for ths table should be printed in the same orientation as the table itself. + + + This is a regular para below the very wide table. + It has nothing to say, but will show the orientation within the firts chapter of this book + + + + + + + + This is a very wide column (120mm) + The second column is also wide (80mm) + + + + We use the table's role Attribute + + + + + + The caption for ths table should be printed in the same orientation as the table itself. + + + + + + Second Chapter + The second chapter will end this book, which is very short indeed. It does not tell us anything about the outside world, + it's only purpuse is to show the effect of PDF pages in landscape orientation. + + + + + diff --git a/src/test/resources/xml/book.017.xml b/src/test/resources/xml/book.017.xml new file mode 100644 index 000000000..dc1febe48 --- /dev/null +++ b/src/test/resources/xml/book.017.xml @@ -0,0 +1,46 @@ + + + + Landscape orientation, revisited + + A series of book unit test that checks landscape orientation. + + + +
+ Purpose of this Book + This book contains a table with two wide columns. + The table won't fit on a regular, portrait-oriented page which is about 160 or 170mm wide (assuming A$ paper size). + This is why it is printed in landscape orientation in PDF output. + But as always, there are different ways to achieve this goal. + This article should be printed in landscape orientation + + + + + + + This is a very wide column (120mm) + The second column is also wide (80mm) + + + + + The caption for ths table should be printed in the same orientation as the table itself. + + + This is a regular para below the very wide table. + It has nothing to say, but will show the orientation within the firts chapter of this book +
+ +
+ Second Chapter + The second chapter will end this book, which is very short indeed. It does not tell us anything about the outside world, + it's only purpuse is to show the effect of PDF pages in landscape orientation. +
+ + + +
diff --git a/src/test/resources/xml/book.018.xml b/src/test/resources/xml/book.018.xml new file mode 100644 index 000000000..be5f8e904 --- /dev/null +++ b/src/test/resources/xml/book.018.xml @@ -0,0 +1,35 @@ + + + + Fun with landscape orientend graphics + + A series of book unit test that checks landscape orientation. + + + + + Purpose of this Book + + The folowing figure should be printed in landscape orientation + + + + + + A duck in its full beauty + + + This is a regular paragraph below the figure, it shoud be in portrait orientation. + + + + Second Chapter + The second chapter will end this book, which is very short indeed. It does not tell us anything about the outside world, + it's only purpuse is to show the effect of PDF pages in landscape orientation. + + + + +