]> git.lyx.org Git - lyx.git/commitdiff
DocBook: implement margin/sidenotes in Tufte.
authorThibaut Cuvelier <tcuvelier@lyx.org>
Sun, 5 Dec 2021 21:53:36 +0000 (22:53 +0100)
committerThibaut Cuvelier <tcuvelier@lyx.org>
Sun, 5 Dec 2021 21:54:51 +0000 (22:54 +0100)
autotests/export/docbook/Tufte_Book.xml
lib/layouts/tufte-book.layout

index 3289cfd7638a76c780176edaa631b57fbb01ec8e..0c1cd5707b8fcb9d9821de814aba61510889507c 100644 (file)
@@ -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>
index f36f395059ec71a1e83cdca26bd8273204bbea93..bc79f5d6ef14b29cab9d5692b7f624b6d8672b25 100644 (file)
@@ -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