commit bd9dce374976ef8d8f9be0140217c2d92b950c66
Author: Thibaut Cuvelier <[email protected]>
Date:   Fri Nov 27 05:53:46 2020 +0100

    DocBook: bug fixes for JASA.
    
    Includes more consistent behaviour for bibliographies in appendix (do the 
same as LyX shows the user, i.e. bibliography in appendix).
---
 development/autotests/invertedTests |    3 +--
 lib/layouts/jasatex.layout          |    3 ++-
 src/output_docbook.cpp              |    7 ++++++-
 3 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/development/autotests/invertedTests 
b/development/autotests/invertedTests
index de16240..6fb757b 100644
--- a/development/autotests/invertedTests
+++ b/development/autotests/invertedTests
@@ -504,8 +504,6 @@ export/templates/Articles/R_Journal_docbook5
 export/templates/Articles/REVTeX_%28V._4.1%29_docbook5
 # - Address at the end of the document (only allowed in abstract).
 export/templates/Articles/Kluwer_docbook5
-# - Broken references, empty figures.
-export/templates/Articles/Journal_of_the_Acoustical_Society_of_America_%28JASA%29_docbook5
 # - Broken references, empty figures, misplaced acknowledgements (template not 
viable for DocBook).
 
export/templates/Articles/International_Union_of_Crystallography_%28IUCr%29_docbook5
 # - Biographies after bibliography: DocBook does not allow content after a 
bibliography.
@@ -513,6 +511,7 @@ export/templates/Articles/Mathematical_Monthly_docbook5
 # - Empty figure, very custom table caption (maybe fixable?), strange 
appendices (not in ToC).
 export/templates/Articles/Int._Journal_of_Modern_Physics_(C|D)_docbook5
 # - Broken references.
+export/templates/Articles/Journal_of_the_Acoustical_Society_of_America_%28JASA%29_docbook5
 export/templates/Articles/Astronomy_%26_Astrophysics_docbook5
 
 Sublabel: docbook poster
diff --git a/lib/layouts/jasatex.layout b/lib/layouts/jasatex.layout
index a20d905..c45716e 100644
--- a/lib/layouts/jasatex.layout
+++ b/lib/layouts/jasatex.layout
@@ -227,7 +227,7 @@ Style Abstract
          Series        Bold
          Size          Large
        EndFont
-       DocBookTag       NONE
+       DocBookTag       para
        DocBookAbstract  true
 End
 
@@ -297,6 +297,7 @@ Style Acknowledgments
        DocBookTag            para
        DocBookWrapperTag     acknowledgements
        DocBookSection        true
+       DocBookAbstract       false
 End
 
 
diff --git a/src/output_docbook.cpp b/src/output_docbook.cpp
index 214c2a8..519d70e 100644
--- a/src/output_docbook.cpp
+++ b/src/output_docbook.cpp
@@ -1161,11 +1161,16 @@ void docbookParagraphs(Text const &text,
                        Inset const *firstInset = par->getInset(0);
                        if (firstInset && (firstInset->lyxCode() == 
BIBITEM_CODE || firstInset->lyxCode() == BIBTEX_CODE)) {
                                while (!headerLevels.empty()) {
+                                       // Don't close appendices before 
bibliographies.
+                                       if (headerLevels.top().second == 
"appendix")
+                                               break;
+
+                                       // Pop the section from the stack.
                                        int level = headerLevels.top().first;
                                        docstring tag = from_utf8("</" + 
headerLevels.top().second + ">");
                                        headerLevels.pop();
 
-                                       // Output the tag only if it 
corresponds to a legit section.
+                                       // Output the tag only if it 
corresponds to a legit section, as the rest of the code.
                                        if (level != Layout::NOT_IN_TOC) {
                                                xs << XMLStream::ESCAPE_NONE << 
tag;
                                                xs << xml::CR();
-- 
lyx-cvs mailing list
[email protected]
http://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to