[LyX/master] DocBook: support Full Width from Tufte Book.

Thibaut Cuvelier tcuvelier at lyx.org
Sat Sep 19 18:18:56 UTC 2020


commit ff2e4ec7e65f43bf09b92f4b6b4be9ce135223d3
Author: Thibaut Cuvelier <tcuvelier at lyx.org>
Date:   Mon Aug 31 00:43:02 2020 +0200

    DocBook: support Full Width from Tufte Book.
---
 autotests/export/docbook/Tufte_Book.xml |   28 +++++++++++++++++-----------
 lib/layouts/tufte-book.layout           |    2 ++
 2 files changed, 19 insertions(+), 11 deletions(-)

diff --git a/autotests/export/docbook/Tufte_Book.xml b/autotests/export/docbook/Tufte_Book.xml
index 3fb7f24..4968e25 100644
--- a/autotests/export/docbook/Tufte_Book.xml
+++ b/autotests/export/docbook/Tufte_Book.xml
@@ -3,26 +3,32 @@
   See http://www.lyx.org/ for more information -->
 <book xml:lang="en_US" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:xi="http://www.w3.org/2001/XInclude" version="5.2">
 <info>
-
 <title>Tufte Examples</title>
+<author>
+<personname>Fake Author</personname>
+</author>
 </info>
 <chapter>
-<title>The Features of the Tufte-book Class</title>
+<title>
+The Features of the Tufte-book Class
+</title>
 <para>In this document, it was endeavored to show some of the features of the <emphasis role='sans'>Tufte-book</emphasis> class. In the first chapter, their use is outlined. In the second chapter, their use through a handout that was created in a calculus class is demonstrated.</para>
 <section>
-<title>Working with Text</title>
-<para>One of the most prominent and distinctive features of this style is the extensive use of sidenotes. There is a wide margin to provide ample room for sidenotes and small figures. Any footnotes will automatically be converted to sidenotes.<footnote><para>This is a sidenote that was entered using a <code>footnote</code>.</para>
-</footnote> Alternatively, you can also use the <code>Sidenote</code> inset directly; you'll find it in the <emphasis role='sans'>Insert&#x21D2;Custom Insets</emphasis> menu.This is a sidenote that was entered using a <code>sidenote</code>.</para>
+<title>
+Working with Text
+</title>
+<para>One of the most prominent and distinctive features of this style is the extensive use of sidenotes. There is a wide margin to provide ample room for sidenotes and small figures. Any footnotes will automatically be converted to sidenotes.<footnote>
+<para>This is a sidenote that was entered using a <code>footnote</code>.</para>
+</footnote> Alternatively, you can also use the <code>Sidenote</code> inset directly; you'll find it in the <emphasis role='sans'>Insert&#x21D2;Custom Insets</emphasis> menu.This is a sidenote that was entered using a sidenote.</para>
 <para>If you like to place ancillary information in the margin without the sidenote mark (the superscript number), you can use the <code>Marginnote</code> inset. This is Tufte's margin note. Notice that there isn't a number preceding the note, and there is no number in the main text where this note was written. The normal margin note will work as well, but it will look rather odd.<sidebar role="margin">
-<?dbfo float-type="margin.note"?><sidebar role="margin">This is a normal margin note. Don't use it.</sidebar></sidebar></para>
-<para>Another useful innovation is Tufte's <code>NewThought</code> character style (<emphasis role='sans'>Edit&#x21D2;TextStyle&#x21D2;NewThought</emphasis>). It introduces new thoughts by means of small caps, as demonstrated in this paragraph. </para>
+<?dbfo float-type="margin.note"?>
+<para>This is a normal margin note. Don't use it.</para></sidebar></para>
+<para><emphasis role='newthought'>Another useful</emphasis> innovation is Tufte's <code>NewThought</code> character style (<emphasis role='sans'>Edit&#x21D2;TextStyle&#x21D2;NewThought</emphasis>). It introduces new thoughts by means of small caps, as demonstrated in this paragraph. </para>
 <para>The Tufte document classes include two new character styles and some improvements on existing commands for letterspacing.</para>
-<para>When setting strings of <emphasis role='allcaps'>ALL CAPS</emphasis> or small caps, the letterspacing—that is, the spacing between the letters—should be increased slightly.<biblioref endterm="Bringhurst2005" /> The <emphasis>AllCaps</emphasis> character style (<emphasis role='sans'>Edit&#x21D2;TextStyle&#x21D2;AllCaps</emphasis>) has proper letterspacing for strings of <emphasis role='allcaps'>FULL CAPITAL LETTERS</emphasis>, and the <emphasis>SmallCaps</emphasis> character style (<emphasis role='sans'>Edit&#x21D2;TextStyle&#x21D2;SmallCaps</emphasis>) has letterspacing for small capital letters. These commands will also automatically convert the case of the text to upper- or lowercase, respectively.</para>
+<para>When setting strings of <emphasis role='allcaps'>ALL CAPS</emphasis> or <emphasis role='smallcaps'>small caps</emphasis>, the letterspacing—that is, the spacing between the letters—should be increased slightly.<biblioref endterm="Bringhurst2005" /> The <emphasis>AllCaps</emphasis> character style (<emphasis role='sans'>Edit&#x21D2;TextStyle&#x21D2;AllCaps</emphasis>) has proper letterspacing for strings of <emphasis role='allcaps'>FULL CAPITAL LETTERS</emphasis>, and the <emphasis>SmallCaps</emphasis> character style (<emphasis role='sans'>Edit&#x21D2;TextStyle&#x21D2;SmallCaps</emphasis>) has letterspacing for <emphasis role='smallcaps'>small capital letters</emphasis>. These commands will also automatically convert the case of the text to upper- or lowercase, respectively.</para>
 <para>The normal <emphasis>Small Caps</emphasis> shape has also been redefined to include letterspacing. Its case is left as is, however. This allows one to use both uppercase and lowercase letters: <emphasis role='smallcaps'>The Initial Letters Of The Words In This Sentence Are Capitalized.</emphasis></para>
 <para>Finally, the<emphasis> Full Width</emphasis> paragraph environment provides a paragraph layout that stretches across the main text block and the sidenotes area:</para>
-<Full Width>
-Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris ut leo. Cras viverra metus rhoncus sem. Nulla et lectus vestibulum urna fringilla ultrices. Phasellus eu tellus sit amet tortor gravida placerat. Integer sapien est, iaculis in, pretium quis, viverra ac, nunc. Praesent eget sem vel leo ultrices bibendum. Aenean faucibus. Morbi dolor nulla, malesuada eu, pulvinar at, mollis ac, nulla. Curabitur auctor semper nulla. Donec varius orci eget risus. Duis nibh mi, congue eu, accumsan eleifend, sagittis quis, diam. Duis eget orci sit amet orci dignissim rutrum.
-</Full Width>
+<para role='fullwidth'>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris ut leo. Cras viverra metus rhoncus sem. Nulla et lectus vestibulum urna fringilla ultrices. Phasellus eu tellus sit amet tortor gravida placerat. Integer sapien est, iaculis in, pretium quis, viverra ac, nunc. Praesent eget sem vel leo ultrices bibendum. Aenean faucibus. Morbi dolor nulla, malesuada eu, pulvinar at, mollis ac, nulla. Curabitur auctor semper nulla. Donec varius orci eget risus. Duis nibh mi, congue eu, accumsan eleifend, sagittis quis, diam. Duis eget orci sit amet orci dignissim rutrum.</para>
 </section>
 </chapter>
 <bibliography>
diff --git a/lib/layouts/tufte-book.layout b/lib/layouts/tufte-book.layout
index 2b88ca3..e469996 100644
--- a/lib/layouts/tufte-book.layout
+++ b/lib/layouts/tufte-book.layout
@@ -243,6 +243,8 @@ Style Full_Width
 	Align			Block
 	AlignPossible	Block, Left, Right, Center
 	LabelType		No_Label
+	DocBookTag      para
+	DocBookAttr     role='fullwidth'
 End
 
 # this steps the counters


More information about the lyx-cvs mailing list