From 0d5b7b6578b1c46e27777ceca350d234376f3b53 Mon Sep 17 00:00:00 2001 From: Frank Steimke Date: Tue, 6 Feb 2024 07:00:15 +0100 Subject: [PATCH 1/4] Support for landscape orientation in print output for some elements --- src/guide/xml/ch02.xml | 6 +++ src/main/scss/page-setup.scss | 11 +++++ src/main/xslt/modules/attributes.xsl | 50 +++++++++++++++++--- src/test/resources/expected/article.016.html | 1 + src/test/resources/expected/book.014.html | 6 +++ src/test/resources/expected/book.015.html | 6 +++ src/test/resources/expected/book.016.html | 6 +++ src/test/resources/expected/book.017.html | 6 +++ src/test/resources/expected/book.018.html | 2 + src/test/resources/xml/article.016.xml | 6 +++ src/test/resources/xml/book.014.xml | 47 ++++++++++++++++++ src/test/resources/xml/book.015.xml | 47 ++++++++++++++++++ src/test/resources/xml/book.016.xml | 48 +++++++++++++++++++ src/test/resources/xml/book.017.xml | 47 ++++++++++++++++++ src/test/resources/xml/book.018.xml | 36 ++++++++++++++ 15 files changed, 318 insertions(+), 7 deletions(-) create mode 100644 src/test/resources/expected/article.016.html create mode 100644 src/test/resources/expected/book.014.html create mode 100644 src/test/resources/expected/book.015.html create mode 100644 src/test/resources/expected/book.016.html create mode 100644 src/test/resources/expected/book.017.html create mode 100644 src/test/resources/expected/book.018.html create mode 100644 src/test/resources/xml/article.016.xml create mode 100644 src/test/resources/xml/book.014.xml create mode 100644 src/test/resources/xml/book.015.xml create mode 100644 src/test/resources/xml/book.016.xml create mode 100644 src/test/resources/xml/book.017.xml create mode 100644 src/test/resources/xml/book.018.xml diff --git a/src/guide/xml/ch02.xml b/src/guide/xml/ch02.xml index b5a6631822..cf1de8d916 100755 --- a/src/guide/xml/ch02.xml +++ b/src/guide/xml/ch02.xml @@ -1484,6 +1484,12 @@ 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 it to + landscape orientation with the <?landscape> processing instruction. 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. diff --git a/src/main/scss/page-setup.scss b/src/main/scss/page-setup.scss index b227fe0414..2d47c55bd0 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 b53d13f85a..cae4b17386 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 0000000000..c655aa2276 --- /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 0000000000..41f67c4dfb --- /dev/null +++ b/src/test/resources/expected/book.015.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.

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 0000000000..6550aaffa5 --- /dev/null +++ b/src/test/resources/expected/book.016.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.

Only 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)

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.017.html b/src/test/resources/expected/book.017.html new file mode 100644 index 0000000000..073f2dc8d8 --- /dev/null +++ b/src/test/resources/expected/book.017.html @@ -0,0 +1,6 @@ +Fun with landscape orientation

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 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 0000000000..04a72b9e14 --- /dev/null +++ b/src/test/resources/expected/book.018.html @@ -0,0 +1,2 @@ +Fun with landscape orientation

Fun with landscape orientation

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 0000000000..e584a9c009 --- /dev/null +++ b/src/test/resources/xml/article.016.xml @@ -0,0 +1,6 @@ + +
+ + 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 0000000000..6f3774d999 --- /dev/null +++ b/src/test/resources/xml/book.014.xml @@ -0,0 +1,47 @@ + + + + + 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 0000000000..36054795c0 --- /dev/null +++ b/src/test/resources/xml/book.015.xml @@ -0,0 +1,47 @@ + + + + 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 0000000000..78adb321fd --- /dev/null +++ b/src/test/resources/xml/book.016.xml @@ -0,0 +1,48 @@ + + + + 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 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) + + + + + 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.017.xml b/src/test/resources/xml/book.017.xml new file mode 100644 index 0000000000..a3016aa867 --- /dev/null +++ b/src/test/resources/xml/book.017.xml @@ -0,0 +1,47 @@ + + + + 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 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 0000000000..80880e8219 --- /dev/null +++ b/src/test/resources/xml/book.018.xml @@ -0,0 +1,36 @@ + + + + Fun with landscape orientation + + 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. + + + + + From 4e3a02d78365fc21fde503f2fd7c32105bdd13fa Mon Sep 17 00:00:00 2001 From: Frank Steimke Date: Fri, 23 Feb 2024 10:51:38 +0100 Subject: [PATCH 2/4] Change landscape support mechanism from PI to role attribute --- src/guide/xml/ch02.xml | 42 ++++++++++++++++------- src/main/xslt/modules/attributes.xsl | 14 ++++---- src/test/resources/expected/book.015.html | 2 +- src/test/resources/expected/book.016.html | 10 ++++-- src/test/resources/expected/book.017.html | 2 +- src/test/resources/expected/book.018.html | 2 +- src/test/resources/xml/article.016.xml | 3 +- src/test/resources/xml/book.014.xml | 3 +- src/test/resources/xml/book.015.xml | 5 ++- src/test/resources/xml/book.016.xml | 37 ++++++++++++++++---- src/test/resources/xml/book.017.xml | 5 ++- src/test/resources/xml/book.018.xml | 5 ++- 12 files changed, 86 insertions(+), 44 deletions(-) diff --git a/src/guide/xml/ch02.xml b/src/guide/xml/ch02.xml index cf1de8d916..8563e5957f 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,13 +1496,20 @@ 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 it to - landscape orientation with the <?landscape> processing instruction. 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. - + +Landscape orientation in print output +The default orientation for pages in print output is portrait. You can switch it 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 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
@@ -1641,4 +1660,3 @@ has a background color.
- diff --git a/src/main/xslt/modules/attributes.xsl b/src/main/xslt/modules/attributes.xsl index cae4b17386..9d7c1b46f5 100644 --- a/src/main/xslt/modules/attributes.xsl +++ b/src/main/xslt/modules/attributes.xsl @@ -30,7 +30,7 @@ - + @@ -53,7 +53,7 @@ - + @@ -72,7 +72,7 @@ - + @@ -93,7 +93,7 @@ (I'm not sure that matters, but ...) --> - + @@ -202,7 +202,7 @@ - + @@ -236,7 +236,7 @@ - + @@ -364,7 +364,7 @@ - + diff --git a/src/test/resources/expected/book.015.html b/src/test/resources/expected/book.015.html index 41f67c4dfb..f44bce0605 100644 --- a/src/test/resources/expected/book.015.html +++ b/src/test/resources/expected/book.015.html @@ -1,4 +1,4 @@ -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. +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. diff --git a/src/test/resources/expected/book.016.html b/src/test/resources/expected/book.016.html index 6550aaffa5..2b33c02696 100644 --- a/src/test/resources/expected/book.016.html +++ b/src/test/resources/expected/book.016.html @@ -1,6 +1,10 @@ -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. +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.

Only 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)

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, + 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 index 073f2dc8d8..5a51283b05 100644 --- a/src/test/resources/expected/book.017.html +++ b/src/test/resources/expected/book.017.html @@ -1,4 +1,4 @@ -Fun with landscape orientation

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. +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. diff --git a/src/test/resources/expected/book.018.html b/src/test/resources/expected/book.018.html index 04a72b9e14..384a0c8f3a 100644 --- a/src/test/resources/expected/book.018.html +++ b/src/test/resources/expected/book.018.html @@ -1,2 +1,2 @@ -Fun with landscape orientation

Fun with landscape orientation

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, +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 index e584a9c009..4de3f18018 100644 --- a/src/test/resources/xml/article.016.xml +++ b/src/test/resources/xml/article.016.xml @@ -1,6 +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 index 6f3774d999..f93cc81e0f 100644 --- a/src/test/resources/xml/book.014.xml +++ b/src/test/resources/xml/book.014.xml @@ -1,8 +1,7 @@ - + version="5.0" xml:id="book" role="landscape"> Fun with landscape orientation diff --git a/src/test/resources/xml/book.015.xml b/src/test/resources/xml/book.015.xml index 36054795c0..8f463b8171 100644 --- a/src/test/resources/xml/book.015.xml +++ b/src/test/resources/xml/book.015.xml @@ -3,14 +3,13 @@ xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0" xml:id="book"> - Fun with landscape orientation + 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). diff --git a/src/test/resources/xml/book.016.xml b/src/test/resources/xml/book.016.xml index 78adb321fd..d3e19b0ac5 100644 --- a/src/test/resources/xml/book.016.xml +++ b/src/test/resources/xml/book.016.xml @@ -3,7 +3,7 @@ xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0" xml:id="book"> - Fun with landscape orientation + Still more fun with landscape orientation A series of book unit test that checks landscape orientation. @@ -16,17 +16,21 @@ 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 table with it's caption should be printed in landscape orientation - - + 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 + + @@ -35,6 +39,27 @@ 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. + + diff --git a/src/test/resources/xml/book.017.xml b/src/test/resources/xml/book.017.xml index a3016aa867..dc1febe48a 100644 --- a/src/test/resources/xml/book.017.xml +++ b/src/test/resources/xml/book.017.xml @@ -3,14 +3,13 @@ xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0" xml:id="book"> - Fun with landscape orientation + 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). diff --git a/src/test/resources/xml/book.018.xml b/src/test/resources/xml/book.018.xml index 80880e8219..be5f8e904f 100644 --- a/src/test/resources/xml/book.018.xml +++ b/src/test/resources/xml/book.018.xml @@ -3,7 +3,7 @@ xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0" xml:id="book"> - Fun with landscape orientation + Fun with landscape orientend graphics A series of book unit test that checks landscape orientation. @@ -13,8 +13,7 @@ Purpose of this Book The folowing figure should be printed in landscape orientation - - + From c8b8fa6b98d92b1c4166525873567464aeeca017 Mon Sep 17 00:00:00 2001 From: Frank Steimke Date: Fri, 23 Feb 2024 12:33:38 +0100 Subject: [PATCH 3/4] Minor changes in Reference Guide Chapter 2 --- src/guide/xml/ch02.xml | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/guide/xml/ch02.xml b/src/guide/xml/ch02.xml index 8563e5957f..6c228439e3 100755 --- a/src/guide/xml/ch02.xml +++ b/src/guide/xml/ch02.xml @@ -1496,9 +1496,11 @@ 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 it to +
+ +
+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 @@ -1507,9 +1509,14 @@ landscape orientation with landscape as a token within the 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 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 +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. +
From 7a4f3b6be31e530483580f4d0c125e0938b54a05 Mon Sep 17 00:00:00 2001 From: Frank Steimke Date: Thu, 3 Oct 2024 06:31:17 +0200 Subject: [PATCH 4/4] renamed book.014 to book.019 to avoid conflict with release 2.2.1 --- src/test/resources/expected/{book.014.html => book.019.html} | 0 src/test/resources/xml/{book.014.xml => book.019.xml} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename src/test/resources/expected/{book.014.html => book.019.html} (100%) rename src/test/resources/xml/{book.014.xml => book.019.xml} (100%) diff --git a/src/test/resources/expected/book.014.html b/src/test/resources/expected/book.019.html similarity index 100% rename from src/test/resources/expected/book.014.html rename to src/test/resources/expected/book.019.html diff --git a/src/test/resources/xml/book.014.xml b/src/test/resources/xml/book.019.xml similarity index 100% rename from src/test/resources/xml/book.014.xml rename to src/test/resources/xml/book.019.xml