commit e3489d54e3485ef186eb70b06d4372eaa400db98
Author: Thibaut Cuvelier <tcuvel...@lyx.org>
Date:   Sun Dec 5 22:53:36 2021 +0100

    DocBook: implement margin/sidenotes in Tufte.
---
 autotests/export/docbook/Tufte_Book.xml |   13 +++++++++----
 lib/layouts/tufte-book.layout           |    6 ++++++
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/autotests/export/docbook/Tufte_Book.xml 
b/autotests/export/docbook/Tufte_Book.xml
index 3289cfd..0c1cd57 100644
--- a/autotests/export/docbook/Tufte_Book.xml
+++ b/autotests/export/docbook/Tufte_Book.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!-- This DocBook file was created by LyX 2.4.0dev
-  See http://www.lyx.org/ for more information -->
+  See https://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>
@@ -19,10 +19,15 @@ 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">
+</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.<footnote role='sidenote'>
+<para>This is a sidenote that was entered using a sidenote.</para>
+</footnote></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. <footnote role='marginnote'>
+<para>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.</para>
+</footnote> The normal margin note will work as well, but it will look rather 
odd.<sidebar role="margin">
 <?dbfo float-type="margin.note"?>
-<para>This is a normal margin note. Don't use it.</para></sidebar></para>
+<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 
<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>
diff --git a/lib/layouts/tufte-book.layout b/lib/layouts/tufte-book.layout
index f36f395..bc79f5d 100644
--- a/lib/layouts/tufte-book.layout
+++ b/lib/layouts/tufte-book.layout
@@ -170,6 +170,10 @@ InsetLayout Flex:Sidenote
          Color                 marginlabel
          Size                  Small
        EndFont
+    DocBookTag      footnote
+    DocBookAttr     role='sidenote'
+       DocBookItemTag  para
+    DocBookTagType  inline
        ResetsFont              true
 End
 
@@ -183,6 +187,7 @@ InsetLayout Flex:Marginnote
          Shape                 Up
          Series                Medium
        EndFont
+    DocBookAttr     role='marginnote'
        MultiPar                true
 End
 
@@ -201,6 +206,7 @@ InsetLayout Flex:NewThought
        ResetsFont              true
        DocBookTag      emphasis
        DocBookAttr     role='newthought'
+    DocBookTagType  inline
 End
 
 InsetLayout Flex:AllCaps
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to