commit ed6fbdd2497ba5248c0ccdddb3ff69a24be32097
Author: Thibaut Cuvelier <[email protected]>
Date:   Thu Nov 26 06:40:39 2020 +0100

    DocBook: implement Kluwer.
    
    Includes an assertion fix that only occurred with this example.
---
 development/autotests/invertedTests |    2 +
 lib/layouts/kluwer.layout           |   37 +++++++++++++++++++++++++++++++++++
 lib/layouts/svcommon.inc            |    2 +
 src/output_docbook.cpp              |    6 +++-
 4 files changed, 45 insertions(+), 2 deletions(-)

diff --git a/development/autotests/invertedTests 
b/development/autotests/invertedTests
index b66a21f..d562ba5 100644
--- a/development/autotests/invertedTests
+++ b/development/autotests/invertedTests
@@ -499,6 +499,8 @@ export/templates/Articles/R_Journal_docbook5
 export/templates/Articles/REVTeX_%28V._4%29_docbook5
 # - Forbidden inlines, equation in formatting, broken references, float in 
paragraphs, videos.
 export/templates/Articles/REVTeX_%28V._4.1%29_docbook5
+# - Address at the end of the document (only allowed in abstract), misplaced 
acknowledgements.
+export/templates/Articles/Kluwer_docbook5
 
 Sublabel: docbook poster
 # Posters cannot be properly exported, the LyX documents are too far from
diff --git a/lib/layouts/kluwer.layout b/lib/layouts/kluwer.layout
index 7af1b83..3619add 100644
--- a/lib/layouts/kluwer.layout
+++ b/lib/layouts/kluwer.layout
@@ -41,6 +41,7 @@ Style Standard
        Align                 Block
        AlignPossible         Block, Left, Right, Center
        LabelType             No_Label
+       DocBookTag            para
 End
 
 
@@ -126,6 +127,9 @@ Style Title
          Size                Largest
        EndFont
        HTMLTitle             true
+       DocBookTag            title
+       DocBookTagType        paragraph
+       DocBookInInfo         maybe
 End
 
 
@@ -146,6 +150,9 @@ Style Subtitle
          Size                Larger
          Shape               Italic
        EndFont
+       DocBookTag            subtitle
+       DocBookTagType        paragraph
+       DocBookInInfo         maybe
 End
 
 
@@ -162,6 +169,9 @@ Style Date
        Font
          Size                Large
        EndFont
+       DocBookTag            date
+       DocBookTagType        paragraph
+       DocBookInInfo         always
 End
 
 
@@ -180,6 +190,11 @@ Style Author
          Size                Normal
          Series              Bold
        EndFont
+       DocBookTag            personname
+       DocBookTagType        paragraph
+       DocBookWrapperTag     author
+       DocBookWrapperTagType inline
+       DocBookInInfo         always
 End
 
 
@@ -196,6 +211,12 @@ Style Address
          Size                normal
          Shape               Italic
        EndFont
+       DocBookTag            address
+       DocBookTagType        block
+       DocBookWrapperTag     author
+       DocBookWrapperTagType inline
+       DocBookWrapperMergeWithPrevious  true
+       DocBookInInfo         always
 End
 
 
@@ -214,6 +235,9 @@ Style AddressForOffprints
          Shape               Italic
          Color               Red
        EndFont
+       DocBookTag            address
+       DocBookAttr           role='offprints'
+       DocBookTagType        block
 End
 
 
@@ -236,6 +260,9 @@ Style RunningTitle
          Shape               Italic
          Color               Red
        EndFont
+       DocBookTag            titleabbrev
+       DocBookTagType        paragraph
+       DocBookInInfo         maybe
 End
 
 
@@ -257,6 +284,10 @@ Style RunningAuthor
          Shape               Italic
          Color               Red
        EndFont
+       DocBookTag            authorinitials
+       DocBookAttr           role='running-author'
+       DocBookTagType        paragraph
+       DocBookInInfo         always
 End
 
 
@@ -299,6 +330,10 @@ Style Keywords
          Series              Bold
          Size                Small
        EndFont
+       DocBookTag            keyword
+       DocBookTagType        paragraph
+       DocBookWrapperTag     keywordset
+       DocBookInInfo         always
 End
 
 
@@ -320,6 +355,8 @@ Style Acknowledgements
          Series              Bold
          Size                Large
        EndFont
+       DocBookTag            para
+       DocBookWrapperTag     acknowledgements
 End
 
 
diff --git a/lib/layouts/svcommon.inc b/lib/layouts/svcommon.inc
index 7612d77..f646a06 100644
--- a/lib/layouts/svcommon.inc
+++ b/lib/layouts/svcommon.inc
@@ -363,6 +363,8 @@ Style Subtitle
          Size          Large
        EndFont
        DocBookTag            subtitle
+       DocBookTagType        paragraph
+       DocBookInInfo         maybe
 End
 
 Style Author
diff --git a/src/output_docbook.cpp b/src/output_docbook.cpp
index 73e5a46..c033239 100644
--- a/src/output_docbook.cpp
+++ b/src/output_docbook.cpp
@@ -183,7 +183,8 @@ void openParTag(XMLStream & xs, const Paragraph * par, 
const Paragraph * prevpar
        // layout, same wrapper tag).
        Layout const & lay = par->layout();
        bool openWrapper = lay.docbookwrappertag() != "NONE" && 
!runparams.docbook_ignore_wrapper;
-       if (prevpar != nullptr) {
+
+       if (prevpar != nullptr && !runparams.docbook_ignore_wrapper) {
                Layout const & prevlay = prevpar->layout();
                if (prevlay.docbookwrappertag() != "NONE") {
                        if (prevlay.docbookwrappertag() == 
lay.docbookwrappertag() &&
@@ -223,7 +224,8 @@ void closeParTag(XMLStream & xs, Paragraph const * par, 
Paragraph const * nextpa
        // See comment in openParTag.
        Layout const & lay = par->layout();
        bool closeWrapper = lay.docbookwrappertag() != "NONE" && 
!runparams.docbook_ignore_wrapper;
-       if (nextpar != nullptr) {
+
+       if (nextpar != nullptr && !runparams.docbook_ignore_wrapper) {
                Layout const & nextlay = nextpar->layout();
                if (nextlay.docbookwrappertag() != "NONE") {
                        if (nextlay.docbookwrappertag() == 
lay.docbookwrappertag() &&
-- 
lyx-cvs mailing list
[email protected]
http://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to