[LyX features/feature/docbook] DocBook: simplify precooked bibliography code.

Thibaut Cuvelier tcuvelier at lyx.org
Wed Aug 19 22:28:51 UTC 2020


The branch, feature/docbook, has been created.
        at  a6d42bca15aad0a52b46dabf0069d0604e8fdacd (commit)

- Log -----------------------------------------------------------------

commit a6d42bca15aad0a52b46dabf0069d0604e8fdacd
Author: Thibaut Cuvelier <tcuvelier at lyx.org>
Date:   Tue Aug 18 05:46:40 2020 +0200

    DocBook: simplify precooked bibliography code.

diff --git a/src/output_docbook.cpp b/src/output_docbook.cpp
index a1c3f94..114fee5 100644
--- a/src/output_docbook.cpp
+++ b/src/output_docbook.cpp
@@ -358,63 +358,59 @@ void closeItemTag(XMLStream & xs, Layout const & lay)
 }
 
 
+void makeAny(
+		Text const &,
+		Buffer const &,
+		XMLStream &,
+		OutputParams const &,
+		ParagraphList::const_iterator);
+
+
 void makeParagraphBibliography(
 		Buffer const & buf,
 		XMLStream & xs,
 		OutputParams const & runparams,
 		Text const & text,
-		ParagraphList::const_iterator const & pbegin)
+		ParagraphList::const_iterator const & par)
 {
-	auto const begin = text.paragraphs().begin();
-	auto const end = text.paragraphs().end();
-	auto pend = pbegin;
-	++pend;
-
-	// Find the paragraph *before* pbegin.
-	ParagraphList::const_iterator pbegin_before = begin;
-	if (pbegin != begin) {
-		ParagraphList::const_iterator pbegin_before_next = begin;
-		++pbegin_before_next;
-
-		while (pbegin_before_next != pbegin) {
-			++pbegin_before;
-			++pbegin_before_next;
-		}
-	}
-
-	ParagraphList::const_iterator par = pbegin;
-
 	// If this is the first paragraph in a bibliography, open the bibliography tag.
-	if (pbegin != begin && pbegin_before->layout().latextype != LATEX_BIB_ENVIRONMENT) {
+	auto pbegin_before = text.paragraphs().getParagraphBefore(par);
+	if (pbegin_before->layout().latextype != LATEX_BIB_ENVIRONMENT) {
 		xs << xml::StartTag("bibliography");
 		xs << xml::CR();
 	}
 
-	// Generate the required paragraphs, but only if they are .
-	for (; par != pend; ++par) {
-		// Start the precooked bibliography entry. This is very much like opening a paragraph tag.
-		// Don't forget the citation ID!
-		docstring attr;
-		for (auto i = 0; i < par->size(); ++i) {
-			Inset const *ip = par->getInset(0);
-			if (ip != nullptr && ip->lyxCode() == BIBITEM_CODE) {
-				const auto * bibitem = dynamic_cast<const InsetBibitem*>(par->getInset(i));
-				attr = from_utf8("xml:id='") + bibitem->getParam("key") + from_utf8("'");
-				break;
-			}
+	// Start the precooked bibliography entry. This is very much like opening a paragraph tag.
+	// Don't forget the citation ID!
+	docstring attr;
+	for (auto i = 0; i < par->size(); ++i) {
+		Inset const *ip = par->getInset(0);
+		if (ip != nullptr && ip->lyxCode() == BIBITEM_CODE) {
+			const auto * bibitem = dynamic_cast<const InsetBibitem*>(par->getInset(i));
+			attr = from_utf8("xml:id='") + bibitem->getParam("key") + from_utf8("'");
+			break;
 		}
-		xs << xml::StartTag(from_utf8("bibliomixed"), attr);
+	}
+	xs << xml::StartTag(from_utf8("bibliomixed"), attr);
 
-		// Generate the entry.
-		par->simpleDocBookOnePar(buf, xs, runparams, text.outerFont(distance(begin, par)), true, true, 0);
+	// Generate the entry.
+	auto const begin = text.paragraphs().begin();
+	par->simpleDocBookOnePar(buf, xs, runparams, text.outerFont(std::distance(begin, par)), true, true, 0);
 
-		// End the precooked bibliography entry.
-		xs << xml::EndTag("bibliomixed");
-		xs << xml::CR();
-	}
+	// End the precooked bibliography entry.
+	xs << xml::EndTag("bibliomixed");
+	xs << xml::CR();
 
 	// If this is the last paragraph in a bibliography, close the bibliography tag.
-	if (par == end || par->layout().latextype != LATEX_BIB_ENVIRONMENT) {
+	auto const end = text.paragraphs().end();
+	bool endBibliography = par == end;
+	if (!endBibliography) {
+		auto nextpar = par;
+		++nextpar;
+		endBibliography = par->layout().latextype != LATEX_BIB_ENVIRONMENT;
+	}
+
+	if (endBibliography) {
 		xs << xml::EndTag("bibliography");
 		xs << xml::CR();
 	}
@@ -522,14 +518,6 @@ void makeParagraph(
 }
 
 
-void makeAny(
-		Text const &text,
-		Buffer const &buf,
-		XMLStream &xs,
-		OutputParams const &ourparams,
-		ParagraphList::const_iterator par);
-
-
 void makeEnvironment(
 		Buffer const &buf,
 		XMLStream &xs,

commit 1c864099d94251ae2b107a8c384de794f9155e38
Author: Thibaut Cuvelier <tcuvelier at lyx.org>
Date:   Tue Aug 18 05:40:34 2020 +0200

    DocBook: remove useless includes.

diff --git a/src/output_docbook.cpp b/src/output_docbook.cpp
index 12601c5..a1c3f94 100644
--- a/src/output_docbook.cpp
+++ b/src/output_docbook.cpp
@@ -9,15 +9,11 @@
  * Full author contact details are available in file CREDITS.
  */
 
-#include <config.h>
-
 #include "Buffer.h"
 #include "buffer_funcs.h"
 #include "BufferParams.h"
 #include "Font.h"
 #include "InsetList.h"
-#include "Layout.h"
-#include "OutputParams.h"
 #include "Paragraph.h"
 #include "ParagraphList.h"
 #include "ParagraphParameters.h"
@@ -30,11 +26,7 @@
 #include "insets/InsetLabel.h"
 #include "insets/InsetNote.h"
 
-#include "support/convert.h"
-#include "support/debug.h"
 #include "support/lassert.h"
-#include "support/lstrings.h"
-#include "support/textutils.h"
 
 #include "support/regex.h"
 
@@ -159,6 +151,7 @@ string fontToRole(xml::FontTypes type)
 	}
 }
 
+
 string fontToAttribute(xml::FontTypes type) {
 	// If there is a role (i.e. nonstandard use of a tag), output the attribute. Otherwise, the sheer tag is sufficient
 	// for the font.

commit d2c2ac52bc21cedf2cfc69d147968b5f5634e68e
Author: Thibaut Cuvelier <tcuvelier at lyx.org>
Date:   Tue Aug 18 05:39:46 2020 +0200

    More functions in anonymous namespace.

diff --git a/src/output_docbook.cpp b/src/output_docbook.cpp
index ad683c7..12601c5 100644
--- a/src/output_docbook.cpp
+++ b/src/output_docbook.cpp
@@ -170,8 +170,6 @@ string fontToAttribute(xml::FontTypes type) {
 	}
 }
 
-} // end anonymous namespace
-
 
 xml::FontTag docbookStartFontTag(xml::FontTypes type)
 {
@@ -185,8 +183,6 @@ xml::EndFontTag docbookEndFontTag(xml::FontTypes type)
 }
 
 
-namespace {
-
 // Convenience functions to open and close tags. First, very low-level ones to ensure a consistent new-line behaviour.
 // Block style:
 //	  Content before

commit f2af5a1a6b79f18584fc2fc06e05c2ffc59eddfe
Author: Thibaut Cuvelier <tcuvelier at lyx.org>
Date:   Tue Aug 18 05:37:46 2020 +0200

    DocBook: fine tuning of new lines.

diff --git a/src/Buffer.cpp b/src/Buffer.cpp
index 97a6cfb..0d3f4c1 100644
--- a/src/Buffer.cpp
+++ b/src/Buffer.cpp
@@ -2140,8 +2140,6 @@ Buffer::ExportStatus Buffer::writeDocBookSource(odocstream & os,
 	bool const output_body =
 	  output == FullSource || output == OnlyBody;
 
-	XMLStream xs(os);
-
 	if (output_preamble) {
 		// XML preamble, no doctype needed.
 		// Not using XMLStream for this, as the root tag would be in the tag stack and make troubles with the error
@@ -2164,16 +2162,17 @@ Buffer::ExportStatus Buffer::writeDocBookSource(odocstream & os,
 	}
 
 	if (output_body) {
-		params().documentClass().counters().reset();
-
 		// Start to output the document.
+		XMLStream xs(os);
 		docbookParagraphs(text(), *this, xs, runparams);
 	}
 
 	if (output_preamble) {
-		// Close the root element.
-		os << "\n</" << from_ascii(tclass.docbookroot()) << ">";
+		// Close the root element. No need for a line break, as free text is never allowed
+		// in a root element, it must always be wrapped in some container.
+		os << "</" << from_ascii(tclass.docbookroot()) << ">";
 	}
+
 	return ExportSuccess;
 }
 
diff --git a/src/output_docbook.cpp b/src/output_docbook.cpp
index b7b5941..ad683c7 100644
--- a/src/output_docbook.cpp
+++ b/src/output_docbook.cpp
@@ -239,7 +239,8 @@ void openBlockTag(XMLStream & xs, const std::string & tag, const std::string & a
 
 void closeBlockTag(XMLStream & xs, const std::string & tag)
 {
-	xs << xml::CR();
+	if (!xs.isLastTagCR())
+		xs << xml::CR();
 	xs << xml::EndTag(tag);
 	xs << xml::CR();
 }

commit e878ca5007f06ee48a02035502b5e67424525c75
Author: Thibaut Cuvelier <tcuvelier at lyx.org>
Date:   Tue Aug 18 04:56:25 2020 +0200

    DocBook: improve comments.

diff --git a/src/xml.h b/src/xml.h
index 2461eb1..b65e4e7 100644
--- a/src/xml.h
+++ b/src/xml.h
@@ -41,7 +41,7 @@ struct CR;
 class XMLStream {
 public:
 	///
-	explicit XMLStream(odocstream & os): os_(os), escape_(ESCAPE_ALL), is_last_tag_cr_(false) {}
+	explicit XMLStream(odocstream & os): os_(os), escape_(ESCAPE_ALL), is_last_tag_cr_(true) {}
 	///
 	odocstream & os() { return os_; }
 	///
@@ -84,7 +84,7 @@ public:
 	enum EscapeSettings {
 		ESCAPE_NONE,
 		ESCAPE_AND, // meaning &
-		ESCAPE_ALL, // meaning <, >, &, at present
+		ESCAPE_ALL, // meaning <, >, &, at present, except things that are forbidden in comments
 		ESCAPE_COMMENTS // Anything that is forbidden within comments
 	};
 	/// Sets what we are going to escape on the NEXT write.
@@ -100,7 +100,9 @@ public:
 	bool isTagOpen(xml::EndTag const &, int maxdepth = -1) const;
 	///
 	bool isTagPending(xml::StartTag const &, int maxdepth = -1) const;
-	///
+	/// Is the last tag that was added to the stream a new line (CR)? This is mostly to known
+	/// whether a new line must be added. Therefore, consider that an empty stream just had a CR,
+	/// that simplifies the logic using this code.
 	bool isLastTagCR() const { return is_last_tag_cr_; };
 	///
 	void writeError(std::string const &) const;

commit 3af0c7d9d2824ee8f8c2ac340048ac9786ccf506
Author: Thibaut Cuvelier <tcuvelier at lyx.org>
Date:   Tue Aug 18 00:37:34 2020 +0200

    DocBook: new logic to handle the new lines, only used in output_docbook for now.

diff --git a/lib/layouts/stdlayouts.inc b/lib/layouts/stdlayouts.inc
index 1670695..e550518 100644
--- a/lib/layouts/stdlayouts.inc
+++ b/lib/layouts/stdlayouts.inc
@@ -7,7 +7,7 @@
 # quotations and such.
 
 
-Format 82
+Format 84
 
 Style Quotation
 	Category              MainText
diff --git a/lib/layouts/stdlists.inc b/lib/layouts/stdlists.inc
index 16a9e81..c0b346d 100644
--- a/lib/layouts/stdlists.inc
+++ b/lib/layouts/stdlists.inc
@@ -6,7 +6,7 @@
 # This include files contains various standard environments for lists.
 
 
-Format 82
+Format 84
 
 Input stdlyxlist.inc
 
diff --git a/lib/layouts/stdstruct.inc b/lib/layouts/stdstruct.inc
index c8b7eb4..2a81117 100644
--- a/lib/layouts/stdstruct.inc
+++ b/lib/layouts/stdstruct.inc
@@ -8,7 +8,7 @@
 # a document, like abstract, bibliography and such.
 
 
-Format 82
+Format 84
 
 Style Abstract
 	Margin                Static
diff --git a/lib/layouts/stdtitle.inc b/lib/layouts/stdtitle.inc
index ad989a6..44b1b8e 100644
--- a/lib/layouts/stdtitle.inc
+++ b/lib/layouts/stdtitle.inc
@@ -8,7 +8,7 @@
 # a document, like title, author and such.
 
 
-Format 82
+Format 84
 
 Style Title
 	Margin                Static
@@ -29,6 +29,7 @@ Style Title
 	HTMLTag               h1
 	HTMLTitle             true
 	DocBookTag            title
+	DocBookTagType        paragraph
 	DocBookInInfo         maybe
 End
 
@@ -50,7 +51,9 @@ Style Author
 	  Size                Large
 	EndFont
 	DocBookTag            personname
+	DocBookTagType        paragraph
 	DocBookWrapperTag     author
+	DocBookWrapperTagType inline
 	DocBookInInfo         always
 End
 
@@ -72,5 +75,6 @@ Style Date
 	  Size                Large
 	EndFont
 	DocBookTag            date
+	DocBookTagType        paragraph
 	DocBookInInfo         always
 End
diff --git a/src/insets/InsetNewline.cpp b/src/insets/InsetNewline.cpp
index 00b276e..7cba0f7 100644
--- a/src/insets/InsetNewline.cpp
+++ b/src/insets/InsetNewline.cpp
@@ -181,7 +181,7 @@ void InsetNewline::docbook(XMLStream & xs, OutputParams const & runparams) const
 		// about the paragraph's layout... Good for now, though, this should not happen in DocBook, only maybe
 		// extensions.
 		xs << XMLStream::ESCAPE_NONE << from_utf8("<!-- Is para open? " + string((xs.isTagOpen(xml::StartTag("para"))) ? "yes" : "no") +" -->");
-		xs << XMLStream::ESCAPE_NONE << from_utf8("</para>\n<para");
+		xs << XMLStream::ESCAPE_NONE << from_utf8("</para>\n<para>");
 		// TODO: that's a hack...
 //		xs << xml::EndTag("para");
 //		xs << xml::CR();
diff --git a/src/output_docbook.cpp b/src/output_docbook.cpp
index b29da56..b7b5941 100644
--- a/src/output_docbook.cpp
+++ b/src/output_docbook.cpp
@@ -43,8 +43,6 @@
 #include <algorithm>
 #include <sstream>
 
-// #define DOCBOOK_DEBUG_NEWLINES
-
 using namespace std;
 using namespace lyx::support;
 
@@ -189,14 +187,100 @@ xml::EndFontTag docbookEndFontTag(xml::FontTypes type)
 
 namespace {
 
-// convenience functions
+// Convenience functions to open and close tags. First, very low-level ones to ensure a consistent new-line behaviour.
+// Block style:
+//	  Content before
+//	  <blocktag>
+//	    Contents of the block.
+//	  </blocktag>
+//	  Content after
+// Paragraph style:
+//	  Content before
+//	    <paratag>Contents of the paragraph.</paratag>
+//	  Content after
+// Inline style:
+//    Content before<inlinetag>Contents of the paragraph.</inlinetag>Content after
+
+void openInlineTag(XMLStream & xs, const std::string & tag, const std::string & attr)
+{
+	xs << xml::StartTag(tag, attr);
+}
+
 
-void openParTag(XMLStream & xs, const Paragraph * par, const Paragraph * prevpar)
+void closeInlineTag(XMLStream & xs, const std::string & tag)
+{
+	xs << xml::EndTag(tag);
+}
+
+
+void openParTag(XMLStream & xs, const std::string & tag, const std::string & attr)
+{
+	if (!xs.isLastTagCR())
+		xs << xml::CR();
+	xs << xml::StartTag(tag, attr);
+}
+
+
+void closeParTag(XMLStream & xs, const std::string & tag)
+{
+	xs << xml::EndTag(tag);
+	xs << xml::CR();
+}
+
+
+void openBlockTag(XMLStream & xs, const std::string & tag, const std::string & attr)
+{
+	if (!xs.isLastTagCR())
+		xs << xml::CR();
+	xs << xml::StartTag(tag, attr);
+	xs << xml::CR();
+}
+
+
+void closeBlockTag(XMLStream & xs, const std::string & tag)
+{
+	xs << xml::CR();
+	xs << xml::EndTag(tag);
+	xs << xml::CR();
+}
+
+
+void openTag(XMLStream & xs, const std::string & tag, const std::string & attr, const std::string & tagtype)
+{
+	if (tag.empty() || tag == "NONE")
+		return;
+
+	if (tag == "para" || tagtype == "paragraph") // Special case for <para>: always considered as a paragraph.
+		openParTag(xs, tag, attr);
+	else if (tagtype == "block")
+		openBlockTag(xs, tag, attr);
+	else if (tagtype == "inline")
+		openInlineTag(xs, tag, attr);
+	else
+		xs.writeError("Unrecognised tag type '" + tagtype + "' for '" + tag + " " + attr + "'");
+}
+
+
+void closeTag(XMLStream & xs, const std::string & tag, const std::string & tagtype)
 {
-#ifdef DOCBOOK_DEBUG_NEWLINES
-	xs << XMLStream::ESCAPE_NONE << "<!-- openParTag -->";
-#endif
+	if (tag.empty() || tag == "NONE")
+		return;
 
+	if (tag == "para" || tagtype == "paragraph") // Special case for <para>: always considered as a paragraph.
+		closeParTag(xs, tag);
+	else if (tagtype == "block")
+		closeBlockTag(xs, tag);
+	else if (tagtype == "inline")
+		closeInlineTag(xs, tag);
+	else
+		xs.writeError("Unrecognised tag type '" + tagtype + "' for '" + tag + "'");
+}
+
+
+// Higher-level convenience functions.
+
+void openParTag(XMLStream & xs, const Paragraph * par, const Paragraph * prevpar)
+{
 	Layout const & lay = par->layout();
 
 	if (par == prevpar)
@@ -218,38 +302,25 @@ void openParTag(XMLStream & xs, const Paragraph * par, const Paragraph * prevpar
 	}
 
 	// Main logic.
-	if (openWrapper) {
-		xs << xml::StartTag(lay.docbookwrappertag(), lay.docbookwrapperattr());
-		xs << xml::CR();
-	}
+	if (openWrapper)
+		openTag(xs, lay.docbookwrappertag(), lay.docbookwrapperattr(), lay.docbookwrappertagtype());
 
-	string tag = lay.docbooktag();
+	const string & tag = lay.docbooktag();
 	if (tag != "NONE") {
 		auto xmltag = xml::ParTag(tag, lay.docbookattr());
-		if (!xs.isTagOpen(xmltag, 1)) // Don't nest a paragraph directly in a paragraph. TODO: required or not?
-			xs << xmltag;
-	}
-
-	if (lay.docbookitemtag() != "NONE") {
-		xs << xml::StartTag(lay.docbookitemtag(), lay.docbookitemattr());
-		xs << xml::CR();
+		if (!xs.isTagOpen(xmltag, 1)) // Don't nest a paragraph directly in a paragraph.
+			// TODO: required or not?
+			// TODO: avoid creating a ParTag object just for this query...
+			openTag(xs, lay.docbooktag(), lay.docbookattr(), lay.docbooktagtype());
 	}
 
-	if (lay.docbookiteminnertag() != "NONE")
-		xs << xml::StartTag(lay.docbookiteminnertag(), lay.docbookiteminnerattr());
-
-#ifdef DOCBOOK_DEBUG_NEWLINES
-	xs << XMLStream::ESCAPE_NONE << "<!-- /openParTag -->";
-#endif
+	openTag(xs, lay.docbookitemtag(), lay.docbookitemattr(), lay.docbookitemtagtype());
+	openTag(xs, lay.docbookiteminnertag(), lay.docbookiteminnerattr(), lay.docbookiteminnertagtype());
 }
 
 
 void closeParTag(XMLStream & xs, Paragraph const * par, Paragraph const * nextpar)
 {
-#ifdef DOCBOOK_DEBUG_NEWLINES
-	xs << XMLStream::ESCAPE_NONE << "<!-- closeParTag -->";
-#endif
-
 	if (par == nextpar)
 		nextpar = nullptr;
 
@@ -265,119 +336,35 @@ void closeParTag(XMLStream & xs, Paragraph const * par, Paragraph const * nextpa
 	}
 
 	// Main logic.
-	if (lay.docbookiteminnertag() != "NONE") {
-		xs << xml::EndTag(lay.docbookiteminnertag());
-		xs << xml::CR();
-	}
-
-	if (lay.docbookitemtag() != "NONE") {
-		xs << xml::EndTag(lay.docbookitemtag());
-		xs << xml::CR();
-	}
-
-	if (lay.docbooktag() != "NONE") {
-		xs << xml::EndTag(lay.docbooktag());
-		xs << xml::CR();
-	}
-
-	if (closeWrapper) {
-		xs << xml::EndTag(lay.docbookwrappertag());
-		xs << xml::CR();
-	}
-
-#ifdef DOCBOOK_DEBUG_NEWLINES
-	xs << XMLStream::ESCAPE_NONE << "<!-- /closeParTag -->";
-#endif
-}
-
-
-void openBlockTag(XMLStream & xs, const Paragraph * par, const Paragraph * prevpar)
-{
-#ifdef DOCBOOK_DEBUG_NEWLINES
-	xs << XMLStream::ESCAPE_NONE << "<!-- openBlockTag -->";
-#endif
-
-	// Similar as openParTag, but with a line feed after.
-	openParTag(xs, par, prevpar);
-	xs << xml::CR();
-
-#ifdef DOCBOOK_DEBUG_NEWLINES
-	xs << XMLStream::ESCAPE_NONE << "<!-- /openBlockTag -->";
-#endif
-}
-
-
-void closeBlockTag(XMLStream & xs, const Paragraph * par, const Paragraph * prevpar)
-{
-#ifdef DOCBOOK_DEBUG_NEWLINES
-	xs << XMLStream::ESCAPE_NONE << "<!-- closeBlockTag -->";
-#endif
-
-	// Similar as closeParTag, but with a line feed before.
-	xs << xml::CR();
-	closeParTag(xs, par, prevpar);
-
-#ifdef DOCBOOK_DEBUG_NEWLINES
-	xs << XMLStream::ESCAPE_NONE << "<!-- /closeBlockTag -->";
-#endif
+	closeTag(xs, lay.docbookiteminnertag(), lay.docbookiteminnertagtype());
+	closeTag(xs, lay.docbookitemtag(), lay.docbookitemtagtype());
+	closeTag(xs, lay.docbooktag(), lay.docbooktagtype());
+	if (closeWrapper)
+		closeTag(xs, lay.docbookwrappertag(), lay.docbookwrappertagtype());
 }
 
 
 void openLabelTag(XMLStream & xs, Layout const & lay) // Mostly for definition lists.
 {
-#ifdef DOCBOOK_DEBUG_NEWLINES
-	xs << XMLStream::ESCAPE_NONE << "<!-- openLabelTag -->";
-#endif
-
-	xs << xml::StartTag(lay.docbookitemlabeltag(), lay.docbookitemlabelattr());
-
-#ifdef DOCBOOK_DEBUG_NEWLINES
-	xs << XMLStream::ESCAPE_NONE << "<!-- /openLabelTag -->";
-#endif
+	openTag(xs, lay.docbookitemlabeltag(), lay.docbookitemlabelattr(), lay.docbookitemlabeltagtype());
 }
 
 
 void closeLabelTag(XMLStream & xs, Layout const & lay)
 {
-#ifdef DOCBOOK_DEBUG_NEWLINES
-	xs << XMLStream::ESCAPE_NONE << "<!-- closeLabelTag -->";
-#endif
-
-	xs << xml::EndTag(lay.docbookitemlabeltag());
-	xs << xml::CR();
-
-#ifdef DOCBOOK_DEBUG_NEWLINES
-	xs << XMLStream::ESCAPE_NONE << "<!-- closeLabelTag -->";
-#endif
+	closeTag(xs, lay.docbookitemlabeltag(), lay.docbookitemlabeltagtype());
 }
 
 
 void openItemTag(XMLStream & xs, Layout const & lay)
 {
-#ifdef DOCBOOK_DEBUG_NEWLINES
-	xs << XMLStream::ESCAPE_NONE << "<!-- openItemTag -->";
-#endif
-
-	xs << xml::StartTag(lay.docbookitemtag(), lay.docbookitemattr());
-
-#ifdef DOCBOOK_DEBUG_NEWLINES
-	xs << XMLStream::ESCAPE_NONE << "<!-- /openItemTag -->";
-#endif
+	openTag(xs, lay.docbookitemtag(), lay.docbookitemattr(), lay.docbookitemtagtype());
 }
 
 
 void closeItemTag(XMLStream & xs, Layout const & lay)
 {
-#ifdef DOCBOOK_DEBUG_NEWLINES
-	xs << XMLStream::ESCAPE_NONE << "<!-- closeItemTag -->";
-#endif
-
-	xs << xml::EndTag(lay.docbookitemtag());
-	xs << xml::CR();
-
-#ifdef DOCBOOK_DEBUG_NEWLINES
-	xs << XMLStream::ESCAPE_NONE << "<!-- /closeItemTag -->";
-#endif
+	closeTag(xs, lay.docbookitemtag(), lay.docbookitemtagtype());
 }
 
 
diff --git a/src/xml.h b/src/xml.h
index 8248102..2461eb1 100644
--- a/src/xml.h
+++ b/src/xml.h
@@ -102,13 +102,13 @@ public:
 	bool isTagPending(xml::StartTag const &, int maxdepth = -1) const;
 	///
 	bool isLastTagCR() const { return is_last_tag_cr_; };
-private:
-	///
-	void clearTagDeque();
 	///
 	void writeError(std::string const &) const;
 	///
 	void writeError(docstring const &) const;
+private:
+	///
+	void clearTagDeque();
 	///
 	odocstream & os_;
 	///

commit 68a8b750b28fd77eda4d542a325654e5f607e6bc
Author: Thibaut Cuvelier <tcuvelier at lyx.org>
Date:   Mon Aug 17 23:44:02 2020 +0200

    XML: memorise if the last thing that is getting output is a line feed.

diff --git a/src/xml.cpp b/src/xml.cpp
index 147eadd..b4004af 100644
--- a/src/xml.cpp
+++ b/src/xml.cpp
@@ -290,6 +290,7 @@ void XMLStream::clearTagDeque()
 
 XMLStream &XMLStream::operator<<(docstring const &d)
 {
+	is_last_tag_cr_ = false;
 	clearTagDeque();
 	os_ << xml::escapeString(d, escape_);
 	escape_ = ESCAPE_ALL;
@@ -299,6 +300,7 @@ XMLStream &XMLStream::operator<<(docstring const &d)
 
 XMLStream &XMLStream::operator<<(const char *s)
 {
+	is_last_tag_cr_ = false;
 	clearTagDeque();
 	docstring const d = from_ascii(s);
 	os_ << xml::escapeString(d, escape_);
@@ -309,6 +311,7 @@ XMLStream &XMLStream::operator<<(const char *s)
 
 XMLStream &XMLStream::operator<<(char_type c)
 {
+	is_last_tag_cr_ = false;
 	clearTagDeque();
 	os_ << xml::escapeChar(c, escape_);
 	escape_ = ESCAPE_ALL;
@@ -318,6 +321,7 @@ XMLStream &XMLStream::operator<<(char_type c)
 
 XMLStream &XMLStream::operator<<(char c)
 {
+	is_last_tag_cr_ = false;
 	clearTagDeque();
 	os_ << xml::escapeChar(c, escape_);
 	escape_ = ESCAPE_ALL;
@@ -327,6 +331,7 @@ XMLStream &XMLStream::operator<<(char c)
 
 XMLStream &XMLStream::operator<<(int i)
 {
+	is_last_tag_cr_ = false;
 	clearTagDeque();
 	os_ << i;
 	escape_ = ESCAPE_ALL;
@@ -336,6 +341,7 @@ XMLStream &XMLStream::operator<<(int i)
 
 XMLStream &XMLStream::operator<<(EscapeSettings e)
 {
+	// Don't update is_last_tag_cr_ here, as this does not output anything.
 	escape_ = e;
 	return *this;
 }
@@ -343,6 +349,7 @@ XMLStream &XMLStream::operator<<(EscapeSettings e)
 
 XMLStream &XMLStream::operator<<(xml::StartTag const &tag)
 {
+	is_last_tag_cr_ = false;
 	if (tag.tag_.empty())
 		return *this;
 	pending_tags_.push_back(makeTagPtr(tag));
@@ -354,6 +361,7 @@ XMLStream &XMLStream::operator<<(xml::StartTag const &tag)
 
 XMLStream &XMLStream::operator<<(xml::ParTag const &tag)
 {
+	is_last_tag_cr_ = false;
 	if (tag.tag_.empty())
 		return *this;
 	pending_tags_.push_back(makeTagPtr(tag));
@@ -363,6 +371,7 @@ XMLStream &XMLStream::operator<<(xml::ParTag const &tag)
 
 XMLStream &XMLStream::operator<<(xml::CompTag const &tag)
 {
+	is_last_tag_cr_ = false;
 	if (tag.tag_.empty())
 		return *this;
 	clearTagDeque();
@@ -373,6 +382,7 @@ XMLStream &XMLStream::operator<<(xml::CompTag const &tag)
 
 XMLStream &XMLStream::operator<<(xml::FontTag const &tag)
 {
+	is_last_tag_cr_ = false;
 	if (tag.tag_.empty())
 		return *this;
 	pending_tags_.push_back(makeTagPtr(tag));
@@ -382,6 +392,7 @@ XMLStream &XMLStream::operator<<(xml::FontTag const &tag)
 
 XMLStream &XMLStream::operator<<(xml::CR const &)
 {
+	is_last_tag_cr_ = true;
 	clearTagDeque();
 	os_ << from_ascii("\n");
 	return *this;
@@ -434,6 +445,8 @@ bool XMLStream::isTagPending(xml::StartTag const &stag, int maxdepth) const
 // best to make things work.
 XMLStream &XMLStream::operator<<(xml::EndTag const &etag)
 {
+	is_last_tag_cr_ = false;
+
 	if (etag.tag_.empty())
 		return *this;
 
diff --git a/src/xml.h b/src/xml.h
index e63623c..8248102 100644
--- a/src/xml.h
+++ b/src/xml.h
@@ -41,7 +41,7 @@ struct CR;
 class XMLStream {
 public:
 	///
-	explicit XMLStream(odocstream & os): os_(os), escape_(ESCAPE_ALL) {}
+	explicit XMLStream(odocstream & os): os_(os), escape_(ESCAPE_ALL), is_last_tag_cr_(false) {}
 	///
 	odocstream & os() { return os_; }
 	///
@@ -100,6 +100,8 @@ public:
 	bool isTagOpen(xml::EndTag const &, int maxdepth = -1) const;
 	///
 	bool isTagPending(xml::StartTag const &, int maxdepth = -1) const;
+	///
+	bool isLastTagCR() const { return is_last_tag_cr_; };
 private:
 	///
 	void clearTagDeque();
@@ -128,6 +130,8 @@ private:
 	TagDeque pending_tags_;
 	///
 	TagDeque tag_stack_;
+	///
+	bool is_last_tag_cr_;
 public:
 	bool pending_tags_empty() { return pending_tags_.empty();};
 };

commit 0c464680ee879d867fb140c77a06f40587fd139d
Author: Thibaut Cuvelier <tcuvelier at lyx.org>
Date:   Mon Aug 17 23:35:40 2020 +0200

    DocBook: documentation for the new tags.

diff --git a/lib/doc/Customization.lyx b/lib/doc/Customization.lyx
index 5992b7f..1cc04b5 100644
--- a/lib/doc/Customization.lyx
+++ b/lib/doc/Customization.lyx
@@ -1,5 +1,5 @@
 #LyX 2.4 created this file. For more info see https://www.lyx.org/
-\lyxformat 596
+\lyxformat 598
 \begin_document
 \begin_header
 \save_transient_properties true
@@ -135,6 +135,7 @@ logicalmkup
 \html_math_output 0
 \html_css_as_file 0
 \html_be_strict true
+\docbook_table_output 0
 \author -970929547 "Thibaut Cuvelier"
 \author -712698321 "Jürgen Spitzmüller"
 \author -495245474 "Jean-Marc Lasgouttes"
@@ -2521,6 +2522,8 @@ status open
 
 \change_inserted -712698321 1524657030
 flavor
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -2534,6 +2537,8 @@ status collapsed
 
 \change_inserted -712698321 1524657047
 .aux
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -2546,6 +2551,8 @@ status open
 
 \change_inserted -712698321 1524657030
 latex, pdflatex, platex, xetex, luatex
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -2559,6 +2566,8 @@ status open
 
 \change_inserted -712698321 1524657030
 latex
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -2650,6 +2659,8 @@ status collapsed
 
 \change_inserted -712698321 1523206193
 hyperref-driver
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -9005,6 +9016,8 @@ status collapsed
 
 \change_inserted -712698321 1526898610
 AddToCiteEngine <engine>
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -9140,6 +9153,8 @@ status collapsed
 
 \change_inserted -712698321 1562592954
 BibInToc
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -9154,6 +9169,8 @@ status collapsed
 
 \emph on
 0
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -9170,6 +9187,8 @@ status collapsed
 
 \change_inserted -712698321 1562592950
 1
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -9664,6 +9683,8 @@ status collapsed
 
 \change_inserted -970929547 1515112782
 DocBookRoot
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -9676,6 +9697,8 @@ status collapsed
 
 \change_inserted -970929547 1515112766
 string
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -9694,6 +9717,8 @@ status collapsed
 
 \change_inserted -970929547 1515112845
 article
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -9720,6 +9745,8 @@ status collapsed
 
 \change_inserted 1075283030 1594226785
 DocBookForceAbstract
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -9732,6 +9759,8 @@ status collapsed
 
 \change_inserted 1075283030 1594226804
 boolean
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -10658,6 +10687,8 @@ status collapsed
 
 \change_inserted -712698321 1565102365
 PageSize
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -10675,6 +10706,8 @@ custom
 \emph default
 , letter, legal, executive, a0, a1, a2, a3, a4, a5, a6, b0, b1, b2, b3,
  b4, b5, b6, c0, c1, c2, c3, c4, c5, c6, b0j, b1j, b2j, b3j, b4j, b5j, b6j
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -11276,6 +11309,8 @@ status collapsed
 
 \change_inserted -712698321 1553617809
 TableStyle
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -11288,6 +11323,8 @@ status collapsed
 
 \change_inserted -712698321 1553617805
 <name>
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -11336,6 +11373,8 @@ status collapsed
 
 \change_inserted -712698321 1554308042
 Formal_without_Footline
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -11354,6 +11393,8 @@ status collapsed
 
 \change_inserted -712698321 1553618006
 Simple_Grid
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -11371,6 +11412,8 @@ status collapsed
 
 \change_inserted -712698321 1553618031
 Grid_with_Head
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -11383,6 +11426,8 @@ status collapsed
 
 \change_inserted -712698321 1553618043
 Simple_Grid
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -11402,6 +11447,8 @@ status collapsed
 
 \change_inserted -712698321 1553618261
 No_Borders
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -11690,6 +11737,8 @@ status collapsed
 
 \change_inserted -712698321 1565110199
 FontSizeFormat
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -11702,6 +11751,8 @@ status collapsed
 
 \change_inserted -712698321 1565110196
 string
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -11730,6 +11781,8 @@ status collapsed
 
 \change_inserted -712698321 1565110248
 $$s
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -11779,6 +11832,8 @@ status collapsed
 
 \change_inserted -712698321 1565101918
 PageSize
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -11822,6 +11877,8 @@ b3j|\SpecialChar allowbreak
 b4j|\SpecialChar allowbreak
 b5j|\SpecialChar allowbreak
 b6j"
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -11838,6 +11895,8 @@ status collapsed
 
 \change_inserted -712698321 1565101779
 |
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -11861,6 +11920,8 @@ status collapsed
 
 \change_inserted -712698321 1565180605
 PageSizeFormat
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -11873,6 +11934,8 @@ status collapsed
 
 \change_inserted -712698321 1565180601
 string
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -11886,6 +11949,8 @@ status collapsed
 
 \change_inserted -712698321 1565180618
 $$spaper
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -11899,6 +11964,8 @@ status collapsed
 
 \change_inserted -712698321 1565180601
 $$s
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -12479,6 +12546,8 @@ status collapsed
 
 \change_inserted -712698321 1555579780
 NewlineCmd
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -12491,6 +12560,8 @@ status collapsed
 
 \change_inserted -712698321 1555579780
 [string]
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -12507,6 +12578,8 @@ status collapsed
 
 \backslash
 
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -12780,6 +12853,8 @@ status collapsed
 
 \change_inserted -712698321 1559484228
 FreeSpacing
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -12794,6 +12869,8 @@ status collapsed
 
 \emph on
 0
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -12810,6 +12887,8 @@ status collapsed
 
 \change_inserted -712698321 1559484228
 1
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -12922,6 +13001,8 @@ status collapsed
 
 \change_inserted -712698321 1559490711
 InsertOnNewline
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -12934,6 +13015,8 @@ status collapsed
 
 \change_inserted -712698321 1559490703
 [int=0]
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -12946,6 +13029,8 @@ status collapsed
 
 \change_inserted -712698321 1559490703
 1
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -12958,6 +13043,8 @@ status collapsed
 
 \change_inserted -712698321 1559491402
 AutoInsert
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -13278,6 +13365,8 @@ status collapsed
 
 \change_inserted -712698321 1534488412
 Argument listpreamble:1
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -13925,6 +14014,8 @@ status collapsed
 
 \change_inserted -495245474 1550490089
 Passthru 1
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -13943,6 +14034,8 @@ status collapsed
 
 \change_inserted -495245474 1550247736
 FreeSpacing
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -13955,6 +14048,8 @@ status collapsed
 
 \change_inserted -495245474 1550247755
 KeepEmpty
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -15934,6 +16029,8 @@ status collapsed
 
 \change_inserted -712698321 1523696950
 NeedCProtect
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -15948,6 +16045,8 @@ status collapsed
 
 \emph on
 0
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -15964,6 +16063,8 @@ status collapsed
 
 \change_inserted -712698321 1523696950
 1
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -15978,6 +16079,8 @@ status collapsed
 
 \backslash
 cprotect
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -16000,6 +16103,8 @@ status collapsed
 
 \change_inserted -712698321 1552395561
 NeedMBoxProtect
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -16014,6 +16119,8 @@ status collapsed
 
 \emph on
 0
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -16030,6 +16137,8 @@ status collapsed
 
 \change_inserted -712698321 1552395557
 1
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -18564,6 +18673,8 @@ status collapsed
 
 \change_inserted -712698321 1565605014
 Requires
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -18576,6 +18687,8 @@ status collapsed
 
 \change_inserted -712698321 1565605014
 string
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -20955,6 +21068,8 @@ status collapsed
 
 \change_inserted -712698321 1555575740
 MenuString
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -20967,6 +21082,8 @@ status collapsed
 
 \change_inserted -712698321 1555575740
 [string]
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -21001,6 +21118,8 @@ status collapsed
 
 \change_inserted -712698321 1555575781
 My Inset|M
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -21161,6 +21280,8 @@ status collapsed
 
 \change_inserted -712698321 1523633961
 NeedCProtect
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -21175,6 +21296,8 @@ status collapsed
 
 \emph on
 0
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -21191,6 +21314,8 @@ status collapsed
 
 \change_inserted -712698321 1523633958
 1
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -21230,6 +21355,8 @@ status collapsed
 
 \change_inserted -712698321 1552395787
 NeedMBoxProtect
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -21244,6 +21371,8 @@ status collapsed
 
 \emph on
 0
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -21260,6 +21389,8 @@ status collapsed
 
 \change_inserted -712698321 1552395787
 1
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -21274,6 +21405,8 @@ status collapsed
 
 \backslash
 cite
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -21288,6 +21421,8 @@ status collapsed
 
 \backslash
 ref
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -21302,6 +21437,8 @@ status collapsed
 
 \backslash
 mbox
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -21329,6 +21466,8 @@ status collapsed
 
 \change_inserted -712698321 1555579658
 NewlineCmd
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -21341,6 +21480,8 @@ status collapsed
 
 \change_inserted -712698321 1555579651
 [string]
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -21468,6 +21609,8 @@ status collapsed
 
 \change_inserted -712698321 1559491854
 ParbreakIgnored
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -21482,6 +21625,8 @@ status collapsed
 
 \emph on
 0
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -21498,6 +21643,8 @@ status collapsed
 
 \change_inserted -712698321 1559491850
 1
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -26929,13 +27076,24 @@ Labels are rarely output, as they are redundant in DocBook: this information
 
 \begin_layout Subsection
 
-\change_inserted -970929547 1496610966
+\change_inserted 1075283030 1597699417
+\begin_inset CommandInset label
+LatexCommand label
+name "subsec:Paragraph-Style-DocBook"
+
+\end_inset
+
+
+\change_deleted 1075283030 1597699417
+
 \begin_inset CommandInset label
 LatexCommand label
 name "subsec:Paragraph-Style-XHTML-1"
 
 \end_inset
 
+
+\change_inserted -970929547 1496610966
 Paragraph styles
 \end_layout
 
@@ -26954,6 +27112,8 @@ status collapsed
 \change_inserted -970929547 1496610966
 \SpecialChar LaTeX
 Type
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -27068,6 +27228,8 @@ status collapsed
 
 \change_inserted -970929547 1515109656
 DocBookAttr
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -27080,6 +27242,8 @@ status collapsed
 
 \change_inserted -970929547 1496610966
 string
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -27097,6 +27261,8 @@ status collapsed
 
 \change_inserted -970929547 1515110057
 attr
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -27122,6 +27288,8 @@ status collapsed
 
 \change_inserted -970929547 1496612269
 DocBookTag
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -27134,6 +27302,8 @@ status collapsed
 
 \change_inserted -970929547 1496610966
 string
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -27150,6 +27320,8 @@ status collapsed
 
 \change_inserted -970929547 1496612296
 tag
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -27161,6 +27333,252 @@ tag
  in the example above.
  The default is the name of the float and always needs to be changed, as
  DocBook provides no generic tag.
+\change_inserted 1075283030 1597698868
+
+\end_layout
+
+\begin_layout Description
+
+\change_inserted 1075283030 1597699399
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted 1075283030 1597698872
+DocBookTagType
+\end_layout
+
+\end_inset
+
+ [
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted 1075283030 1597700585
+block, paragraph, inline
+\change_unchanged
+
+\end_layout
+
+\end_inset
+
+] The new-line policy for this tag, see Section
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "subsec:DocBook-New-line-policy"
+plural "false"
+caps "false"
+noprefix "false"
+
+\end_inset
+
+ for the details.
+ 
+\change_unchanged
+
+\end_layout
+
+\begin_layout Subsection
+
+\change_inserted 1075283030 1597699385
+New-line policy
+\begin_inset CommandInset label
+LatexCommand label
+name "subsec:DocBook-New-line-policy"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1075283030 1597698993
+For all tags, there are three possible policies for outputting new lines
+ (given in the 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted 1075283030 1597698987
+DocBook*TagType
+\end_layout
+
+\end_inset
+
+ attribute): 
+\end_layout
+
+\begin_layout Itemize
+
+\change_inserted 1075283030 1597699279
+\begin_inset Quotes eld
+\end_inset
+
+
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted 1075283030 1597699012
+block
+\end_layout
+
+\end_inset
+
+
+\begin_inset Quotes erd
+\end_inset
+
+: the opening and closing tags are on their own lines (i.e.
+ a line feed after and before the opening and the closing tags).
+ Typical elements are floats.
+ For instance: 
+\end_layout
+
+\begin_layout LyX-Code
+
+\change_inserted 1075283030 1597699194
+Content before
+\end_layout
+
+\begin_layout LyX-Code
+
+\change_inserted 1075283030 1597699194
+<blocktag>
+\end_layout
+
+\begin_layout LyX-Code
+
+\change_inserted 1075283030 1597699098
+  Contents of the block.
+\end_layout
+
+\begin_layout LyX-Code
+
+\change_inserted 1075283030 1597699196
+</blocktag>
+\end_layout
+
+\begin_layout LyX-Code
+
+\change_inserted 1075283030 1597699198
+Content after
+\end_layout
+
+\begin_layout Itemize
+
+\change_inserted 1075283030 1597699289
+\begin_inset Quotes eld
+\end_inset
+
+
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted 1075283030 1597699113
+paragraph
+\end_layout
+
+\end_inset
+
+
+\begin_inset Quotes erd
+\end_inset
+
+: the opening and closing tags are on the same, new line; a line feed is
+ output before the opening tag and after the closing tag.
+ Typical elements are paragraphs and list items.
+ For instance: 
+\end_layout
+
+\begin_layout LyX-Code
+
+\change_inserted 1075283030 1597699186
+Content before
+\end_layout
+
+\begin_layout LyX-Code
+
+\change_inserted 1075283030 1597699357
+<paratag>Contents of the paragraph.</paratag>
+\end_layout
+
+\begin_layout LyX-Code
+
+\change_inserted 1075283030 1597699231
+Content after
+\end_layout
+
+\begin_layout Itemize
+
+\change_inserted 1075283030 1597699343
+\begin_inset Quotes eld
+\end_inset
+
+
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted 1075283030 1597699307
+inline
+\end_layout
+
+\end_inset
+
+
+\begin_inset Quotes erd
+\end_inset
+
+: the opening and closing tags are on the same line as the rest of the content.
+ No line feeds are output.
+ Typical elements are fonts.
+ For instance: 
+\end_layout
+
+\begin_layout LyX-Code
+
+\change_inserted 1075283030 1597699585
+Content before<inlinetag>Contents of the paragraph.</inlinetag>Content after
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1075283030 1597699585
+The default value is always 
+\begin_inset Quotes eld
+\end_inset
+
+
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted 1075283030 1597699585
+block
+\end_layout
+
+\end_inset
+
+
+\begin_inset Quotes erd
+\end_inset
+
+.
 \change_unchanged
 
 \end_layout
@@ -27428,6 +27846,8 @@ status collapsed
 
 \change_inserted -970929547 1496610966
 MultiPar
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -27455,6 +27875,8 @@ status collapsed
 
 \change_inserted -970929547 1515109695
 DocBookAttr
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -27467,6 +27889,8 @@ status collapsed
 
 \change_inserted -970929547 1496611854
 string
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -27484,6 +27908,8 @@ status collapsed
 
 \change_inserted -970929547 1515110044
 attr
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -27507,6 +27933,8 @@ status collapsed
 
 \change_inserted -970929547 1515110319
 DocBookInInfo
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -27519,6 +27947,8 @@ status collapsed
 
 \change_inserted -970929547 1515110384
 never, always, maybe
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -27531,6 +27961,8 @@ status collapsed
 
 \change_inserted -970929547 1515110412
 <info>
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -27544,6 +27976,8 @@ status collapsed
 
 \change_inserted -970929547 1515110437
 never
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -27556,6 +27990,8 @@ status collapsed
 
 \change_inserted -970929547 1515110497
 <info>
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -27569,6 +28005,8 @@ status collapsed
 
 \change_inserted -970929547 1515110517
 always
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -27581,6 +28019,8 @@ status collapsed
 
 \change_inserted -970929547 1515110514
 <info>
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -27593,6 +28033,8 @@ status collapsed
 
 \change_inserted -970929547 1515110550
 <info>
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -27610,6 +28052,8 @@ status collapsed
 
 \change_inserted -970929547 1515110540
 maybe
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -27622,6 +28066,8 @@ status collapsed
 
 \change_inserted -970929547 1515110538
 <info>
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -27634,6 +28080,8 @@ status collapsed
 
 \change_inserted -970929547 1515110585
 <info>
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -27656,6 +28104,8 @@ status collapsed
 
 \change_inserted -970929547 1515110974
 DocBookItemAttr
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -27668,6 +28118,8 @@ status collapsed
 
 \change_inserted -970929547 1515110973
 string
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -27685,6 +28137,8 @@ status collapsed
 
 \change_inserted -970929547 1515110984
 itemattr
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -27708,6 +28162,8 @@ status collapsed
 
 \change_inserted -970929547 1515111465
 DocBookItemInnerAttr
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -27720,6 +28176,8 @@ status collapsed
 
 \change_inserted -970929547 1515111461
 string
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -27737,6 +28195,8 @@ status collapsed
 
 \change_inserted -970929547 1515111476
 iteminnerattr
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -27760,6 +28220,8 @@ status collapsed
 
 \change_inserted -970929547 1515111467
 DocBookItemInnerTag
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -27772,6 +28234,8 @@ status collapsed
 
 \change_inserted -970929547 1515111461
 string
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -27789,6 +28253,8 @@ status collapsed
 
 \change_inserted -970929547 1515111486
 iteminnertag
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -27806,6 +28272,8 @@ status collapsed
 
 \change_inserted -970929547 1515111461
 NONE
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -27815,6 +28283,52 @@ NONE
  This parameter only makes sense when itemising layouts are used, such as
  lists.
  
+\change_inserted 1075283030 1597699848
+
+\end_layout
+
+\begin_layout Description
+
+\change_inserted 1075283030 1597699866
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted 1075283030 1597699853
+DocBookItemInnerTagType
+\end_layout
+
+\end_inset
+
+ [
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted 1075283030 1597699866
+block, paragraph, inline
+\end_layout
+
+\end_inset
+
+] The new-line policy for this tag, see Section
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "subsec:DocBook-New-line-policy"
+plural "false"
+caps "false"
+noprefix "false"
+
+\end_inset
+
+ for the details.
+ 
 \change_unchanged
 
 \end_layout
@@ -27829,6 +28343,8 @@ status collapsed
 
 \change_inserted -970929547 1515111283
 DocBookItemLabelAttr
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -27841,6 +28357,8 @@ status collapsed
 
 \change_inserted -970929547 1515111279
 string
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -27858,6 +28376,8 @@ status collapsed
 
 \change_inserted -970929547 1515111304
 itemlabelattr
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -27881,6 +28401,8 @@ status collapsed
 
 \change_inserted -970929547 1515111285
 DocBookItemLabelTag
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -27893,6 +28415,8 @@ status collapsed
 
 \change_inserted -970929547 1515111279
 string
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -27910,6 +28434,8 @@ status collapsed
 
 \change_inserted -970929547 1515111311
 itemlabeltag
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -27922,6 +28448,52 @@ itemlabeltag
  This parameter only makes sense when itemising layouts are used with a
  notion of labels, such as definition lists.
  
+\change_inserted 1075283030 1597699874
+
+\end_layout
+
+\begin_layout Description
+
+\change_inserted 1075283030 1597699874
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted 1075283030 1597699880
+DocBookItemLabelTagType
+\end_layout
+
+\end_inset
+
+ [
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted 1075283030 1597699874
+block, paragraph, inline
+\end_layout
+
+\end_inset
+
+] The new-line policy for this tag, see Section
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "subsec:DocBook-New-line-policy"
+plural "false"
+caps "false"
+noprefix "false"
+
+\end_inset
+
+ for the details.
+ 
 \change_unchanged
 
 \end_layout
@@ -27936,6 +28508,8 @@ status collapsed
 
 \change_inserted -970929547 1515111060
 DocBookItemTag
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -27948,6 +28522,8 @@ status collapsed
 
 \change_inserted -970929547 1515111060
 string
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -27964,6 +28540,8 @@ status collapsed
 
 \change_inserted -970929547 1515111060
 itemtag
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -27981,6 +28559,8 @@ status collapsed
 
 \change_inserted -970929547 1515111060
 NONE
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -27989,6 +28569,54 @@ NONE
  This parameter only makes sense when itemising layouts are used, such as
  lists.
  
+\change_inserted 1075283030 1597699890
+
+\end_layout
+
+\begin_layout Description
+
+\change_inserted 1075283030 1597699890
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted 1075283030 1597699890
+DocBookItemTagType
+\end_layout
+
+\end_inset
+
+ [
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted 1075283030 1597699890
+block, paragraph, inline
+\end_layout
+
+\end_inset
+
+] The new-line policy for this tag, see Section
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "subsec:DocBook-New-line-policy"
+plural "false"
+caps "false"
+noprefix "false"
+
+\end_inset
+
+ for the details.
+ 
+\change_unchanged
+
 \end_layout
 
 \begin_layout Description
@@ -28001,6 +28629,8 @@ status collapsed
 
 \change_inserted -970929547 1515111124
 DocBookItemWrapperAttr
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -28013,6 +28643,8 @@ status collapsed
 
 \change_inserted -970929547 1515111124
 string
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -28030,6 +28662,8 @@ status collapsed
 
 \change_inserted -970929547 1515111150
 itemwrapperattr
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -28055,6 +28689,8 @@ status collapsed
 
 \change_inserted -970929547 1515111073
 DocBookItemWrapperTag
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -28067,6 +28703,8 @@ status collapsed
 
 \change_inserted -970929547 1515111073
 string
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -28084,6 +28722,8 @@ status collapsed
 
 \change_inserted -970929547 1515111083
 itemwrappertag
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -28101,6 +28741,8 @@ status collapsed
 
 \change_inserted -970929547 1515111073
 NONE
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -28110,6 +28752,52 @@ NONE
  This parameter only makes sense when itemising layouts are used, such as
  lists.
  
+\change_inserted 1075283030 1597699897
+
+\end_layout
+
+\begin_layout Description
+
+\change_inserted 1075283030 1597699897
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted 1075283030 1597699900
+DocBookItemWrapperTagType
+\end_layout
+
+\end_inset
+
+ [
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted 1075283030 1597699897
+block, paragraph, inline
+\end_layout
+
+\end_inset
+
+] The new-line policy for this tag, see Section
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "subsec:DocBook-New-line-policy"
+plural "false"
+caps "false"
+noprefix "false"
+
+\end_inset
+
+ for the details.
+ 
 \change_unchanged
 
 \end_layout
@@ -28124,6 +28812,8 @@ status collapsed
 
 \change_inserted -970929547 1515110104
 DocBookInnerAttr
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -28136,6 +28826,8 @@ status collapsed
 
 \change_inserted -970929547 1515110104
 string
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -28153,6 +28845,8 @@ status collapsed
 
 \change_inserted -970929547 1515110104
 innerattr
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -28176,6 +28870,8 @@ status collapsed
 
 \change_inserted -970929547 1515110104
 DocBookInnerTag
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -28188,6 +28884,8 @@ status collapsed
 
 \change_inserted -970929547 1515110104
 string
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -28204,6 +28902,8 @@ status collapsed
 
 \change_inserted -970929547 1515110104
 innertag
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -28221,12 +28921,62 @@ status collapsed
 
 \change_inserted -970929547 1515110791
 NONE
+\change_unchanged
+
 \end_layout
 
 \end_inset
 
 , indicating that there is no inner tag: content is directly output without
  it.
+\change_inserted 1075283030 1597699904
+
+\end_layout
+
+\begin_layout Description
+
+\change_inserted 1075283030 1597699904
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted 1075283030 1597699904
+DocBookInnerTagType
+\end_layout
+
+\end_inset
+
+ [
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted 1075283030 1597699904
+block, paragraph, inline
+\end_layout
+
+\end_inset
+
+] The new-line policy for this tag, see Section
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "subsec:DocBook-New-line-policy"
+plural "false"
+caps "false"
+noprefix "false"
+
+\end_inset
+
+ for the details.
+ 
+\change_unchanged
+
 \end_layout
 
 \begin_layout Description
@@ -28239,6 +28989,8 @@ status collapsed
 
 \change_inserted -970929547 1515110665
 DocBookSectionTag
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -28251,6 +29003,8 @@ status collapsed
 
 \change_inserted -970929547 1515110661
 string
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -28266,12 +29020,18 @@ status collapsed
 
 \change_inserted -970929547 1515110721
 section
+\change_unchanged
+
 \end_layout
 
 \end_inset
 
 , and is only overridden when DocBook uses something else for sectioning
- (parts and chapters of a book).
+ (
+\change_inserted 1075283030 1597699921
+typically, 
+\change_inserted -970929547 1515110753
+parts and chapters of a book).
  
 \change_unchanged
 
@@ -28287,6 +29047,8 @@ status collapsed
 
 \change_inserted -970929547 1496612023
 DocBookTag
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -28299,6 +29061,8 @@ status collapsed
 
 \change_inserted -970929547 1496610966
 string
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -28315,6 +29079,8 @@ status collapsed
 
 \change_inserted -970929547 1496612033
 tag
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -28326,6 +29092,54 @@ tag
  in the example above.
  The default is the name of the float and always needs to be changed, as
  DocBook provides no generic inset tag.
+\change_inserted 1075283030 1597699924
+
+\end_layout
+
+\begin_layout Description
+
+\change_inserted 1075283030 1597699924
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted 1075283030 1597699924
+DocBookTagType
+\end_layout
+
+\end_inset
+
+ [
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted 1075283030 1597699924
+block, paragraph, inline
+\end_layout
+
+\end_inset
+
+] The new-line policy for this tag, see Section
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "subsec:DocBook-New-line-policy"
+plural "false"
+caps "false"
+noprefix "false"
+
+\end_inset
+
+ for the details.
+ 
+\change_unchanged
+
 \end_layout
 
 \begin_layout Description
@@ -28338,6 +29152,8 @@ status collapsed
 
 \change_inserted -970929547 1515110822
 DocBookWrapperAttr
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -28350,6 +29166,8 @@ status collapsed
 
 \change_inserted -970929547 1515110811
 string
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -28367,6 +29185,8 @@ status collapsed
 
 \change_inserted -970929547 1515110845
 wrapperattr
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -28390,6 +29210,8 @@ status collapsed
 
 \change_inserted -970929547 1515110826
 DocBookWrapperTag
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -28402,6 +29224,8 @@ status collapsed
 
 \change_inserted -970929547 1515110811
 string
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -28418,6 +29242,8 @@ status collapsed
 
 \change_inserted -970929547 1515110842
 wrappertag
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -28435,13 +29261,61 @@ status collapsed
 
 \change_inserted -970929547 1515110811
 NONE
+\change_unchanged
+
 \end_layout
 
 \end_inset
 
 , indicating that there is no wrapper tag: tag and content are directly
  output without it.
-\change_deleted -970929547 1515111523
+\change_inserted 1075283030 1597699929
+
+\end_layout
+
+\begin_layout Description
+
+\change_inserted 1075283030 1597699929
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted 1075283030 1597699932
+DocBookWrapperTagType
+\end_layout
+
+\end_inset
+
+ [
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted 1075283030 1597699929
+block, paragraph, inline
+\end_layout
+
+\end_inset
+
+] The new-line policy for this tag, see Section
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "subsec:DocBook-New-line-policy"
+plural "false"
+caps "false"
+noprefix "false"
+
+\end_inset
+
+ for the details.
+ 
+\change_unchanged
 
 \end_layout
 
@@ -28494,6 +29368,8 @@ status collapsed
 
 \change_inserted -970929547 1515109702
 DocBookAttr
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -28506,6 +29382,8 @@ status collapsed
 
 \change_inserted -970929547 1496610966
 string
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -28523,6 +29401,8 @@ status collapsed
 
 \change_inserted -970929547 1515110035
 attr
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -28546,6 +29426,8 @@ status collapsed
 
 \change_inserted -970929547 1496611782
 DocBookTag
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -28558,6 +29440,8 @@ status collapsed
 
 \change_inserted -970929547 1496610966
 string
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -28574,6 +29458,8 @@ status collapsed
 
 \change_inserted -970929547 1496610966
 tag
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -28595,9 +29481,59 @@ Bibliography formatting
 
 \begin_layout Standard
 
+\change_deleted 1075283030 1597699984
+The 
+\change_inserted 1075283030 1597699985
+Included 
+\change_inserted -970929547 1515110187
+bibliograph
+\change_deleted 1075283030 1597699987
+y
+\change_inserted 1075283030 1597699987
+ies
 \change_inserted -970929547 1515110187
-The bibliography cannot be formatted: all fields are always output in the
- database-like DocBook format (equivalent to a BibTeX file).
+ cannot be formatted: all fields are always output in the database-like
+ DocBook format (equivalent to a BibTeX file)
+\change_inserted 1075283030 1597700117
+, using the 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted 1075283030 1597700120
+biblioentry
+\end_layout
+
+\end_inset
+
+ tag
+\change_inserted -970929547 1515110187
+.
+\change_inserted 1075283030 1597700092
+
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 1075283030 1597700112
+When the bibliographic entries are manually inserted into the LyX document
+ as Bibliography Items, the user deals with formatting themself: there is
+ no attempt of parsing what the user wrote, the string is directly used
+ (with the 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted 1075283030 1597700076
+bibliomixed
+\end_layout
+
+\end_inset
+
+ tag).
+ 
 \change_unchanged
 
 \end_layout
diff --git a/lib/generate_contributions.py b/lib/generate_contributions.py
index 4e3e191..e864ebd 100755
--- a/lib/generate_contributions.py
+++ b/lib/generate_contributions.py
@@ -650,7 +650,7 @@ contributors = [
                  "Re: Patches to improve compatibility with modern C++ standard",
                  "m=158862338815864",
                  "4 May 2020",
-                 u"Windows compatibility patches, Docbook backend"),
+                 u"Windows compatibility patches, DocBook backend"),
 
      contributor(u"Matthias Kalle Dalheimer",
                  "kalle () kdab ! net",

commit 49038b7193cf1687c8555be6248fe86334951ffd
Author: Thibaut Cuvelier <tcuvelier at lyx.org>
Date:   Mon Aug 17 23:06:26 2020 +0200

    DocBook: define new arguments in layouts to configure new-line behaviour.

diff --git a/lib/scripts/layout2layout.py b/lib/scripts/layout2layout.py
index 2bb62e3..1164a12 100644
--- a/lib/scripts/layout2layout.py
+++ b/lib/scripts/layout2layout.py
@@ -11,7 +11,7 @@
 # This script will update a .layout file to current format
 
 # The latest layout format is also defined in src/TextClass.cpp
-currentFormat = 83
+currentFormat = 84
 
 
 # Incremented to format 4, 6 April 2007, lasgouttes
@@ -284,6 +284,11 @@ currentFormat = 83
 # Incremented to format 83, 2 August 2020 by dourouc05
 # New tags DocBookWrapperMergeWithPrevious and DocBookAbstract
 
+# Incremented to format 84, 17 August 2020 by dourouc05
+# New tags DocBookTagType, DocBookWrapperTagTagType,
+# DocBookItemWrapperTagTagType, DocBookItemTagTagType,
+# DocBookLabelTag
+
 # Do not forget to document format change in Customization
 # Manual (section "Declaring a new text class").
 
diff --git a/src/Floating.cpp b/src/Floating.cpp
index ebd1e41..d44afc3 100644
--- a/src/Floating.cpp
+++ b/src/Floating.cpp
@@ -31,8 +31,8 @@ Floating::Floating(string const & type, string const & placement,
 		   string const & refPrefix, std::string const & allowedplacement,
 		   string const & htmlTag, string const & htmlAttrib,
 		   docstring const & htmlStyle, string const & docbookTag,
-		   string const & docbookAttr, string const & required,
-		   bool usesfloat, bool ispredefined,
+		   string const & docbookAttr, string const & docbookTagType,
+           string const & required, bool usesfloat, bool ispredefined,
 		   bool allowswide, bool allowssideways)
 	: floattype_(type), placement_(placement), ext_(ext), within_(within),
 	  style_(style), name_(name), listname_(listName), listcommand_(listCmd),
@@ -40,7 +40,8 @@ Floating::Floating(string const & type, string const & placement,
 	  usesfloatpkg_(usesfloat), ispredefined_(ispredefined),
 	  allowswide_(allowswide), allowssideways_(allowssideways),
 	  html_tag_(htmlTag), html_attrib_(htmlAttrib), html_style_(htmlStyle),
-	  docbook_tag_(docbookTag), docbook_attr_(docbookAttr)
+	  docbook_tag_(docbookTag), docbook_attr_(docbookAttr),
+	  docbook_tag_type_(docbookTagType)
 {}
 
 
@@ -90,20 +91,30 @@ string const & Floating::docbookAttr() const
 
 string const & Floating::docbookTag(bool hasTitle) const
 {
-	docbook_tag_ = "";
-	if (floattype_ == "figure") {
-		docbook_tag_ = hasTitle ? "figure" : "informalfigure";
-	} else if (floattype_ == "table") {
-		docbook_tag_ = hasTitle ? "table" : "informaltable";
-	} else if (floattype_ == "algorithm") {
-		// TODO: no good translation for now! Figures are the closest match, as they can contain text.
-		// Solvable as soon as https://github.com/docbook/docbook/issues/157 has a definitive answer.
-		docbook_tag_ = "figure";
+	if (docbook_tag_.empty()) {
+		docbook_tag_ = "";
+		if (floattype_ == "figure") {
+			docbook_tag_ = hasTitle ? "figure" : "informalfigure";
+		} else if (floattype_ == "table") {
+			docbook_tag_ = hasTitle ? "table" : "informaltable";
+		} else if (floattype_ == "algorithm") {
+			// TODO: no good translation for now! Figures are the closest match, as they can contain text.
+			// Solvable as soon as https://github.com/docbook/docbook/issues/157 has a definitive answer.
+			docbook_tag_ = "figure";
+		}
 	}
 	return docbook_tag_;
 }
 
 
+string const & Floating::docbookTagType() const
+{
+	if (docbook_tag_type_ != "block" && docbook_tag_type_ != "paragraph" && docbook_tag_type_ != "inline")
+		docbook_tag_type_ = "block";
+	return docbook_tag_type_;
+}
+
+
 string const & Floating::docbookCaption() const
 {
 	docbook_caption_ = "";
diff --git a/src/Floating.h b/src/Floating.h
index d10694f..5cfea08 100644
--- a/src/Floating.h
+++ b/src/Floating.h
@@ -38,8 +38,9 @@ public:
 		 std::string const & refPrefix, std::string const & allowedplacement,
 		 std::string const & htmlType, std::string const & htmlClass,
 		 docstring const & htmlStyle, std::string const & docbookTag,
-		 std::string const & docbookAttr, std::string const & required,
-		 bool usesfloat, bool isprefined, bool allowswide, bool allowssideways);
+		 std::string const & docbookAttr, std::string const & docbookTagType,
+		 std::string const & required, bool usesfloat, bool isprefined,
+		 bool allowswide, bool allowssideways);
 	///
 	std::string const & floattype() const { return floattype_; }
 	///
@@ -84,6 +85,8 @@ public:
 	///
 	std::string const & docbookAttr() const;
 	///
+	std::string const & docbookTagType() const;
+	///
 	std::string const & docbookCaption() const;
 private:
 	///
@@ -115,9 +118,9 @@ private:
 	///
 	bool ispredefined_;
 	///
-	bool  allowswide_;
+	bool allowswide_;
 	///
-	bool  allowssideways_;
+	bool allowssideways_;
 	///
 	mutable std::string html_tag_;
 	///
@@ -132,6 +135,8 @@ private:
 	mutable std::string docbook_caption_;
 	/// caption tag (mostly, either caption or title)
 	std::string docbook_attr_;
+	/// DocBook tag type (block, paragraph, inline)
+	mutable std::string docbook_tag_type_;
 };
 
 
diff --git a/src/Layout.cpp b/src/Layout.cpp
index 5047506..102410d 100644
--- a/src/Layout.cpp
+++ b/src/Layout.cpp
@@ -106,20 +106,26 @@ enum LayoutTags {
 	LT_HTMLFORCECSS,
 	LT_DOCBOOKTAG,
 	LT_DOCBOOKATTR,
+	LT_DOCBOOKTAGTYPE,
 	LT_DOCBOOKININFO,
 	LT_DOCBOOKABSTRACT,
 	LT_DOCBOOKWRAPPERTAG,
 	LT_DOCBOOKWRAPPERATTR,
+	LT_DOCBOOKWRAPPERTAGTYPE,
 	LT_DOCBOOKWRAPPERMERGEWITHPREVIOUS,
 	LT_DOCBOOKSECTIONTAG,
 	LT_DOCBOOKITEMWRAPPERTAG,
 	LT_DOCBOOKITEMWRAPPERATTR,
+	LT_DOCBOOKITEMWRAPPERTAGTYPE,
 	LT_DOCBOOKITEMTAG,
 	LT_DOCBOOKITEMATTR,
+	LT_DOCBOOKITEMTAGTYPE,
 	LT_DOCBOOKITEMLABELTAG,
 	LT_DOCBOOKITEMLABELATTR,
+	LT_DOCBOOKITEMLABELTAGTYPE,
 	LT_DOCBOOKITEMINNERTAG,
 	LT_DOCBOOKITEMINNERATTR,
+	LT_DOCBOOKITEMINNERTAGTYPE,
 	LT_DOCBOOKFORCEABSTRACTTAG,
 	LT_INPREAMBLE,
 	LT_HTMLTITLE,
@@ -223,23 +229,29 @@ bool Layout::readIgnoreForcelocal(Lexer & lex, TextClass const & tclass)
 		{ "commanddepth",   LT_COMMANDDEPTH },
 		{ "copystyle",      LT_COPYSTYLE },
 		{ "dependson",      LT_DEPENDSON },
-		{ "docbookabstract",         LT_DOCBOOKABSTRACT },
-		{ "docbookattr",             LT_DOCBOOKATTR },
-		{ "docbookforceabstracttag", LT_DOCBOOKFORCEABSTRACTTAG },
-		{ "docbookininfo",           LT_DOCBOOKININFO },
-		{ "docbookitemattr",         LT_DOCBOOKITEMATTR },
-		{ "docbookiteminnerattr",    LT_DOCBOOKITEMINNERATTR },
-		{ "docbookiteminnertag",     LT_DOCBOOKITEMINNERTAG },
-		{ "docbookitemlabelattr",    LT_DOCBOOKITEMLABELATTR },
-		{ "docbookitemlabeltag",     LT_DOCBOOKITEMLABELTAG },
-		{ "docbookitemtag",          LT_DOCBOOKITEMTAG },
-		{ "docbookitemwrapperattr",  LT_DOCBOOKITEMWRAPPERATTR },
-		{ "docbookitemwrappertag",   LT_DOCBOOKITEMWRAPPERTAG },
-		{ "docbooksectiontag",       LT_DOCBOOKSECTIONTAG },
-		{ "docbooktag",              LT_DOCBOOKTAG },
-		{ "docbookwrapperattr",      LT_DOCBOOKWRAPPERATTR },
+		{ "docbookabstract",           LT_DOCBOOKABSTRACT },
+		{ "docbookattr",               LT_DOCBOOKATTR },
+		{ "docbookforceabstracttag",   LT_DOCBOOKFORCEABSTRACTTAG },
+		{ "docbookininfo",             LT_DOCBOOKININFO },
+		{ "docbookitemattr",           LT_DOCBOOKITEMATTR },
+		{ "docbookiteminnerattr",      LT_DOCBOOKITEMINNERATTR },
+		{ "docbookiteminnertag",       LT_DOCBOOKITEMINNERTAG },
+		{ "docbookiteminnertagtype",   LT_DOCBOOKITEMINNERTAGTYPE },
+		{ "docbookitemlabelattr",      LT_DOCBOOKITEMLABELATTR },
+		{ "docbookitemlabeltag",       LT_DOCBOOKITEMLABELTAG },
+		{ "docbookitemlabeltagtype",   LT_DOCBOOKITEMLABELTAGTYPE },
+		{ "docbookitemtag",            LT_DOCBOOKITEMTAG },
+		{ "docbookitemtagtype",        LT_DOCBOOKITEMTAGTYPE },
+		{ "docbookitemwrapperattr",    LT_DOCBOOKITEMWRAPPERATTR },
+		{ "docbookitemwrappertag",     LT_DOCBOOKITEMWRAPPERTAG },
+		{ "docbookitemwrappertagtype", LT_DOCBOOKITEMWRAPPERTAGTYPE },
+		{ "docbooksectiontag",         LT_DOCBOOKSECTIONTAG },
+		{ "docbooktag",                LT_DOCBOOKTAG },
+		{ "docbooktagtype",            LT_DOCBOOKTAGTYPE },
+		{ "docbookwrapperattr",        LT_DOCBOOKWRAPPERATTR },
 		{ "docbookwrappermergewithprevious", LT_DOCBOOKWRAPPERMERGEWITHPREVIOUS },
-		{ "docbookwrappertag",       LT_DOCBOOKWRAPPERTAG },
+		{ "docbookwrappertag",         LT_DOCBOOKWRAPPERTAG },
+		{ "docbookwrappertagtype",     LT_DOCBOOKWRAPPERTAGTYPE },
 		{ "end",            LT_END },
 		{ "endlabelstring", LT_ENDLABELSTRING },
 		{ "endlabeltype",   LT_ENDLABELTYPE },
@@ -733,6 +745,10 @@ bool Layout::readIgnoreForcelocal(Lexer & lex, TextClass const & tclass)
 			lex >> docbookattr_;
 			break;
 
+		case LT_DOCBOOKTAGTYPE:
+			lex >> docbooktagtype_;
+			break;
+
 		case LT_DOCBOOKFORCEABSTRACTTAG:
 			lex >> docbookforceabstracttag_;
 			break;
@@ -753,6 +769,10 @@ bool Layout::readIgnoreForcelocal(Lexer & lex, TextClass const & tclass)
 			lex >> docbookwrapperattr_;
 			break;
 
+		case LT_DOCBOOKWRAPPERTAGTYPE:
+			lex >> docbookwrappertagtype_;
+			break;
+
 		case LT_DOCBOOKWRAPPERMERGEWITHPREVIOUS:
 			lex >> docbookwrappermergewithprevious_;
 			break;
@@ -769,6 +789,10 @@ bool Layout::readIgnoreForcelocal(Lexer & lex, TextClass const & tclass)
 			lex >> docbookitemwrapperattr_;
 			break;
 
+		case LT_DOCBOOKITEMWRAPPERTAGTYPE:
+			lex >> docbookitemwrappertagtype_;
+			break;
+
 		case LT_DOCBOOKITEMTAG:
 			lex >> docbookitemtag_;
 			break;
@@ -777,6 +801,10 @@ bool Layout::readIgnoreForcelocal(Lexer & lex, TextClass const & tclass)
 			lex >> docbookitemattr_;
 			break;
 
+		case LT_DOCBOOKITEMTAGTYPE:
+			lex >> docbookitemtagtype_;
+			break;
+
 		case LT_DOCBOOKITEMLABELTAG:
 			lex >> docbookitemlabeltag_;
 			break;
@@ -785,6 +813,10 @@ bool Layout::readIgnoreForcelocal(Lexer & lex, TextClass const & tclass)
 			lex >> docbookitemlabelattr_;
 			break;
 
+		case LT_DOCBOOKITEMLABELTAGTYPE:
+			lex >> docbookitemlabeltagtype_;
+			break;
+
 		case LT_DOCBOOKITEMINNERTAG:
 			lex >> docbookiteminnertag_;
 			break;
@@ -793,6 +825,10 @@ bool Layout::readIgnoreForcelocal(Lexer & lex, TextClass const & tclass)
 			lex >> docbookiteminnerattr_;
 			break;
 
+		case LT_DOCBOOKITEMINNERTAGTYPE:
+			lex >> docbookiteminnertagtype_;
+			break;
+
 		case LT_SPELLCHECK:
 			lex >> spellcheck;
 			break;
@@ -1608,6 +1644,8 @@ void Layout::write(ostream & os) const
 		os << "\tDocBookTag " << docbooktag_ << '\n';
 	if(!docbookattr_.empty())
 		os << "\tDocBookAttr " << docbookattr_ << '\n';
+	if(!docbooktagtype_.empty())
+		os << "\tDocBookTagType " << docbooktagtype_ << '\n';
 	if(!docbookininfo_.empty())
 		os << "\tDocBookInInfo " << docbookininfo_ << '\n';
 	os << "\tDocBookAbstract " << docbookabstract_ << '\n';
@@ -1615,25 +1653,35 @@ void Layout::write(ostream & os) const
 		os << "\tDocBookWrapperTag " << docbookwrappertag_ << '\n';
 	if(!docbookwrapperattr_.empty())
 		os << "\tDocBookWrapperAttr " << docbookwrapperattr_ << '\n';
+	if(!docbookwrappertagtype_.empty())
+		os << "\tDocBookWrapperTagType " << docbookwrappertagtype_ << '\n';
 	if(!docbooksectiontag_.empty())
 		os << "\tDocBookSectionTag " << docbooksectiontag_ << '\n';
 	if(!docbookitemtag_.empty())
 		os << "\tDocBookItemTag " << docbookitemtag_ << '\n';
 	if(!docbookitemattr_.empty())
 		os << "\tDocBookItemAttr " << docbookitemattr_ << '\n';
+	if(!docbookitemtagtype_.empty())
+		os << "\tDocBookItemTagType " << docbookitemtagtype_ << '\n';
 	if(!docbookitemwrappertag_.empty())
 		os << "\tDocBookItemWrapperTag " << docbookitemwrappertag_ << '\n';
 	if(!docbookitemwrapperattr_.empty())
 		os << "\tDocBookItemWrapperAttr " << docbookitemwrapperattr_ << '\n';
+	if(!docbookitemwrappertagtype_.empty())
+		os << "\tDocBookItemWrapperTagType " << docbookitemwrappertagtype_ << '\n';
 	os << "\tDocBookItemWrapperMergeWithPrevious " << docbookwrappermergewithprevious_ << '\n';
 	if(!docbookitemlabeltag_.empty())
 		os << "\tDocBookItemLabelTag " << docbookitemlabeltag_ << '\n';
 	if(!docbookitemlabelattr_.empty())
 		os << "\tDocBookItemLabelAttr " << docbookitemlabelattr_ << '\n';
+	if(!docbookitemlabeltagtype_.empty())
+		os << "\tDocBookItemLabelTagType " << docbookitemlabeltagtype_ << '\n';
 	if(!docbookiteminnertag_.empty())
 		os << "\tDocBookItemInnerTag " << docbookiteminnertag_ << '\n';
 	if(!docbookiteminnerattr_.empty())
 		os << "\tDocBookItemInnerAttr " << docbookiteminnerattr_ << '\n';
+	if(!docbookiteminnertagtype_.empty())
+		os << "\tDocBookItemInnerTagType " << docbookiteminnertagtype_ << '\n';
 	if(!docbookforceabstracttag_.empty())
 		os << "\tDocBookForceAbstractTag " << docbookforceabstracttag_ << '\n';
 	os << "\tSpellcheck " << spellcheck << "\n"
@@ -1786,9 +1834,12 @@ string Layout::defaultCSSClass() const
 
 string const & Layout::docbooktag() const
 {
-	// No sensible default value, unhappily...
-	if (docbooktag_.empty())
-		docbooktag_ = to_utf8(name_);
+	if (docbooktag_.empty()) {
+		if (to_ascii(name_) == "Plain Layout")
+			docbooktag_ = "para";
+		else // No sensible default value, unhappily...
+			docbooktag_ = to_utf8(name_);
+	}
 	return docbooktag_;
 }
 
@@ -1800,6 +1851,20 @@ string const & Layout::docbookattr() const
 }
 
 
+bool isValidTagType(std::string type)
+{
+	return !(type.empty() || (type != "block" && type != "paragraph" && type != "inline"));
+}
+
+
+string const & Layout::docbooktagtype() const
+{
+	if (!isValidTagType(docbooktagtype_))
+		docbooktagtype_ = "block";
+	return docbooktagtype_;
+}
+
+
 string const & Layout::docbookininfo() const
 {
 	// Indeed, a trilean. Only titles should be "maybe": otherwise, metadata is "always", content is "never". 
@@ -1823,6 +1888,14 @@ string const & Layout::docbookwrapperattr() const
 }
 
 
+string const & Layout::docbookwrappertagtype() const
+{
+	if (!isValidTagType(docbookwrappertagtype_))
+		docbookwrappertagtype_ = "block";
+	return docbookwrappertagtype_;
+}
+
+
 string const & Layout::docbooksectiontag() const
 {
 	if (docbooksectiontag_.empty())
@@ -1845,9 +1918,19 @@ string const & Layout::docbookitemwrapperattr() const
 }
 
 
+string const & Layout::docbookitemwrappertagtype() const
+{
+	if (!isValidTagType(docbookitemwrappertagtype_))
+		docbookitemwrappertagtype_ = "block";
+	return docbookitemwrappertagtype_;
+}
+
+
 string const & Layout::docbookitemtag() const
 {
-    return docbookitemtag_;
+	if (docbookitemtag_.empty())
+		docbookitemtag_ = "NONE";
+	return docbookitemtag_;
 }
 
 
@@ -1857,6 +1940,14 @@ string const & Layout::docbookitemattr() const
 }
 
 
+string const & Layout::docbookitemtagtype() const
+{
+	if (!isValidTagType(docbookitemtagtype_))
+		docbookitemtagtype_ = "block";
+	return docbookitemtagtype_;
+}
+
+
 string const & Layout::docbookitemlabeltag() const
 {
 	if (docbookitemlabeltag_.empty())
@@ -1871,6 +1962,14 @@ string const & Layout::docbookitemlabelattr() const
 }
 
 
+string const & Layout::docbookitemlabeltagtype() const
+{
+	if (!isValidTagType(docbookitemlabeltagtype_))
+		docbookitemlabeltagtype_ = "block";
+	return docbookitemlabeltagtype_;
+}
+
+
 string const & Layout::docbookiteminnertag() const
 {
 	if (docbookiteminnertag_.empty())
@@ -1885,6 +1984,14 @@ string const & Layout::docbookiteminnerattr() const
 }
 
 
+string const & Layout::docbookiteminnertagtype() const
+{
+	if (!isValidTagType(docbookiteminnertagtype_))
+		docbookiteminnertagtype_ = "block";
+	return docbookiteminnertagtype_;
+}
+
+
 std::string const & Layout::docbookforceabstracttag() const
 {
 	if (docbookforceabstracttag_.empty())
diff --git a/src/Layout.h b/src/Layout.h
index a894142..14784a2 100644
--- a/src/Layout.h
+++ b/src/Layout.h
@@ -197,6 +197,8 @@ public:
 	///
 	std::string const & docbookattr() const;
 	///
+	std::string const & docbooktagtype() const;
+	///
 	std::string const & docbookininfo() const;
 	///
 	bool docbookabstract() const { return docbookabstract_; }
@@ -205,6 +207,8 @@ public:
 	///
 	std::string const & docbookwrapperattr() const;
 	///
+	std::string const & docbookwrappertagtype() const;
+	///
 	bool docbookwrappermergewithprevious() const { return docbookwrappermergewithprevious_; }
 	///
 	std::string const & docbooksectiontag() const;
@@ -213,18 +217,26 @@ public:
 	///
 	std::string const & docbookitemwrapperattr() const;
 	///
+	std::string const & docbookitemwrappertagtype() const;
+	///
 	std::string const & docbookitemlabeltag() const;
 	///
 	std::string const & docbookitemlabelattr() const;
 	///
+	std::string const & docbookitemlabeltagtype() const;
+	///
 	std::string const & docbookiteminnertag() const;
 	///
 	std::string const & docbookiteminnerattr() const;
 	///
+	std::string const & docbookiteminnertagtype() const;
+	///
 	std::string const & docbookitemtag() const;
 	///
 	std::string const & docbookitemattr() const;
 	///
+	std::string const & docbookitemtagtype() const;
+	///
 	std::string const & docbookforceabstracttag() const;
 	///
 	bool isParagraph() const { return latextype == LATEX_PARAGRAPH; }
@@ -495,27 +507,39 @@ private:
 	mutable std::string docbooktag_;
 	/// Roles to add to docbooktag_, if any (default: none).
 	mutable std::string docbookattr_;
+	/// DocBook tag type corresponding to this layout (block, paragraph, or inline; default: block).
+	mutable std::string docbooktagtype_;
 	/// DocBook tag corresponding to this item (mainly for lists).
 	mutable std::string docbookitemtag_;
 	/// Roles to add to docbookitemtag_, if any (default: none).
 	mutable std::string docbookitemattr_;
+	/// DocBook tag type corresponding to this item (block, paragraph, or inline; default: block).
+	mutable std::string docbookitemtagtype_;
 	/// DocBook tag corresponding to the wrapper around an item (mainly for lists).
 	mutable std::string docbookitemwrappertag_;
 	/// Roles to add to docbookitemwrappertag_, if any (default: none).
 	mutable std::string docbookitemwrapperattr_;
-	/// DocBook tag corresponding to this label (only for description lists;
+	/// DocBook tag type corresponding to the wrapper around an item (block, paragraph, or inline; default: block).
+	mutable std::string docbookitemwrappertagtype_;
+	/// DocBook tag corresponding to this label (mostly for description lists;
 	/// labels in the common sense do not exist with DocBook).
 	mutable std::string docbookitemlabeltag_;
 	/// Roles to add to docbooklabeltag_, if any (default: none).
 	mutable std::string docbookitemlabelattr_;
+	/// DocBook tag corresponding to this label (block, paragraph, or inline; default: block).
+	mutable std::string docbookitemlabeltagtype_;
 	/// DocBook tag to add within the item, around its direct content (mainly for lists).
 	mutable std::string docbookiteminnertag_;
 	/// Roles to add to docbookiteminnertag_, if any (default: none).
 	mutable std::string docbookiteminnerattr_;
+	/// DocBook tag to add within the item, around its direct content (block, paragraph, or inline; default: block).
+	mutable std::string docbookiteminnertagtype_;
 	/// DocBook tag corresponding to this wrapper around the main tag.
 	mutable std::string docbookwrappertag_;
 	/// Roles to add to docbookwrappertag_, if any (default: none).
 	mutable std::string docbookwrapperattr_;
+	/// DocBook tag corresponding to this wrapper around the main tag (block, paragraph, or inline; default: block).
+	mutable std::string docbookwrappertagtype_;
 	/// Whether this wrapper tag may be merged with the previously opened wrapper tag.
 	bool docbookwrappermergewithprevious_;
 	/// Outer tag for this section, only if this layout represent a sectionning item, including chapters
diff --git a/src/TextClass.cpp b/src/TextClass.cpp
index 79cdabd..e413403 100644
--- a/src/TextClass.cpp
+++ b/src/TextClass.cpp
@@ -62,7 +62,7 @@ namespace lyx {
 // You should also run the development/tools/updatelayouts.py script,
 // to update the format of all of our layout files.
 //
-int const LAYOUT_FORMAT = 83; // tcuvelier: DocBookWrapperMergeWithPrevious.
+int const LAYOUT_FORMAT = 84; // tcuvelier: DocBook*TagType.
 
 
 // Layout format for the current lyx file format. Controls which format is
@@ -1378,6 +1378,7 @@ bool TextClass::readFloat(Lexer & lexrc)
 		FT_HTMLTAG,
 		FT_DOCBOOKATTR,
 		FT_DOCBOOKTAG,
+		FT_DOCBOOKTAGTYPE,
 		FT_LISTCOMMAND,
 		FT_REFPREFIX,
 		FT_ALLOWED_PLACEMENT,
@@ -1393,6 +1394,7 @@ bool TextClass::readFloat(Lexer & lexrc)
 		{ "allowswide", FT_ALLOWS_WIDE },
 		{ "docbookattr", FT_DOCBOOKATTR },
 		{ "docbooktag", FT_DOCBOOKTAG },
+		{ "docbooktagtype", FT_DOCBOOKTAGTYPE },
 		{ "end", FT_END },
 		{ "extension", FT_EXT },
 		{ "guiname", FT_NAME },
@@ -1419,6 +1421,7 @@ bool TextClass::readFloat(Lexer & lexrc)
 	string htmltag;
 	string docbookattr;
 	string docbooktag;
+	string docbooktagtype;
 	string listname;
 	string listcommand;
 	string name;
@@ -1540,6 +1543,10 @@ bool TextClass::readFloat(Lexer & lexrc)
 			lexrc.next();
 			docbooktag = lexrc.getString();
 			break;
+		case FT_DOCBOOKTAGTYPE:
+			lexrc.next();
+			docbooktagtype = lexrc.getString();
+			break;
 		case FT_END:
 			getout = true;
 			break;
@@ -1568,8 +1575,8 @@ bool TextClass::readFloat(Lexer & lexrc)
 		Floating fl(type, placement, ext, within, style, name,
 			listname, listcommand, refprefix, allowed_placement,
 			htmltag, htmlattr, htmlstyle, docbooktag, docbookattr,
-			required, usesfloat, ispredefined, allowswide,
-			allowssideways);
+			docbooktagtype, required, usesfloat, ispredefined,
+	        allowswide, allowssideways);
 		floatlist_.newFloat(fl);
 		// each float has its own counter
 		counters_.newCounter(from_ascii(type), from_ascii(within),

commit 547e8628db756e6056f34758cc567b7ecbe0396d
Author: Thibaut Cuvelier <tcuvelier at lyx.org>
Date:   Sun Aug 16 00:59:43 2020 +0200

    Simplify code to generate only one paragraph at a time.

diff --git a/autotests/export/docbook/basic.xml b/autotests/export/docbook/basic.xml
index f208ae6..6f4a828 100644
--- a/autotests/export/docbook/basic.xml
+++ b/autotests/export/docbook/basic.xml
@@ -1,69 +1,62 @@
 <?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 -->
-<article 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.1">
-
-<info><title>I am a title</title>
-<author><personname>I am an author</personname></author>
+<article 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>I am a title</title>
+<author>
+<personname>I am an author</personname>
+</author>
 <date>I am a date</date>
-
-<abstract><para>I am an abstract</para>
+<abstract>
+<para>I am an abstract</para>
 <para>I am also an abstract</para>
 </abstract>
 </info>
-<para>I am a standard paragraph. </para>
-<section xml:id="sec.Sec-1-0">
+<section xml:id="sec.Sec-1">
 <title>I am the first section </title>
 <para>I am the first paragraph of the first section. </para>
-
 <para>I am the second paragraph of the first section. </para>
-
-<blockquote><para>I am a quote
- <inlineequation>
-  <m:math>
-  <m:alt role='tex'>\,with\,a\,formula</m:alt>
+<blockquote>
+<para>I am a quote<inlineequation>
+<alt role='tex'>\,with\,a\,formula</alt>
+ <m:math>
+ 
  <m:mrow>
-  <m:mrow>
-  <m:mspace width="6px"/><m:mi>w</m:mi><m:mi>i</m:mi><m:mi>t</m:mi><m:mi>h</m:mi>
-  <m:mspace width="6px"/><m:mi>a</m:mi>
-  <m:mspace width="6px"/><m:mi>f</m:mi><m:mi>o</m:mi><m:mi>r</m:mi><m:mi>m</m:mi><m:mi>u</m:mi><m:mi>l</m:mi><m:mi>a</m:mi>
+  <m:mrow><m:mspace width="6px" /><m:mi>w</m:mi><m:mi>i</m:mi><m:mi>t</m:mi><m:mi>h</m:mi><m:mspace width="6px" /><m:mi>a</m:mi><m:mspace width="6px" /><m:mi>f</m:mi><m:mi>o</m:mi><m:mi>r</m:mi><m:mi>m</m:mi><m:mi>u</m:mi><m:mi>l</m:mi><m:mi>a</m:mi>
   </m:mrow>
  </m:mrow>
-  </m:math>
- </inlineequation>. </para>
+ </m:math>
+</inlineequation>. </para>
 </blockquote>
-<para>
- <informalequation>
-  <m:math>
-  <m:alt role='tex'>Formula!</m:alt>
+<para><informalequation>
+<alt role='tex'>Formula!</alt>
+ <m:math>
+ 
  <m:mrow>
   <m:mrow><m:mi>F</m:mi><m:mi>o</m:mi><m:mi>r</m:mi><m:mi>m</m:mi><m:mi>u</m:mi><m:mi>l</m:mi><m:mi>a</m:mi><m:mo>!</m:mo>
   </m:mrow>
  </m:mrow>
-  </m:math>
- </informalequation>
- <informalequation xml:id='eq.EQ.-1'>
-  <m:math>
-  <m:alt role='tex'>\text{I am a formula with a ref.}\label{eq:EQ.}</m:alt>
+ </m:math>
+</informalequation><informalequation xml:id="eq.EQ.">
+<alt role='tex'>\text{I am a formula with a ref.}\label{eq:EQ.}</alt>
+ <m:math>
+ 
  <m:mrow>
   <m:mstyle mathvariant='normal'>
    <m:mrow><m:mi>I</m:mi> <m:mi>a</m:mi><m:mi>m</m:mi> <m:mi>a</m:mi> <m:mi>f</m:mi><m:mi>o</m:mi><m:mi>r</m:mi><m:mi>m</m:mi><m:mi>u</m:mi><m:mi>l</m:mi><m:mi>a</m:mi> <m:mi>w</m:mi><m:mi>i</m:mi><m:mi>t</m:mi><m:mi>h</m:mi> <m:mi>a</m:mi> <m:mi>r</m:mi><m:mi>e</m:mi><m:mi>f</m:mi><m:mn>.</m:mn>
    </m:mrow>
   </m:mstyle>
  </m:mrow>
-  </m:math>
- </informalequation></para>
-
-<para>See <xref linkend="sec.Sec-2kqgsdiflhqsdlifgjuzer-povtuizmvnuer-t-vmsrmfli--uh--a--rtpfuo----rtpc.m-ca-rgifzapeu-tvgz-2" />.</para>
-
-<para>Also, a formula with an user-defined macro that outputs well in LaTeX but cannot in MathML (hence replaced by picture): 
- <inlineequation>
-  <m:math>
-  <m:alt role='tex'>\testmacro</m:alt>
-  </m:math>
- </inlineequation>. </para>
-
-<!-- \latexCommandThatShouldBeCommented --><section>
+ </m:math>
+</informalequation></para>
+<para>See <xref linkend="sec.Sec-2kqgsdiflhqsdlifgjuzer-povtuizmvnuer-t-vmsrmfli--uh--a--rtpfuo----rtpc.m-ca-rgifzapeu-tvgz" />.</para>
+<para>Also, a formula with an user-defined macro that outputs well in LaTeX but cannot in MathML (hence replaced by picture): <inlineequation>
+<alt role='tex'>\testmacro</alt>
+<mathphrase>MathML export failed. Please report this as a bug.</mathphrase>
+</inlineequation>. </para>
+<!-- \latexCommandThatShouldBeCommented -->
+<section>
 <title>I am the first subsection</title>
 <para>I am the only paragraph of the first subsection. </para>
 </section>
@@ -72,174 +65,150 @@
 <para>I am the only paragraph of the second subsection. </para>
 </section>
 </section>
-<section xml:id="sec.Sec-2kqgsdiflhqsdlifgjuzer-povtuizmvnuer-t-vmsrmfli--uh--a--rtpfuo----rtpc.m-ca-rgifzapeu-tvgz-2">
+<section xml:id="sec.Sec-2kqgsdiflhqsdlifgjuzer-povtuizmvnuer-t-vmsrmfli--uh--a--rtpfuo----rtpc.m-ca-rgifzapeu-tvgz">
 <title>I am the second section </title>
 <para>I am the only paragraph of the second section. <link xlink:href="http://example.org">Hyperlink.</link> “Text between quotes.”</para>
-
-<para>See <xref linkend="sec.Sec-1-0" />.</para>
+<para>See <xref linkend="sec.Sec-1" />.</para>
 </section>
 <section>
 <title>I am the third section and I have fun with lists</title>
-
-
-<orderedlist><listitem><para>First item. </para>
-<para>Second line of the first item, after a line break. </para>
-</listitem>
-
-<listitem><para>Second item. </para>
-</listitem>
-</orderedlist>
-
-
-<itemizedlist><listitem><para>Item has no order (1). </para>
-</listitem>
-
-<listitem><para>Item has no order (2). </para>
-</listitem>
-</itemizedlist>
-
-<variablelist><varlistentry><term>Word</term>
-
-
-<listitem><para> description</para>
-</listitem></varlistentry>
-<varlistentry><term>Sentence</term>
-
-
-<listitem><para> meaning</para>
-</listitem></varlistentry>
-</variablelist>
+<orderedlist><listitem>First item. 
+<br />
+Second line of the first item, after a line break. </listitem></orderedlist>
+<orderedlist><listitem>Second item. </listitem></orderedlist>
+<itemizedlist><listitem>Item has no order (1). </listitem></itemizedlist>
+<itemizedlist><listitem>Item has no order (2). </listitem></itemizedlist>
+<variablelist><listitem><varlistentry>
+
+Word description<!-- Output Error: Closing tag `listitem' when other tags are open, namely: -->
+<!-- Output Error: varlistentry -->
+</varlistentry></listitem></variablelist>
+<variablelist><listitem><varlistentry>
+
+Sentence meaning<!-- Output Error: Closing tag `listitem' when other tags are open, namely: -->
+<!-- Output Error: varlistentry -->
+</varlistentry></listitem></variablelist>
 </section>
 <section>
 <title>I am the fourth section and I deal with formatting. </title>
 <para>The following paragraph should be code. </para>
-
 <para><programlisting>I am some code. 
-I am a second line of code. </programlisting>I am no more code. </para>
-
+I am a second line of code. 
+</programlisting>I am no more code. </para>
 <para>This line has inline code. <code>This has typewriter font</code><footnote><para>I repeat that in a footnote.</para>
 </footnote>. </para>
-
 <para>On the other hand, <footnote><para>this footnote</para>
-
 <para>has multiple </para>
-
 <para>paragraphs.</para>
 </footnote>. </para>
 </section>
 <section>
 <title>I am the fifth section and I deal with floats</title>
 <para>Now, three tables: </para>
-
-
-<table><caption>I am a table caption below the table.</caption>
-
-
-<tbody><tr><td align='center' valign='top'>Table 1</td>
+<table>
+<caption>I am a table caption below the table.</caption>
+<tbody>
+<tr>
+<td align='center' valign='top'>Table 1</td>
 <td align='center' valign='top'>Table 2</td>
 <td align='center' valign='top'>Table 3</td>
 </tr>
-<tr><td align='center' valign='top'>Row 1</td>
+<tr>
+<td align='center' valign='top'>Row 1</td>
 <td align='center' valign='top'></td>
 <td align='center' valign='top'>Col 3, row 1</td>
 </tr>
-<tr><td align='center' valign='top'>Row 2</td>
+<tr>
+<td align='center' valign='top'>Row 2</td>
 <td align='center' valign='top'></td>
 <td align='center' valign='top'>Col 3, row 2</td>
-</tr></tbody>
-
+</tr>
+</tbody>
 </table>
-
-
-<table><caption>I am a table caption above the table.</caption>
-
-
-
-<tbody><tr><td align='center' valign='top'>Table 1</td>
+<table>
+<caption>I am a table caption above the table.</caption>
+<tbody>
+<tr>
+<td align='center' valign='top'>Table 1</td>
 <td align='center' valign='top'>Table 2</td>
 <td align='center' valign='top'>Table 3</td>
 </tr>
-<tr><td align='center' valign='top'>Row 1</td>
+<tr>
+<td align='center' valign='top'>Row 1</td>
 <td align='center' valign='top'></td>
 <td align='center' valign='top'>Col 3, row 1</td>
 </tr>
-<tr><td align='center' valign='top'>Row 2</td>
+<tr>
+<td align='center' valign='top'>Row 2</td>
 <td align='center' valign='top'></td>
 <td align='center' valign='top'>Col 3, row 2</td>
-</tr></tbody>
+</tr>
+</tbody>
 </table>
-
-
-
-
-<informaltable><tbody><tr><td align='center' valign='top'>Table that has no caption 1</td>
+<informaltable>
+<tbody>
+<tr>
+<td align='center' valign='top'>Table that has no caption 1</td>
 <td align='center' valign='top'>Table that has no caption 2</td>
 <td align='center' valign='top'>Table that has no caption 3</td>
 </tr>
-<tr><td align='center' valign='top'>Row 1</td>
+<tr>
+<td align='center' valign='top'>Row 1</td>
 <td align='center' valign='top'></td>
 <td align='center' valign='top'>Col 3, row 1</td>
 </tr>
-<tr><td align='center' valign='top'>Row 2</td>
+<tr>
+<td align='center' valign='top'>Row 2</td>
 <td align='center' valign='top'></td>
 <td align='center' valign='top'>Col 3, row 2</td>
-</tr></tbody>
+</tr>
+</tbody>
 </informaltable>
-
 <para>Then, one figure: </para>
-
-
-<figure><title>Caption.</title>
-
-
-<mediaobject><imageobject><imagedata fileref="0_mnt_d_Thibaut_LyX_autotests_export_docbook_lyx-logo.png"  />
+<figure>
+<title>Caption.</title>
+<mediaobject>
+<imageobject>
+<imagedata fileref="D:/LyX/lyx-unstable/autotests/export/docbook/lyx-logo.png"  />
 </imageobject>
 </mediaobject>
-
 </figure>
 </section>
 <section>
 <title>I am the sixth section and I really like bibliographies</title>
 <para>This text has references. First reference: <biblioref endterm="big" />. Second reference: <biblioref endterm="small" />. Both at the same time: <biblioref endterm="big" />, <biblioref endterm="small" />. A book: <biblioref endterm="Gro60" />. </para>
-
 <para>Many things, just testing for completeness: <biblioref endterm="article" />, <biblioref endterm="book" />, <biblioref endterm="booklet" />, <biblioref endterm="conference" />, <biblioref endterm="inbook" />, <biblioref endterm="incollection" />. </para>
 </section>
 <section>
 <title>I am the seventh section and I deal with indices</title>
 <para>First, a term to index: <indexterm type="idx"><primary>Term to index</primary></indexterm>. Then a term to add to the second index: <indexterm type="oth"><primary>Term to add to the second index</primary></indexterm>. </para>
-
 <para>Then several terms for the first index: <indexterm type="idx"><primary>Term</primary><secondary>to</secondary><tertiary>index</tertiary></indexterm>. </para>
-
 <para>With a see: <indexterm type="idx"><primary>Term</primary><see>index</see></indexterm>. With a see also: <indexterm type="idx"><primary>Term</primary><seealso>index</seealso></indexterm>. </para>
-
 <para>Several terms with a see: <indexterm type="idx"><primary>Term</primary><secondary>to</secondary><tertiary>index</tertiary><see>index</see></indexterm>. Several terms with a see also: <indexterm type="idx"><primary>Term</primary><secondary>to</secondary><tertiary>index</tertiary><seealso>index</seealso></indexterm>. </para>
-
-<para>A start of range: <indexterm type="idx" class="startofrange" xml:id="Term-to-index-3"><primary>Term to index</primary></indexterm>. The corresponding end of range: <indexterm type="idx" class="endofrange" startref="Term-to-index-3"><primary>Term to index</primary></indexterm>.</para>
-
-<para>Several terms with a start of range: <indexterm type="idx" class="startofrange" xml:id="Term.to.index-4"><primary>Term</primary><secondary>to</secondary><tertiary>index</tertiary></indexterm>. The corresponding end of range: <indexterm type="idx" class="endofrange" startref="Term.to.index-4"><primary>Term</primary><secondary>to</secondary><tertiary>index</tertiary></indexterm>.</para>
-
-<para>These terms already appeared before! Start of range: <indexterm type="idx" class="startofrange" xml:id="Term.to.index-0-5"><primary>Term</primary><secondary>to</secondary><tertiary>index</tertiary></indexterm>. The corresponding end of range: <indexterm type="idx" class="endofrange" startref="Term.to.index-0-5"><primary>Term</primary><secondary>to</secondary><tertiary>index</tertiary></indexterm>.</para>
+<para>A start of range: <indexterm type="idx" class="startofrange" xml:id="Term-to-index"><primary>Term to index</primary></indexterm>. The corresponding end of range: <indexterm type="idx" class="endofrange" startref="Term-to-index"><primary>Term to index</primary></indexterm>.</para>
+<para>Several terms with a start of range: <indexterm type="idx" class="startofrange" xml:id="Term.to.index"><primary>Term</primary><secondary>to</secondary><tertiary>index</tertiary></indexterm>. The corresponding end of range: <indexterm type="idx" class="endofrange" startref="Term.to.index"><primary>Term</primary><secondary>to</secondary><tertiary>index</tertiary></indexterm>.</para>
+<para>These terms already appeared before! Start of range: <indexterm type="idx" class="startofrange" xml:id="Term.to.index-0"><primary>Term</primary><secondary>to</secondary><tertiary>index</tertiary></indexterm>. The corresponding end of range: <indexterm type="idx" class="endofrange" startref="Term.to.index-0"><primary>Term</primary><secondary>to</secondary><tertiary>index</tertiary></indexterm>.</para>
 </section>
 <section>
 <title>I am the eight section and I deal with star sections</title>
-<bridgehead renderas="part">Star part</bridgehead>
+<bridgehead renderas='other' otherrenderas='part'>Star part</bridgehead>
 <bridgehead renderas="sect1">Star section (sect1)</bridgehead>
 <bridgehead renderas="sect2">Star subsection (sect2)</bridgehead>
 <bridgehead renderas="sect3">Star subsubsection (sect3)</bridgehead>
 <bridgehead renderas="sect4">Star paragraph (sect4)</bridgehead>
 <bridgehead renderas="sect5">Star subparagraph (sect5)</bridgehead>
 </section>
-
-<bibliography><title>References</title>
-
-<biblioentry xml:id="article"><title>The title of the work</title><volumenum>4</volumenum><artpagenums>201-213</artpagenums><bibliomisc role="type">article</bibliomisc>
+<bibliography>
+<title>References</title>
+<biblioentry xml:id="article">
+<title>The title of the work</title><volumenum>4</volumenum><artpagenums>201-213</artpagenums><bibliomisc role="type">article</bibliomisc>
 <pubdate>1993</pubdate>
-
-<biblioset relation="journal"><title>The name of the journal</title>
+<biblioset relation="journal">
+<title>The name of the journal</title>
 </biblioset>
-
-
-<authorgroup><author><personname><firstname>Peter</firstname>
+<authorgroup><author>
+<personname>
+<firstname>Peter</firstname>
 <surname>Adams</surname>
 </personname>
 </author>
@@ -247,119 +216,119 @@ I am a second line of code. </programlisting>I am no more code. </para>
 <biblioid class="pubsnumber">2</biblioid>
 <bibliomisc role="note">An optional note</bibliomisc>
 </biblioentry>
-
-<biblioentry xml:id="book"><title>The title of the work</title><volumenum>4</volumenum><edition>3</edition><bibliomisc role="type">book</bibliomisc>
-
-<publisher><publishername>The name of the publisher</publishername>
+<biblioentry xml:id="book">
+<title>The title of the work</title><volumenum>4</volumenum><edition>3</edition><bibliomisc role="type">book</bibliomisc>
+<publisher>
+<publishername>The name of the publisher</publishername>
 <address>The address</address></publisher>
 <pubdate>1993</pubdate>
-
-
-<authorgroup><author><personname><firstname>Peter</firstname>
+<authorgroup><author>
+<personname>
+<firstname>Peter</firstname>
 <surname>Babington</surname>
 </personname>
 </author>
 </authorgroup>
 <bibliomisc role="note">An optional note</bibliomisc>
 </biblioentry>
-
-<biblioentry xml:id="booklet"><title>The title of the work</title><bibliomisc role="type">booklet</bibliomisc>
+<biblioentry xml:id="booklet">
+<title>The title of the work</title><bibliomisc role="type">booklet</bibliomisc>
 <pubdate>1993</pubdate>
-
-
-<authorgroup><author><personname><firstname>Peter</firstname>
+<authorgroup><author>
+<personname>
+<firstname>Peter</firstname>
 <surname>Caxton</surname>
 </personname>
 </author>
 </authorgroup>
 </biblioentry>
-
-<biblioentry xml:id="conference"><title>The title of the work</title><artpagenums>213</artpagenums><bibliomisc role="type">conference</bibliomisc>
-
-<publisher><publishername>The publisher</publishername>
+<biblioentry xml:id="conference">
+<title>The title of the work</title><artpagenums>213</artpagenums><bibliomisc role="type">conference</bibliomisc>
+<publisher>
+<publishername>The publisher</publishername>
 </publisher>
 <pubdate>1993</pubdate>
-
-
-<authorgroup><author><personname><firstname>Peter</firstname>
+<authorgroup><author>
+<personname>
+<firstname>Peter</firstname>
 <surname>Draper</surname>
 </personname>
 </author>
 </authorgroup>
 </biblioentry>
-
-<biblioentry xml:id="inbook"><title>The title of the work</title><artpagenums>201-213</artpagenums><bibliomisc role="type">inbook</bibliomisc>
-
-<publisher><publishername>The name of the publisher</publishername>
+<biblioentry xml:id="inbook">
+<title>The title of the work</title><artpagenums>201-213</artpagenums><bibliomisc role="type">inbook</bibliomisc>
+<publisher>
+<publishername>The name of the publisher</publishername>
 </publisher>
 <pubdate>1993</pubdate>
-
-
-<authorgroup><author><personname><firstname>Peter</firstname>
+<authorgroup><author>
+<personname>
+<firstname>Peter</firstname>
 <surname>Eston</surname>
 </personname>
 </author>
 </authorgroup>
 </biblioentry>
-
-<biblioentry xml:id="incollection"><title>The title of the work</title><volumenum>4</volumenum><edition>3</edition><artpagenums>201-213</artpagenums><bibliomisc role="type">incollection</bibliomisc>
-
-<publisher><publishername>The name of the publisher</publishername>
+<biblioentry xml:id="incollection">
+<title>The title of the work</title><volumenum>4</volumenum><edition>3</edition><artpagenums>201-213</artpagenums><bibliomisc role="type">incollection</bibliomisc>
+<publisher>
+<publishername>The name of the publisher</publishername>
 <address>The address of the publisher</address></publisher>
 <pubdate>1993</pubdate>
-
-<biblioset relation="book"><title>The title of the book</title>
+<biblioset relation="book">
+<title>The title of the book</title>
 </biblioset>
-
-
-<authorgroup><author><personname><firstname>Peter</firstname>
+<authorgroup><author>
+<personname>
+<firstname>Peter</firstname>
 <surname>Farindon</surname>
 </personname>
 </author>
 </authorgroup>
 <bibliomisc role="note">An optional note</bibliomisc>
 </biblioentry>
-
-<biblioentry xml:id="small"><title>A small paper</title><volumenum>-1</volumenum><bibliomisc role="type">article</bibliomisc>
+<biblioentry xml:id="small">
+<title>A small paper</title><volumenum>-1</volumenum><bibliomisc role="type">article</bibliomisc>
 <pubdate>1997</pubdate>
-
-<biblioset relation="journal"><title>The journal of small papers</title>
+<biblioset relation="journal">
+<title>The journal of small papers</title>
 </biblioset>
-
-
-<authorgroup><author><personname><surname>Freely</surname>
+<authorgroup><author>
+<personname>
+<surname>Freely</surname>
 <othername role="suffix">I. P.</othername>
 </personname>
 </author>
-
-
-<author><personname><firstname>Ditto</firstname>
+<author>
+<personname>
+<firstname>Ditto</firstname>
 <surname>Johannes</surname>
 </personname>
 </author>
 </authorgroup>
 <bibliomisc role="note">to appear</bibliomisc>
 </biblioentry>
-
-<biblioentry xml:id="Gro60."><title>Éléments de géométrie algébrique</title><bibliomisc role="type">book</bibliomisc>
+<biblioentry xml:id="Gro60">
+<title>Éléments de géométrie algébrique</title><bibliomisc role="type">book</bibliomisc>
 <pubdate>1960</pubdate>
-
-
-<authorgroup><author><personname><firstname>Alexander</firstname>
+<authorgroup><author>
+<personname>
+<firstname>Alexander</firstname>
 <surname>Grothendieck</surname>
 </personname>
 </author>
 </authorgroup>
 </biblioentry>
-
-<biblioentry xml:id="big"><title>A big paper</title><volumenum>MCMXCVII</volumenum><bibliomisc role="type">article</bibliomisc>
+<biblioentry xml:id="big">
+<title>A big paper</title><volumenum>MCMXCVII</volumenum><bibliomisc role="type">article</bibliomisc>
 <pubdate>7991</pubdate>
-
-<biblioset relation="journal"><title>The journal of big papers</title>
+<biblioset relation="journal">
+<title>The journal of big papers</title>
 </biblioset>
-
-
-<authorgroup><author><personname><firstname>Hugh</firstname>
+<authorgroup><author>
+<personname>
+<firstname>Hugh</firstname>
 <surname>Jass</surname>
 </personname>
 </author>
diff --git a/autotests/export/docbook/easy.lyx b/autotests/export/docbook/easy.lyx
new file mode 100644
index 0000000..0ea08e7
--- /dev/null
+++ b/autotests/export/docbook/easy.lyx
@@ -0,0 +1,253 @@
+#LyX 2.4 created this file. For more info see https://www.lyx.org/
+\lyxformat 598
+\begin_document
+\begin_header
+\save_transient_properties true
+\origin unavailable
+\textclass article
+\begin_preamble
+\newcommand{\testmacro}{\ensuremath{\operatorname{testmacro}}}
+\end_preamble
+\use_default_options true
+\maintain_unincluded_children no
+\language english
+\language_package default
+\inputencoding auto-legacy
+\fontencoding auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
+\font_default_family default
+\use_non_tex_fonts false
+\font_sc false
+\font_roman_osf false
+\font_sans_osf false
+\font_typewriter_osf false
+\font_sf_scale 100 100
+\font_tt_scale 100 100
+\use_microtype false
+\use_dash_ligatures true
+\graphics default
+\default_output_format default
+\output_sync 0
+\bibtex_command default
+\index_command default
+\paperfontsize default
+\spacing single
+\use_hyperref false
+\papersize default
+\use_geometry false
+\use_package amsmath 1
+\use_package amssymb 1
+\use_package cancel 1
+\use_package esint 1
+\use_package mathdots 1
+\use_package mathtools 1
+\use_package mhchem 1
+\use_package stackrel 1
+\use_package stmaryrd 1
+\use_package undertilde 1
+\cite_engine basic
+\cite_engine_type default
+\biblio_style plain
+\use_bibtopic false
+\use_indices true
+\paperorientation portrait
+\suppress_date false
+\justification true
+\use_refstyle 1
+\use_minted 0
+\use_lineno 0
+\index Index
+\shortcut idx
+\color #008000
+\end_index
+\index Other index
+\shortcut oth
+\color #cc0000
+\end_index
+\secnumdepth 3
+\tocdepth 3
+\paragraph_separation indent
+\paragraph_indentation default
+\is_math_indent 0
+\math_numbering_side default
+\quotes_style english
+\dynamic_quotes 0
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\tablestyle default
+\tracking_changes false
+\output_changes false
+\change_bars false
+\postpone_fragile_content false
+\html_math_output 0
+\html_css_as_file 0
+\html_be_strict false
+\docbook_table_output 0
+\end_header
+
+\begin_body
+
+\begin_layout Title
+I am a title
+\end_layout
+
+\begin_layout Author
+I am an author
+\end_layout
+
+\begin_layout Date
+I am a date
+\end_layout
+
+\begin_layout Abstract
+I am an abstract
+\end_layout
+
+\begin_layout Abstract
+I am also an abstract
+\end_layout
+
+\begin_layout Section
+I am the first section 
+\begin_inset CommandInset label
+LatexCommand label
+name "sec:Sec-1"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+I am the first paragraph of the first section.
+ 
+\end_layout
+
+\begin_layout Standard
+I am the second paragraph of the first section.
+ 
+\end_layout
+
+\begin_layout Quote
+I am a quote
+\begin_inset Formula $\,with\,a\,formula$
+\end_inset
+
+.
+ 
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula 
+\[
+Formula!
+\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+I am the first subsection
+\end_layout
+
+\begin_layout Standard
+I am the only paragraph of the first subsection.
+ 
+\end_layout
+
+\begin_layout Subsection
+I am the second subsection
+\end_layout
+
+\begin_layout Standard
+I am the only paragraph of the second subsection.
+ 
+\end_layout
+
+\begin_layout Section
+I am the second section 
+\end_layout
+
+\begin_layout Standard
+I am the only paragraph of the second section.
+ 
+\begin_inset CommandInset href
+LatexCommand href
+name "Hyperlink."
+target "http://example.org"
+literal "false"
+
+\end_inset
+
+ 
+\begin_inset Quotes eld
+\end_inset
+
+Text between quotes.
+\begin_inset Quotes erd
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+See 
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "sec:Sec-1"
+plural "false"
+caps "false"
+noprefix "false"
+
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Section
+I am the third section and I deal with star sections
+\end_layout
+
+\begin_layout Part*
+Star part
+\end_layout
+
+\begin_layout Section*
+Star section (sect1)
+\end_layout
+
+\begin_layout Subsection*
+Star subsection (sect2)
+\end_layout
+
+\begin_layout Subsubsection*
+Star subsubsection (sect3)
+\end_layout
+
+\begin_layout Paragraph*
+Star paragraph (sect4)
+\end_layout
+
+\begin_layout Subparagraph*
+Star subparagraph (sect5)
+\end_layout
+
+\begin_layout Standard
+\begin_inset CommandInset bibtex
+LatexCommand bibtex
+bibfiles "basic"
+options "plain"
+
+\end_inset
+
+
+\end_layout
+
+\end_body
+\end_document
diff --git a/autotests/export/docbook/easy.xml b/autotests/export/docbook/easy.xml
new file mode 100644
index 0000000..883c982
--- /dev/null
+++ b/autotests/export/docbook/easy.xml
@@ -0,0 +1,68 @@
+<?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 -->
+<article 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>I am a title</title>
+<author>
+<personname>I am an author</personname>
+</author>
+<date>I am a date</date>
+<abstract>
+<para>I am an abstract</para>
+<para>I am also an abstract</para>
+</abstract>
+</info>
+<section xml:id="sec.Sec-1-0">
+<title>I am the first section </title>
+<para>I am the first paragraph of the first section. </para>
+<para>I am the second paragraph of the first section. </para>
+<blockquote>
+<para>I am a quote<inlineequation>
+<alt role='tex'>\,with\,a\,formula</alt>
+ <m:math>
+ 
+ <m:mrow>
+  <m:mrow><m:mspace width="6px" /><m:mi>w</m:mi><m:mi>i</m:mi><m:mi>t</m:mi><m:mi>h</m:mi><m:mspace width="6px" /><m:mi>a</m:mi><m:mspace width="6px" /><m:mi>f</m:mi><m:mi>o</m:mi><m:mi>r</m:mi><m:mi>m</m:mi><m:mi>u</m:mi><m:mi>l</m:mi><m:mi>a</m:mi>
+  </m:mrow>
+ </m:mrow>
+ </m:math>
+</inlineequation>. </para>
+</blockquote>
+<informalequation>
+<alt role='tex'>Formula!</alt>
+ <m:math>
+ 
+ <m:mrow>
+  <m:mrow><m:mi>F</m:mi><m:mi>o</m:mi><m:mi>r</m:mi><m:mi>m</m:mi><m:mi>u</m:mi><m:mi>l</m:mi><m:mi>a</m:mi><m:mo>!</m:mo>
+  </m:mrow>
+ </m:mrow>
+ </m:math>
+</informalequation><section>
+<title>I am the first subsection</title>
+<para>I am the only paragraph of the first subsection. </para>
+</section>
+<section>
+<title>I am the second subsection</title>
+<para>I am the only paragraph of the second subsection. </para>
+</section>
+</section>
+<section>
+<title>I am the second section </title>
+<para>I am the only paragraph of the second section. <link xlink:href="http://example.org">Hyperlink.</link> “Text between quotes.”</para>
+<para>See <xref linkend="sec.Sec-1-0" />.</para>
+</section>
+<section>
+<title>I am the third section and I deal with star sections</title>
+<bridgehead renderas='other' otherrenderas='part'>Star part</bridgehead>
+<bridgehead renderas="sect1">Star section (sect1)</bridgehead>
+<bridgehead renderas="sect2">Star subsection (sect2)</bridgehead>
+<bridgehead renderas="sect3">Star subsubsection (sect3)</bridgehead>
+<bridgehead renderas="sect4">Star paragraph (sect4)</bridgehead>
+<bridgehead renderas="sect5">Star subparagraph (sect5)</bridgehead>
+</section>
+<bibliography>
+<title>References</title>
+<!-- No entry in the bibliography. -->
+</bibliography>
+</article>
\ No newline at end of file
diff --git a/autotests/export/docbook/lists.lyx b/autotests/export/docbook/lists.lyx
index 4e46d70..f903372 100644
--- a/autotests/export/docbook/lists.lyx
+++ b/autotests/export/docbook/lists.lyx
@@ -87,7 +87,23 @@ Test document
 \end_layout
 
 \begin_layout Standard
-A list:
+A simple list: 
+\end_layout
+
+\begin_layout Itemize
+First item
+\end_layout
+
+\begin_layout Itemize
+Second item on two lines
+\begin_inset Newline newline
+\end_inset
+
+I'm the second line
+\end_layout
+
+\begin_layout Standard
+A complex list:
 \end_layout
 
 \begin_layout Itemize
diff --git a/autotests/export/docbook/lists.xml b/autotests/export/docbook/lists.xml
index a00ab4f..4621e30 100644
--- a/autotests/export/docbook/lists.xml
+++ b/autotests/export/docbook/lists.xml
@@ -2,33 +2,61 @@
 <!-- This DocBook file was created by LyX 2.4.0dev
   See http://www.lyx.org/ for more information -->
 <article 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">
-<title>Test document</title>
-<para>A list:</para>
+<title>
+Test document
+</title>
+<para>
+A simple list: 
+</para>
 <itemizedlist>
 <listitem>
 <para>First item</para>
+</listitem>
+<listitem>
+<para>Second item on two lines<!-- Is para open? yes --><!-- Output Error: Closing tag `para' when other tags are open, namely: -->
+<!-- Output Error: &LyX_parsep_tag& -->
+</para>
+<para>I'm the second line<!-- Output Error: Tags still open in closeFontTags(). Probably not a problem,
+but you might want to check these tags: -->
+<!-- Output Error: para -->
+<!-- Output Error: listitem -->
+<!-- Output Error: itemizedlist -->
+<!-- Output Error: No division separation tag found in endDivision(). -->
+</para>
+</listitem>
+</itemizedlist>
+<para>
+A complex list:
+</para>
 <itemizedlist>
 <listitem>
+<para>First item</para>
+</listitem>
+<listitem>
 <para>First first item</para>
 </listitem>
 <listitem>
 <para>First second item</para>
 </listitem>
 </itemizedlist>
-<para>Text after first item</para>
-</listitem>
+<para>
+Text after first item
+</para>
+<itemizedlist>
 <listitem>
 <para>Second item</para>
-<orderedlist>
-<listitem>
+</listitem>
+</itemizedlist>
+<orderedlist><listitem>
 <para>Second first item</para>
 </listitem>
-<listitem>
+</orderedlist>
+<orderedlist><listitem>
 <para>Second second item</para>
 </listitem>
 </orderedlist>
-<para>Text after second item</para>
-</listitem>
-</itemizedlist>
+<para>
+Text after second item
+</para>
 
 </article>
\ No newline at end of file
diff --git a/lib/layouts/stdlayouts.inc b/lib/layouts/stdlayouts.inc
index 3b10ff4..1670695 100644
--- a/lib/layouts/stdlayouts.inc
+++ b/lib/layouts/stdlayouts.inc
@@ -28,8 +28,9 @@ Style Quotation
 	AlignPossible         Block, Left, Right, Center
 	HTMLTag               blockquote
 	HTMLItem              div
-	DocBookTag            blockquote
-	DocBookItemTag        para
+	DocBookWrapperTag     blockquote
+	DocBookWrapperMergeWithPrevious    true
+	DocBookTag            para
 End
 
 
@@ -50,8 +51,9 @@ Style Quote
 	LabelType             No_Label
 	HTMLTag               blockquote
 	HTMLItem              div
-	DocBookTag            blockquote
-	DocBookItemTag        para
+	DocBookWrapperTag     blockquote
+	DocBookWrapperMergeWithPrevious    true
+	DocBookTag            para
 End
 
 
diff --git a/lib/layouts/stdlists.inc b/lib/layouts/stdlists.inc
index 0eef65c..16a9e81 100644
--- a/lib/layouts/stdlists.inc
+++ b/lib/layouts/stdlists.inc
@@ -43,7 +43,9 @@ Style Itemize
 			Color latex
 		EndFont
 	EndArgument
-	DocBookTag            itemizedlist
+	DocBookWrapperTag     itemizedlist
+	DocBookWrapperMergeWithPrevious    true
+	DocBookTag            NONE
 	DocBookItemTag        listitem
 	DocBookItemInnerTag   para
 End
diff --git a/lib/layouts/stdstarsections.inc b/lib/layouts/stdstarsections.inc
index 7d6865f..60354b1 100644
--- a/lib/layouts/stdstarsections.inc
+++ b/lib/layouts/stdstarsections.inc
@@ -19,7 +19,7 @@ Style Part*
 	LabelCounter	""
 	ResetArgs       1
 	DocBookTag            bridgehead
-	DocBookAttr           renderas="part"
+	DocBookAttr           "renderas='other' otherrenderas='part'"
 	DocBookSectionTag     NONE
 	DocBookForceAbstractTag	NONE
 End
@@ -34,7 +34,7 @@ Style Chapter*
 	LabelCounter	""
 	ResetArgs       1
 	DocBookTag            bridgehead
-	DocBookAttr           renderas="chapter"
+	DocBookAttr           "renderas='other' otherrenderas='chapter'"
 	DocBookSectionTag     NONE
 	DocBookForceAbstractTag	NONE
 End
diff --git a/lib/layouts/stdstruct.inc b/lib/layouts/stdstruct.inc
index b02499f..c8b7eb4 100644
--- a/lib/layouts/stdstruct.inc
+++ b/lib/layouts/stdstruct.inc
@@ -51,8 +51,9 @@ Style Abstract
 	EndHTMLStyle
 	DocBookAbstract       true
 	DocBookInInfo         always
-	DocBookTag            abstract
-	DocBookItemTag        para
+	DocBookWrapperTag     abstract
+	DocBookWrapperMergeWithPrevious    true
+	DocBookTag            para
 End
 
 
diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index dcba46a..e511985 100644
--- a/src/Paragraph.cpp
+++ b/src/Paragraph.cpp
@@ -3370,12 +3370,9 @@ void Paragraph::simpleDocBookOnePar(Buffer const & buf,
 			if (!runparams.for_toc || inset->isInToc()) {
 				OutputParams np = runparams;
 				np.local_font = &font;
-				// If the paragraph has size 1, then we are in the "special
-				// case" where we do not output the containing paragraph info.
-				// This "special case" is defined in more details in output_docbook.cpp, makeParagraphs. The results
-				// of that brittle logic is passed to this function through open_par.
-				if (!inset->getLayout().htmlisblock() && size() != 1) // TODO: htmlisblock here too!
-					np.docbook_in_par = true;
+
+				// TODO: special case will bite here.
+				np.docbook_in_par = true;
 				inset->docbook(xs, np);
 			}
 		} else {
diff --git a/src/ParagraphList.h b/src/ParagraphList.h
index a57deb4..7e5cc1a 100644
--- a/src/ParagraphList.h
+++ b/src/ParagraphList.h
@@ -29,6 +29,17 @@ public:
 	ParagraphList(InputIterator first, InputIterator last)
 		: RandomAccessList<Paragraph>(first, last)
 	{}
+
+	const Paragraph * getParagraphBefore(const_iterator const & par) const
+	{
+		// No previous paragraph.
+		if (par == begin())
+			return nullptr;
+
+		auto prevpar = par;
+		--prevpar;
+		return &*prevpar;
+	}
 };
 
 } // namespace lyx
diff --git a/src/insets/InsetBibtex.cpp b/src/insets/InsetBibtex.cpp
index 34b22c1..c03a8e2 100644
--- a/src/insets/InsetBibtex.cpp
+++ b/src/insets/InsetBibtex.cpp
@@ -1157,10 +1157,11 @@ void InsetBibtex::docbook(XMLStream & xs, OutputParams const &) const
 
 	if (vit == ven) {
 		xs << XMLStream::ESCAPE_NONE << "<!-- No entry in the bibliography. -->";
+		xs << xml::CR();
 	}
 
 	for (; vit != ven; ++vit) {
-		BiblioInfo::const_iterator const biit = bibinfo.find(*vit);
+		auto const biit = bibinfo.find(*vit);
 		if (biit == bibinfo.end())
 			continue;
 
diff --git a/src/insets/InsetERT.cpp b/src/insets/InsetERT.cpp
index a023f7a..8e69e88 100644
--- a/src/insets/InsetERT.cpp
+++ b/src/insets/InsetERT.cpp
@@ -101,7 +101,7 @@ void InsetERT::docbook(XMLStream & xs, OutputParams const & runparams) const
 	odocstringstream os2;
 	XMLStream xs2(os2);
 
-	// Recreate the logic of makeParagraphs in output_docbook.cpp, but much simplified: never open <para>
+	// Recreate the logic of makeParagraph in output_docbook.cpp, but much simplified: never open <para>
 	// in an ERT, use simple line breaks.
 	while (par != end) {
 		par->simpleDocBookOnePar(buffer(), xs2, runparams, text().outerFont(distance(begin, par)));
@@ -116,6 +116,7 @@ void InsetERT::docbook(XMLStream & xs, OutputParams const & runparams) const
 	xs << XMLStream::ESCAPE_NONE << "<!-- ";
 	xs << XMLStream::ESCAPE_COMMENTS << os2.str();
 	xs << XMLStream::ESCAPE_NONE << " -->";
+	xs << xml::CR();
 }
 
 
diff --git a/src/insets/InsetNewline.cpp b/src/insets/InsetNewline.cpp
index 45d52b2..00b276e 100644
--- a/src/insets/InsetNewline.cpp
+++ b/src/insets/InsetNewline.cpp
@@ -176,17 +176,18 @@ void InsetNewline::docbook(XMLStream & xs, OutputParams const & runparams) const
 {
 	if (runparams.docbook_in_par) {
 		xs.closeFontTags();
-		if (!xs.pending_tags_empty()) {
-			xs << xml::EndTag("para");
-			xs << xml::StartTag("para");
-		}
-		else {
-			xs << xml::CR() << xml::CompTag("br") << xml::CR();
-		}
-	}
-	else {
-		xs << xml::CR() << xml::CompTag("br") << xml::CR();
+
+		// TODO: what if within a list item, and docbookiteminnertag is not para? This would require information
+		// about the paragraph's layout... Good for now, though, this should not happen in DocBook, only maybe
+		// extensions.
+		xs << XMLStream::ESCAPE_NONE << from_utf8("<!-- Is para open? " + string((xs.isTagOpen(xml::StartTag("para"))) ? "yes" : "no") +" -->");
+		xs << XMLStream::ESCAPE_NONE << from_utf8("</para>\n<para");
+		// TODO: that's a hack...
+//		xs << xml::EndTag("para");
+//		xs << xml::CR();
+//		xs << xml::StartTag("para");
 	}
+	// Outside a paragraph, no need to handle new lines.
 }
 
 
diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp
index 068854b..2cecba9 100644
--- a/src/mathed/InsetMathHull.cpp
+++ b/src/mathed/InsetMathHull.cpp
@@ -2461,7 +2461,8 @@ void InsetMathHull::docbook(XMLStream & xs, OutputParams const & runparams) cons
 		osmath << ostmp.str(); // osmath is not a XMLStream, so no need for XMLStream::ESCAPE_NONE.
 		ms << ETag("math");
 	} catch (MathExportException const &) {
-		osmath << "MathML export failed. Please report this as a bug.";
+		ms.cr();
+		osmath << "<mathphrase>MathML export failed. Please report this as a bug.</mathphrase>";
 	}
 
 	// Output the complete formula to the DocBook stream.
diff --git a/src/output_docbook.cpp b/src/output_docbook.cpp
index 4430041..b29da56 100644
--- a/src/output_docbook.cpp
+++ b/src/output_docbook.cpp
@@ -43,6 +43,8 @@
 #include <algorithm>
 #include <sstream>
 
+// #define DOCBOOK_DEBUG_NEWLINES
+
 using namespace std;
 using namespace lyx::support;
 
@@ -191,6 +193,10 @@ namespace {
 
 void openParTag(XMLStream & xs, const Paragraph * par, const Paragraph * prevpar)
 {
+#ifdef DOCBOOK_DEBUG_NEWLINES
+	xs << XMLStream::ESCAPE_NONE << "<!-- openParTag -->";
+#endif
+
 	Layout const & lay = par->layout();
 
 	if (par == prevpar)
@@ -212,29 +218,43 @@ void openParTag(XMLStream & xs, const Paragraph * par, const Paragraph * prevpar
 	}
 
 	// Main logic.
-	if (openWrapper)
+	if (openWrapper) {
 		xs << xml::StartTag(lay.docbookwrappertag(), lay.docbookwrapperattr());
+		xs << xml::CR();
+	}
 
 	string tag = lay.docbooktag();
-	if (tag == "Plain Layout")
-		tag = "para";
-
-	if (!xs.isTagOpen(xml::ParTag(tag, lay.docbookattr()), 1)) // Don't nest a paragraph directly in a paragraph.
-		xs << xml::ParTag(tag, lay.docbookattr());
+	if (tag != "NONE") {
+		auto xmltag = xml::ParTag(tag, lay.docbookattr());
+		if (!xs.isTagOpen(xmltag, 1)) // Don't nest a paragraph directly in a paragraph. TODO: required or not?
+			xs << xmltag;
+	}
 
-	if (lay.docbookitemtag() != "NONE")
+	if (lay.docbookitemtag() != "NONE") {
 		xs << xml::StartTag(lay.docbookitemtag(), lay.docbookitemattr());
+		xs << xml::CR();
+	}
+
+	if (lay.docbookiteminnertag() != "NONE")
+		xs << xml::StartTag(lay.docbookiteminnertag(), lay.docbookiteminnerattr());
+
+#ifdef DOCBOOK_DEBUG_NEWLINES
+	xs << XMLStream::ESCAPE_NONE << "<!-- /openParTag -->";
+#endif
 }
 
 
-void closeTag(XMLStream & xs, Paragraph const * par, Paragraph const * nextpar)
+void closeParTag(XMLStream & xs, Paragraph const * par, Paragraph const * nextpar)
 {
-	Layout const & lay = par->layout();
+#ifdef DOCBOOK_DEBUG_NEWLINES
+	xs << XMLStream::ESCAPE_NONE << "<!-- closeParTag -->";
+#endif
 
 	if (par == nextpar)
 		nextpar = nullptr;
 
 	// See comment in openParTag.
+	Layout const & lay = par->layout();
 	bool closeWrapper = lay.docbookwrappertag() != "NONE";
 	if (nextpar != nullptr) {
 		Layout const & nextlay = nextpar->layout();
@@ -245,132 +265,133 @@ void closeTag(XMLStream & xs, Paragraph const * par, Paragraph const * nextpar)
 	}
 
 	// Main logic.
-	if (lay.docbookitemtag() != "NONE")
+	if (lay.docbookiteminnertag() != "NONE") {
+		xs << xml::EndTag(lay.docbookiteminnertag());
+		xs << xml::CR();
+	}
+
+	if (lay.docbookitemtag() != "NONE") {
 		xs << xml::EndTag(lay.docbookitemtag());
+		xs << xml::CR();
+	}
 
-	string tag = lay.docbooktag();
-	if (tag == "Plain Layout")
-		tag = "para";
+	if (lay.docbooktag() != "NONE") {
+		xs << xml::EndTag(lay.docbooktag());
+		xs << xml::CR();
+	}
 
-	xs << xml::EndTag(tag);
-	if (closeWrapper)
+	if (closeWrapper) {
 		xs << xml::EndTag(lay.docbookwrappertag());
-}
-
+		xs << xml::CR();
+	}
 
-void openLabelTag(XMLStream & xs, Layout const & lay) // Mostly for definition lists.
-{
-	xs << xml::StartTag(lay.docbookitemlabeltag(), lay.docbookitemlabelattr());
+#ifdef DOCBOOK_DEBUG_NEWLINES
+	xs << XMLStream::ESCAPE_NONE << "<!-- /closeParTag -->";
+#endif
 }
 
 
-void closeLabelTag(XMLStream & xs, Layout const & lay)
+void openBlockTag(XMLStream & xs, const Paragraph * par, const Paragraph * prevpar)
 {
-	xs << xml::EndTag(lay.docbookitemlabeltag());
-	xs << xml::CR();
-}
+#ifdef DOCBOOK_DEBUG_NEWLINES
+	xs << XMLStream::ESCAPE_NONE << "<!-- openBlockTag -->";
+#endif
 
+	// Similar as openParTag, but with a line feed after.
+	openParTag(xs, par, prevpar);
+	xs << xml::CR();
 
-void openItemTag(XMLStream & xs, Layout const & lay)
-{
-	xs << xml::StartTag(lay.docbookitemtag(), lay.docbookitemattr());
+#ifdef DOCBOOK_DEBUG_NEWLINES
+	xs << XMLStream::ESCAPE_NONE << "<!-- /openBlockTag -->";
+#endif
 }
 
 
-// Return true when new elements are output in a paragraph, false otherwise.
-bool openInnerItemTag(XMLStream & xs, Layout const & lay)
+void closeBlockTag(XMLStream & xs, const Paragraph * par, const Paragraph * prevpar)
 {
-	if (lay.docbookiteminnertag() != "NONE") {
-		xs << xml::CR();
-		xs << xml::ParTag(lay.docbookiteminnertag(), lay.docbookiteminnerattr());
+#ifdef DOCBOOK_DEBUG_NEWLINES
+	xs << XMLStream::ESCAPE_NONE << "<!-- closeBlockTag -->";
+#endif
 
-		if (lay.docbookiteminnertag() == "para") {
-			return true;
-		}
-	}
-	return false;
+	// Similar as closeParTag, but with a line feed before.
+	xs << xml::CR();
+	closeParTag(xs, par, prevpar);
+
+#ifdef DOCBOOK_DEBUG_NEWLINES
+	xs << XMLStream::ESCAPE_NONE << "<!-- /closeBlockTag -->";
+#endif
 }
 
 
-void closeInnerItemTag(XMLStream & xs, Layout const & lay)
+void openLabelTag(XMLStream & xs, Layout const & lay) // Mostly for definition lists.
 {
-	if (lay.docbookiteminnertag()!= "NONE") {
-		xs << xml::EndTag(lay.docbookiteminnertag());
-		xs << xml::CR();
-	}
+#ifdef DOCBOOK_DEBUG_NEWLINES
+	xs << XMLStream::ESCAPE_NONE << "<!-- openLabelTag -->";
+#endif
+
+	xs << xml::StartTag(lay.docbookitemlabeltag(), lay.docbookitemlabelattr());
+
+#ifdef DOCBOOK_DEBUG_NEWLINES
+	xs << XMLStream::ESCAPE_NONE << "<!-- /openLabelTag -->";
+#endif
 }
 
 
-inline void closeItemTag(XMLStream & xs, Layout const & lay)
+void closeLabelTag(XMLStream & xs, Layout const & lay)
 {
-	xs << xml::EndTag(lay.docbookitemtag());
+#ifdef DOCBOOK_DEBUG_NEWLINES
+	xs << XMLStream::ESCAPE_NONE << "<!-- closeLabelTag -->";
+#endif
+
+	xs << xml::EndTag(lay.docbookitemlabeltag());
 	xs << xml::CR();
-}
 
-// end of convenience functions
+#ifdef DOCBOOK_DEBUG_NEWLINES
+	xs << XMLStream::ESCAPE_NONE << "<!-- closeLabelTag -->";
+#endif
+}
 
-ParagraphList::const_iterator findLast(
-		ParagraphList::const_iterator p,
-		ParagraphList::const_iterator const & pend,
-		LatexType type) {
-	for (++p; p != pend && p->layout().latextype == type; ++p);
 
-	return p;
-}
+void openItemTag(XMLStream & xs, Layout const & lay)
+{
+#ifdef DOCBOOK_DEBUG_NEWLINES
+	xs << XMLStream::ESCAPE_NONE << "<!-- openItemTag -->";
+#endif
 
-ParagraphList::const_iterator findLastBibliographyParagraph(
-		ParagraphList::const_iterator p,
-		ParagraphList::const_iterator const & pend) {
-	for (++p; p != pend && p->layout().latextype == LATEX_BIB_ENVIRONMENT; ++p);
+	xs << xml::StartTag(lay.docbookitemtag(), lay.docbookitemattr());
 
-	return p;
+#ifdef DOCBOOK_DEBUG_NEWLINES
+	xs << XMLStream::ESCAPE_NONE << "<!-- /openItemTag -->";
+#endif
 }
 
 
-ParagraphList::const_iterator findEndOfEnvironment(
-		ParagraphList::const_iterator const & pstart,
-		ParagraphList::const_iterator const & pend)
+void closeItemTag(XMLStream & xs, Layout const & lay)
 {
-	ParagraphList::const_iterator p = pstart;
-	size_t const depth = p->params().depth();
-
-	for (++p; p != pend; ++p) {
-		Layout const &style = p->layout();
-		// It shouldn't happen that e.g. a section command occurs inside
-		// a quotation environment, at a higher depth, but as of 6/2009,
-		// it can happen. We pretend that it's just at lowest depth.
-		if (style.latextype == LATEX_COMMAND)
-			return p;
-
-		// If depth is down, we're done
-		if (p->params().depth() < depth)
-			return p;
-
-		// If depth is up, we're not done
-		if (p->params().depth() > depth)
-			continue;
+#ifdef DOCBOOK_DEBUG_NEWLINES
+	xs << XMLStream::ESCAPE_NONE << "<!-- closeItemTag -->";
+#endif
 
-		// FIXME I am not sure about the first check.
-		// Surely we *could* have different layouts that count as
-		// LATEX_PARAGRAPH, right?
-		if (style.latextype == LATEX_PARAGRAPH || style != p->layout())
-			return p;
-	}
+	xs << xml::EndTag(lay.docbookitemtag());
+	xs << xml::CR();
 
-	return pend;
+#ifdef DOCBOOK_DEBUG_NEWLINES
+	xs << XMLStream::ESCAPE_NONE << "<!-- /closeItemTag -->";
+#endif
 }
 
 
-ParagraphList::const_iterator makeParagraphBibliography(
-		Buffer const &buf,
-		XMLStream &xs,
-		OutputParams const &runparams,
-		Text const &text,
-		ParagraphList::const_iterator const & pbegin,
-		ParagraphList::const_iterator const & pend)
+void makeParagraphBibliography(
+		Buffer const & buf,
+		XMLStream & xs,
+		OutputParams const & runparams,
+		Text const & text,
+		ParagraphList::const_iterator const & pbegin)
 {
 	auto const begin = text.paragraphs().begin();
 	auto const end = text.paragraphs().end();
+	auto pend = pbegin;
+	++pend;
 
 	// Find the paragraph *before* pbegin.
 	ParagraphList::const_iterator pbegin_before = begin;
@@ -420,322 +441,203 @@ ParagraphList::const_iterator makeParagraphBibliography(
 		xs << xml::EndTag("bibliography");
 		xs << xml::CR();
 	}
-
-	return pend;
 }
 
 
-ParagraphList::const_iterator makeParagraphs(
-		Buffer const &buf,
-		XMLStream &xs,
-		OutputParams const &runparams,
-		Text const &text,
-		ParagraphList::const_iterator const & pbegin,
-		ParagraphList::const_iterator const & pend)
+void makeParagraph(
+		Buffer const & buf,
+		XMLStream & xs,
+		OutputParams const & runparams,
+		Text const & text,
+		ParagraphList::const_iterator const & par)
 {
 	auto const begin = text.paragraphs().begin();
 	auto const end = text.paragraphs().end();
-	ParagraphList::const_iterator par = pbegin;
-	ParagraphList::const_iterator prevpar = pbegin;
-
-	for (; par != pend; prevpar = par, ++par) {
-		// We want to open the paragraph tag if:
-		//   (i) the current layout permits multiple paragraphs
-		//  (ii) we are either not already inside a paragraph (HTMLIsBlock) OR
-		//	   we are, but this is not the first paragraph
-		//
-		// But there is also a special case, and we first see whether we are in it.
-		// We do not want to open the paragraph tag if this paragraph contains
-		// only one item, and that item is "inline", i.e., not HTMLIsBlock (such
-		// as a branch). On the other hand, if that single item has a font change
-		// applied to it, then we still do need to open the paragraph.
-		//
-		// Obviously, this is very fragile. The main reason we need to do this is
-		// because of branches, e.g., a branch that contains an entire new section.
-		// We do not really want to wrap that whole thing in a <div>...</div>.
-		bool special_case = false;
-		Inset const *specinset = par->size() == 1 ? par->getInset(0) : nullptr;
-		if (specinset && !specinset->getLayout().htmlisblock()) { // TODO: Convert htmlisblock to a DocBook parameter?
-			Layout const &style = par->layout();
-			FontInfo const first_font = style.labeltype == LABEL_MANUAL ?
-										style.labelfont : style.font;
-			FontInfo const our_font =
-					par->getFont(buf.masterBuffer()->params(), 0,
-								 text.outerFont(distance(begin, par))).fontInfo();
-
-			if (first_font == our_font)
-				special_case = true;
-		}
+	auto prevpar = text.paragraphs().getParagraphBefore(par);
+
+	// We want to open the paragraph tag if:
+	//   (i) the current layout permits multiple paragraphs
+	//  (ii) we are either not already inside a paragraph (HTMLIsBlock) OR
+	//	   we are, but this is not the first paragraph
+	//
+	// But there is also a special case, and we first see whether we are in it.
+	// We do not want to open the paragraph tag if this paragraph contains
+	// only one item, and that item is "inline", i.e., not HTMLIsBlock (such
+	// as a branch). On the other hand, if that single item has a font change
+	// applied to it, then we still do need to open the paragraph.
+	//
+	// Obviously, this is very fragile. The main reason we need to do this is
+	// because of branches, e.g., a branch that contains an entire new section.
+	// We do not really want to wrap that whole thing in a <div>...</div>.
+	bool special_case = false;
+	Inset const *specinset = par->size() == 1 ? par->getInset(0) : nullptr;
+	if (specinset && !specinset->getLayout().htmlisblock()) { // TODO: Convert htmlisblock to a DocBook parameter?
+		Layout const &style = par->layout();
+		FontInfo const first_font = style.labeltype == LABEL_MANUAL ?
+									style.labelfont : style.font;
+		FontInfo const our_font =
+				par->getFont(buf.masterBuffer()->params(), 0,
+							 text.outerFont(std::distance(begin, par))).fontInfo();
 
-		// Plain layouts must be ignored.
-		if (!special_case && buf.params().documentClass().isPlainLayout(par->layout()) && !runparams.docbook_force_pars)
+		if (first_font == our_font)
 			special_case = true;
-		// TODO: Could get rid of this with a DocBook equivalent to htmlisblock?
-		if (!special_case && par->size() == 1 && par->getInset(0)) {
-			Inset const * firstInset = par->getInset(0);
+	}
+
+	// Plain layouts must be ignored.
+	if (!special_case && buf.params().documentClass().isPlainLayout(par->layout()) && !runparams.docbook_force_pars)
+		special_case = true;
+	// TODO: Could get rid of this with a DocBook equivalent to htmlisblock?
+	if (!special_case && par->size() == 1 && par->getInset(0)) {
+		Inset const * firstInset = par->getInset(0);
 
-			// Floats cannot be in paragraphs.
-			special_case = to_utf8(firstInset->layoutName()).substr(0, 6) == "Float:";
+		// Floats cannot be in paragraphs.
+		special_case = to_utf8(firstInset->layoutName()).substr(0, 6) == "Float:";
 
-			// Bibliographies cannot be in paragraphs.
-			if (!special_case && firstInset->asInsetCommand())
-				special_case = firstInset->asInsetCommand()->params().getCmdName() == "bibtex";
+		// Bibliographies cannot be in paragraphs.
+		if (!special_case && firstInset->asInsetCommand())
+			special_case = firstInset->asInsetCommand()->params().getCmdName() == "bibtex";
 
-			// Equations do not deserve their own paragraph (DocBook allows them outside paragraphs).
-			if (!special_case && firstInset->asInsetMath())
-				special_case = true;
+		// Equations do not deserve their own paragraph (DocBook allows them outside paragraphs).
+		if (!special_case && firstInset->asInsetMath())
+			special_case = true;
 
-			// ERTs are in comments, not paragraphs.
-			if (!special_case && firstInset->lyxCode() == lyx::ERT_CODE)
-				special_case = true;
+		// ERTs are in comments, not paragraphs.
+		if (!special_case && firstInset->lyxCode() == lyx::ERT_CODE)
+			special_case = true;
 
-			// Listings should not get into their own paragraph.
-			if (!special_case && firstInset->lyxCode() == lyx::LISTINGS_CODE)
-				special_case = true;
-		}
+		// Listings should not get into their own paragraph.
+		if (!special_case && firstInset->lyxCode() == lyx::LISTINGS_CODE)
+			special_case = true;
+	}
 
-		bool const open_par = runparams.docbook_make_pars
-							  && (!runparams.docbook_in_par || par != pbegin)
-							  && !special_case;
-
-		// We want to issue the closing tag if either:
-		//   (i)  We opened it, and either docbook_in_par is false,
-		//		or we're not in the last paragraph, anyway.
-		//   (ii) We didn't open it and docbook_in_par is true,
-		//		but we are in the first par, and there is a next par.
-		auto nextpar = par;
-		++nextpar;
-		bool const close_par =
-				((open_par && (!runparams.docbook_in_par || nextpar != pend))
-				|| (!open_par && runparams.docbook_in_par && par == pbegin && nextpar != pend));
-
-		// Determine if this paragraph has some real content. Things like new pages are not caught
-		// by Paragraph::empty(), even though they do not generate anything useful in DocBook.
-		odocstringstream os2;
-		XMLStream xs2(os2);
-		par->simpleDocBookOnePar(buf, xs2, runparams, text.outerFont(distance(begin, par)), open_par, close_par, 0);
+	bool const open_par = runparams.docbook_make_pars
+						  && !runparams.docbook_in_par
+						  && !special_case;
 
-		docstring cleaned = os2.str();
-		static const lyx::regex reg("[ \\r\\n]*");
-		cleaned = from_utf8(lyx::regex_replace(to_utf8(cleaned), reg, string("")));
+	// We want to issue the closing tag if either:
+	//   (i)  We opened it, and either docbook_in_par is false,
+	//		or we're not in the last paragraph, anyway.
+	//   (ii) We didn't open it and docbook_in_par is true,
+	//		but we are in the first par, and there is a next par.
+	auto nextpar = par;
+	++nextpar;
+	bool const close_par = open_par && (!runparams.docbook_in_par);
 
-		if (!cleaned.empty()) {
-			if (open_par)
-				openParTag(xs, &*par, &*prevpar);
+	// Determine if this paragraph has some real content. Things like new pages are not caught
+	// by Paragraph::empty(), even though they do not generate anything useful in DocBook.
+	odocstringstream os2;
+	XMLStream xs2(os2);
+	par->simpleDocBookOnePar(buf, xs2, runparams, text.outerFont(distance(begin, par)), open_par, close_par, 0);
 
-			xs << XMLStream::ESCAPE_NONE << os2.str();
+	docstring cleaned = os2.str();
+	static const lyx::regex reg("[ \\r\\n]*");
+	cleaned = from_utf8(lyx::regex_replace(to_utf8(cleaned), reg, string("")));
 
-			if (close_par) {
-				closeTag(xs, &*par, (nextpar != end) ? &*nextpar : nullptr);
-				xs << xml::CR();
-			}
-		}
+	if (!cleaned.empty()) {
+		if (open_par)
+			openParTag(xs, &*par, prevpar);
+
+		xs << XMLStream::ESCAPE_NONE << os2.str();
+
+		if (close_par)
+			closeParTag(xs, &*par, (nextpar != end) ? &*nextpar : nullptr);
 	}
-	return pend;
 }
 
 
-bool isNormalEnv(Layout const &lay)
-{
-	return lay.latextype == LATEX_ENVIRONMENT
-		   || lay.latextype == LATEX_BIB_ENVIRONMENT;
-}
+void makeAny(
+		Text const &text,
+		Buffer const &buf,
+		XMLStream &xs,
+		OutputParams const &ourparams,
+		ParagraphList::const_iterator par);
 
 
-ParagraphList::const_iterator makeEnvironment(
+void makeEnvironment(
 		Buffer const &buf,
 		XMLStream &xs,
 		OutputParams const &runparams,
 		Text const &text,
-		ParagraphList::const_iterator const & pbegin,
-		ParagraphList::const_iterator const & pend)
+		ParagraphList::const_iterator const & par)
 {
-	auto const begin = text.paragraphs().begin();
 	auto const end = text.paragraphs().end();
-	ParagraphList::const_iterator par = pbegin;
-	depth_type const origdepth = pbegin->params().depth();
-
-	// Output the opening tag for this environment.
-	{
-		// Find the previous paragraph.
-		auto prevpar = begin;
-		if (prevpar != par) {
-			auto prevpar_next = prevpar;
-			++prevpar_next;
-
-			while (prevpar_next != par) {
-				++prevpar_next;
-				++prevpar;
-			}
-		}
 
-		// Open tag for this environment.
-		openParTag(xs, &*par, &*prevpar);
-		xs << xml::CR();
-	}
-
-	// we will on occasion need to remember a layout from before.
-	Layout const *lastlay = nullptr;
-	auto prevpar = par;
-
-	while (par != pend) {
-		Layout const & style = par->layout();
-		ParagraphList::const_iterator send;
-
-		auto parnext = par;
-		++parnext;
-
-		// Actual content of this paragraph.
-		prevpar = par;
-		switch (style.latextype) {
-		case LATEX_ENVIRONMENT:
-		case LATEX_LIST_ENVIRONMENT:
-		case LATEX_ITEM_ENVIRONMENT: {
-			// There are two possibilities in this case.
-			// One is that we are still in the environment in which we
-			// started---which we will be if the depth is the same.
-			if (par->params().depth() == origdepth) {
-				LATTEST(par->layout() == style);
-				if (lastlay != nullptr) {
-					closeItemTag(xs, *lastlay);
-					if (lastlay->docbookitemwrappertag() != "NONE") {
-						xs << xml::EndTag(lastlay->docbookitemwrappertag());
-						xs << xml::CR();
-					}
-					lastlay = nullptr;
-				}
-
-				// this will be positive if we want to skip the
-				// initial word (if it's been taken for the label).
-				pos_type sep = 0;
+	// Output the opening tag for this environment, but only if it has not been previously opened (condition
+	// implemented in openParTag).
+	auto prevpar = text.paragraphs().getParagraphBefore(par);
+	openParTag(xs, &*par, prevpar); // TODO: switch in layout for par/block?
+
+	// Generate the contents of this environment. There is a special case if this is like some environment.
+	Layout const & style = par->layout();
+	if (style.latextype == LATEX_COMMAND) {
+		// Nothing to do (otherwise, infinite loops).
+	} else if (style.latextype == LATEX_ENVIRONMENT ||
+			style.latextype == LATEX_LIST_ENVIRONMENT ||
+			style.latextype == LATEX_ITEM_ENVIRONMENT) {
+		// Open a wrapper tag if needed.
+		if (style.docbookitemwrappertag() != "NONE") {
+			xs << xml::StartTag(style.docbookitemwrappertag(), style.docbookitemwrapperattr());
+			xs << xml::CR();
+		}
 
-				// Open a wrapper tag if needed.
-				if (style.docbookitemwrappertag() != "NONE") {
-					xs << xml::StartTag(style.docbookitemwrappertag(), style.docbookitemwrapperattr());
+		// Generate the label, if need be. If it is taken from the text, sep != 0 and corresponds to the first
+		// character after the label.
+		pos_type sep = 0;
+		if (style.labeltype != LABEL_NO_LABEL && style.docbookitemlabeltag() != "NONE") {
+			// At least one condition must be met:
+			//  - this environment is not a list
+			//  - if this is a list, the label must not be manual (i.e. it must be taken from the layout)
+			if (style.latextype != LATEX_LIST_ENVIRONMENT || style.labeltype != LABEL_MANUAL) {
+				// Usual cases: maybe there is something specified at the layout level. Highly unlikely, though.
+				docstring const lbl = par->params().labelString();
+
+				if (lbl.empty()) {
 					xs << xml::CR();
-				}
-
-				// label output
-				if (style.labeltype != LABEL_NO_LABEL &&
-						style.docbookitemlabeltag() != "NONE") {
-
-					if (isNormalEnv(style)) {
-						// in this case, we print the label only for the first
-						// paragraph (as in a theorem or an abstract).
-						if (par == pbegin) {
-							docstring const lbl = pbegin->params().labelString();
-							if (!lbl.empty()) {
-								openLabelTag(xs, style);
-								xs << lbl;
-								closeLabelTag(xs, style);
-							} else {
-								// No new line after closeLabelTag.
-								xs << xml::CR();
-							}
-						}
-					} else { // some kind of list
-						if (style.labeltype == LABEL_MANUAL) {
-							// Only variablelist gets here.
-
-							openLabelTag(xs, style);
-							sep = par->firstWordDocBook(xs, runparams);
-							closeLabelTag(xs, style);
-						} else {
-							openLabelTag(xs, style);
-							xs << par->params().labelString();
-							closeLabelTag(xs, style);
-						}
-					}
-				} // end label output
-
-				// Start generating the item.
-				bool wasInParagraph = runparams.docbook_in_par;
-				openItemTag(xs, style);
-				bool getsIntoParagraph = openInnerItemTag(xs, style);
-				OutputParams rp = runparams;
-				rp.docbook_in_par = wasInParagraph | getsIntoParagraph;
-
-				// Maybe the item is completely empty, i.e. if the first word ends at the end of the current paragraph
-				// AND if the next paragraph doesn't have the same depth (if there is such a paragraph).
-				// Common case: there is only the first word on the line, but there is a nested list instead
-				// of more text.
-				bool emptyItem = false;
-				if (sep == par->size()) {
-					auto next_par = par;
-					++next_par;
-					if (next_par == text.paragraphs().end()) // There is no next paragraph.
-						emptyItem = true;
-					else // There is a next paragraph: check depth.
-						emptyItem = par->params().depth() >= next_par->params().depth();
-				}
-
-				if (emptyItem) {
-					// Avoid having an empty item, this is not valid DocBook. A single character is enough to force
-					// generation of a full <para>.
-					xs << ' ';
 				} else {
-					// Generate the rest of the paragraph, if need be.
-					par->simpleDocBookOnePar(buf, xs, rp, text.outerFont(distance(begin, par)), true, true, sep);
+					openLabelTag(xs, style);
+					xs << lbl;
+					closeLabelTag(xs, style);
 				}
-
-				++par;
-				if (getsIntoParagraph)
-					closeInnerItemTag(xs, style);
-
-				// We may not want to close the tag yet, in particular:
-				// If we're not at the end of the item...
-				if (par != pend
-					//  and are doing items...
-					&& !isNormalEnv(style)
-					// and if the depth has changed...
-					&& par->params().depth() != origdepth) {
-					// then we'll save this layout for later, and close it when
-					// we get another item.
-					lastlay = &style;
-				} else {
-					closeItemTag(xs, style);
-
-					// Eventually, close the item wrapper.
-					if (style.docbookitemwrappertag() != "NONE") {
-						xs << xml::EndTag(style.docbookitemwrappertag());
-						xs << xml::CR();
-					}
-				}
-			}
-			// The other possibility is that the depth has increased.
-			else {
-				send = findEndOfEnvironment(par, pend);
-				par = makeEnvironment(buf, xs, runparams, text, par, send);
+			} else {
+				// Only variablelist gets here (or similar items defined as an extension in the layout).
+				openLabelTag(xs, style);
+				sep = par->firstWordDocBook(xs, runparams);
+				closeLabelTag(xs, style);
 			}
-			break;
 		}
-		case LATEX_PARAGRAPH:
-//			send = findLast(par, pend, LATEX_PARAGRAPH);
-			par = makeParagraphs(buf, xs, runparams, text, par, parnext);
-			break;
-		case LATEX_BIB_ENVIRONMENT:
-//			send = findLast(par, pend, LATEX_BIB_ENVIRONMENT);
-			makeParagraphBibliography(buf, xs, runparams, text, par, parnext);
-			break;
-		case LATEX_COMMAND:
-			par = parnext;
-			break;
+
+		// Maybe the item is completely empty, i.e. if the first word ends at the end of the current paragraph
+		// AND if the next paragraph doesn't have the same depth (if there is such a paragraph).
+		// Common case: there is only the first word on the line, but there is a nested list instead
+		// of more text.
+		bool emptyItem = false;
+		if (sep == par->size()) { // If the separator is already at the end of this paragraph...
+			auto next_par = par;
+			++next_par;
+			if (next_par == text.paragraphs().end()) // There is no next paragraph.
+				emptyItem = true;
+			else // There is a next paragraph: check depth.
+				emptyItem = par->params().depth() >= next_par->params().depth();
 		}
-	}
 
-	if (lastlay != nullptr) {
-		closeItemTag(xs, *lastlay);
-		if (lastlay->docbookitemwrappertag() != "NONE") {
-			xs << xml::EndTag(lastlay->docbookitemwrappertag());
-			xs << xml::CR();
+		if (emptyItem) {
+			// Avoid having an empty item, this is not valid DocBook. A single character is enough to force
+			// generation of a full <para>.
+			// TODO: this always worked only by magic...
+			xs << ' ';
+		} else {
+			// Generate the rest of the paragraph, if need be.
+			par->simpleDocBookOnePar(buf, xs, runparams, text.outerFont(std::distance(text.paragraphs().begin(), par)),
+							         true, true, sep);
 		}
+	} else {
+		makeAny(text, buf, xs, runparams, par);
 	}
-//	auto nextpar = par;
-//	++nextpar;
-	closeTag(xs, &*prevpar, &*par);
-//	closeTag(xs, &*par, (nextpar != end) ? &*nextpar : nullptr);
-	xs << xml::CR();
-	return pend;
+
+	// Close the environment.
+	auto nextpar = par;
+	++nextpar;
+	closeParTag(xs, &*par, (nextpar != end) ? &*nextpar : nullptr); // TODO: switch in layout for par/block?
 }
 
 
@@ -744,117 +646,48 @@ void makeCommand(
 		XMLStream & xs,
 		OutputParams const & runparams,
 		Text const & text,
-		ParagraphList::const_iterator const & pbegin)
+		ParagraphList::const_iterator const & par)
 {
-	// No need for labels, as they are handled by DocBook tags.
+	// Unlike XHTML, no need for labels, as they are handled by DocBook tags.
 	auto const begin = text.paragraphs().begin();
 	auto const end = text.paragraphs().end();
-	auto nextpar = pbegin;
+	auto nextpar = par;
 	++nextpar;
 
-	// Find the previous paragraph.
-	auto prevpar = begin;
-	if (prevpar != pbegin) {
-		auto prevpar_next = prevpar;
-		++prevpar_next;
-
-		while (prevpar_next != pbegin) {
-			++prevpar_next;
-			++prevpar;
-		}
-	}
-
 	// Generate this command.
-	openParTag(xs, &*pbegin, &*prevpar);
+	auto prevpar = text.paragraphs().getParagraphBefore(par);
+	openParTag(xs, &*par, prevpar);
 
-	pbegin->simpleDocBookOnePar(buf, xs, runparams,
-								text.outerFont(distance(begin, pbegin)));
+	par->simpleDocBookOnePar(buf, xs, runparams,
+	                         text.outerFont(distance(begin, par)));
 
-	closeTag(xs, &*pbegin, (nextpar != end) ? &*nextpar : nullptr);
-	xs << xml::CR();
+	closeParTag(xs, &*par, (nextpar != end) ? &*nextpar : nullptr);
 }
 
-pair<ParagraphList::const_iterator, ParagraphList::const_iterator> makeAny(
+
+void makeAny(
 		Text const &text,
 		Buffer const &buf,
 		XMLStream &xs,
 		OutputParams const &ourparams,
-		ParagraphList::const_iterator par,
-		ParagraphList::const_iterator send,
-		ParagraphList::const_iterator pend)
+		ParagraphList::const_iterator par)
 {
 	switch (par->layout().latextype) {
-	case LATEX_COMMAND: {
-		// The files with which we are working never have more than
-		// one paragraph in a command structure.
-		// FIXME
-		// if (ourparams.docbook_in_par)
-		//   fix it so we don't get sections inside standard, e.g.
-		// note that we may then need to make runparams not const, so we
-		// can communicate that back.
-		// FIXME Maybe this fix should be in the routines themselves, in case
-		// they are called from elsewhere.
+	case LATEX_COMMAND:
 		makeCommand(buf, xs, ourparams, text, par);
-		++par;
 		break;
-	}
 	case LATEX_ENVIRONMENT:
 	case LATEX_LIST_ENVIRONMENT:
 	case LATEX_ITEM_ENVIRONMENT:
-		// FIXME Same fix here.
-		send = findEndOfEnvironment(par, pend);
-		par = makeEnvironment(buf, xs, ourparams, text, par, send);
+		makeEnvironment(buf, xs, ourparams, text, par);
 		break;
 	case LATEX_PARAGRAPH:
-		send = findLast(par, pend, LATEX_PARAGRAPH);
-		par = makeParagraphs(buf, xs, ourparams, text, par, send);
+		makeParagraph(buf, xs, ourparams, text, par);
 		break;
 	case LATEX_BIB_ENVIRONMENT:
-		send = findLast(par, pend, LATEX_BIB_ENVIRONMENT);
-		par = makeParagraphBibliography(buf, xs, ourparams, text, par, send);
+		makeParagraphBibliography(buf, xs, ourparams, text, par);
 		break;
 	}
-
-	return make_pair(par, send);
-}
-
-ParagraphList::const_iterator makeAnySimple(
-		Text const &text,
-		Buffer const &buf,
-		XMLStream &xs,
-		OutputParams const &ourparams,
-		ParagraphList::const_iterator par)
-{
-	auto parnext = par;
-	++parnext;
-
-	switch (par->layout().latextype) {
-	case LATEX_COMMAND: {
-		// The files with which we are working never have more than
-		// one paragraph in a command structure.
-		// FIXME
-		// if (ourparams.docbook_in_par)
-		//   fix it so we don't get sections inside standard, e.g.
-		// note that we may then need to make runparams not const, so we
-		// can communicate that back.
-		// FIXME Maybe this fix should be in the routines themselves, in case
-		// they are called from elsewhere.
-		makeCommand(buf, xs, ourparams, text, par);
-		return parnext;
-	}
-	case LATEX_ENVIRONMENT:
-	case LATEX_LIST_ENVIRONMENT:
-	case LATEX_ITEM_ENVIRONMENT:
-		// FIXME Same fix here.
-		return makeEnvironment(buf, xs, ourparams, text, par, parnext);
-	case LATEX_PARAGRAPH:
-		return makeParagraphs(buf, xs, ourparams, text, par, parnext);
-	case LATEX_BIB_ENVIRONMENT:
-		return makeParagraphBibliography(buf, xs, ourparams, text, par, parnext);
-	}
-
-	// This should never happen. Return the next paragraph to avoid an infinite loop.
-	return parnext;
 }
 
 } // end anonymous namespace
@@ -885,9 +718,8 @@ DocBookDocumentSectioning hasDocumentSectioning(ParagraphList const &paragraphs,
 		Layout const &style = paragraphs[bpit].layout();
 		documentHasSections |= style.category() == from_utf8("Sectioning");
 
-		if (documentHasSections) {
+		if (documentHasSections)
 			break;
-		}
 		bpit += 1;
 	}
 	// Paragraphs before the first section: [ runparams.par_begin ; eppit )
@@ -898,7 +730,10 @@ DocBookDocumentSectioning hasDocumentSectioning(ParagraphList const &paragraphs,
 
 bool hasOnlyNotes(Paragraph const & par)
 {
+	// Precondition: the paragraph is not empty. Otherwise, the function will always return true...
 	for (int i = 0; i < par.size(); ++i)
+		// If you find something that is not an inset (like actual text) or an inset that is not a note,
+		// return false.
 		if (!par.isInset(i) || !dynamic_cast<InsetNote *>(par.insetList().get(i)))
 			return false;
 	return true;
@@ -994,37 +829,6 @@ DocBookInfoTag getParagraphsWithInfo(ParagraphList const &paragraphs, pit_type b
 }
 
 
-pit_type generateDocBookParagraphWithoutSectioning(
-		Text const & text,
-		Buffer const & buf,
-		XMLStream & xs,
-		OutputParams const & runparams,
-		ParagraphList const & paragraphs,
-		DocBookInfoTag const & info)
-{
-	auto bpit = info.bpit;
-	auto par = paragraphs.iterator_at(bpit);
-	auto lastStartedPar = par;
-	ParagraphList::const_iterator send;
-	auto const pend =
-			(info.epit == (int) paragraphs.size()) ?
-			paragraphs.end() : paragraphs.iterator_at(info.epit);
-
-	while (bpit < info.epit) {
-		if (info.abstract.find(bpit) != info.abstract.end()) {
-			bpit += 1;
-			continue;
-		}
-
-		tie(par, send) = makeAny(text, buf, xs, runparams, par, send, pend);
-		bpit += distance(lastStartedPar, par);
-		lastStartedPar = par;
-	}
-
-	return bpit;
-}
-
-
 void outputDocBookInfo(
 		Text const & text,
 		Buffer const & buf,
@@ -1040,6 +844,7 @@ void outputDocBookInfo(
 	bool hasAbstract = !info.abstract.empty();
 	docstring abstract;
 	if (hasAbstract) {
+		// Generate the abstract XML into a string before further checks.
 		odocstringstream os2;
 		{
 			XMLStream xs2(os2);
@@ -1048,8 +853,7 @@ void outputDocBookInfo(
 			// info.abstract is inclusive, epit is exclusive, hence +1 for looping.
 
 			while (bpit < epit) {
-				makeAnySimple(text, buf, xs2, runparams, paragraphs.iterator_at(bpit));
-				xs2 << XMLStream::ESCAPE_NONE << from_ascii("<!-- " + to_string(bpit) + " -->");
+				makeAny(text, buf, xs2, runparams, paragraphs.iterator_at(bpit));
 				bpit += 1;
 			}
 		}
@@ -1065,7 +869,7 @@ void outputDocBookInfo(
 			hasAbstract = false;
 	}
 
-	// The abstract must go in <info>.
+	// The abstract must go in <info>. Otherwise, decide whether to open <info> based on the layouts.
 	bool needInfo = !info.mustBeInInfo.empty() || hasAbstract;
 
 	// Start the <info> tag if required.
@@ -1076,16 +880,17 @@ void outputDocBookInfo(
 	}
 
 	// Output the elements that should go in <info>, before and after the abstract.
-	xs << XMLStream::ESCAPE_NONE << "<!-- shouldBeInInfo -->";
-	for (auto pit : info.shouldBeInInfo) // Typically, the title: these elements are so important and ubiquitous
-		// that mandating a wrapper like <info> would repel users.
-		makeAnySimple(text, buf, xs, runparams, paragraphs.iterator_at(pit));
-	xs << XMLStream::ESCAPE_NONE << "<!-- mustBeInInfo -->";
-	for (auto pit : info.mustBeInInfo)
+	for (auto pit : info.shouldBeInInfo) { // Typically, the title: these elements are so important and ubiquitous
+		// that mandating a wrapper like <info> would repel users. Thus, generate them first.
+		makeAny(text, buf, xs, runparams, paragraphs.iterator_at(pit));
+	}
+	for (auto pit : info.mustBeInInfo) {
 		if (info.abstract.find(pit) == info.abstract.end()) // The abstract must be in info, but is dealt with after.
-			makeAnySimple(text, buf, xs, runparams, paragraphs.iterator_at(pit));
-	xs << XMLStream::ESCAPE_NONE << "<!-- /info -->";
+			makeAny(text, buf, xs, runparams, paragraphs.iterator_at(pit));
+	}
 
+	// Always output the abstract as the last item of the <info>, as it requires special treatment (especially if
+	// it contains several paragraphs that are empty).
 	if (hasAbstract) {
 //		string tag = paragraphs[*info.abstract.begin()].layout().docbookforceabstracttag();
 //		if (tag == "NONE")
@@ -1093,9 +898,7 @@ void outputDocBookInfo(
 //
 //		xs << xml::StartTag(tag);
 //		xs << xml::CR();
-		xs << XMLStream::ESCAPE_NONE << "<!-- abs -->";
 		xs << XMLStream::ESCAPE_NONE << abstract;
-		xs << XMLStream::ESCAPE_NONE << "<!-- /abs -->";
 //		xs << xml::EndTag(tag);
 //		xs << xml::CR();
 	}
@@ -1147,7 +950,7 @@ void docbookSimpleAllParagraphs(
 	while (bpit < epit) {
 		auto par = paragraphs.iterator_at(bpit);
 		if (!hasOnlyNotes(*par))
-			makeAnySimple(text, buf, xs, runparams, par);
+			makeAny(text, buf, xs, runparams, par);
 		bpit += 1;
 	}
 }
@@ -1170,9 +973,6 @@ void docbookParagraphs(Text const &text,
 				return;
 			});
 
-	ParagraphList::const_iterator const pend =
-			(epit == (int) paragraphs.size()) ?
-			paragraphs.end() : paragraphs.iterator_at(epit);
 	std::stack<std::pair<int, string>> headerLevels; // Used to determine when to open/close sections: store the depth
 	// of the section and the tag that was used to open it.
 
@@ -1203,8 +1003,7 @@ void docbookParagraphs(Text const &text,
 		ParagraphList::const_iterator send;
 
 		if (hasOnlyNotes(*par)) {
-			++par;
-			bpit += distance(lastStartedPar, par);
+			bpit += 1;
 			continue;
 		}
 
@@ -1283,8 +1082,8 @@ void docbookParagraphs(Text const &text,
 		}
 
 		// Generate this paragraph.
-		tie(par, send) = makeAny(text, buf, xs, ourparams, par, send, pend);
-		bpit += distance(lastStartedPar, par);
+		makeAny(text, buf, xs, ourparams, par);
+		bpit += 1;
 	}
 
 	// If need be, close <section>s, but only at the end of the document (otherwise, dealt with at the beginning
diff --git a/src/xml.cpp b/src/xml.cpp
index e16a784..147eadd 100644
--- a/src/xml.cpp
+++ b/src/xml.cpp
@@ -200,7 +200,7 @@ bool XMLStream::closeFontTags()
 		tag_stack_.pop_back();
 		// this shouldn't happen, since then the font tags
 		// weren't in any other tag.
-//		LASSERT(!tag_stack_.empty(), return true);
+		LASSERT(!tag_stack_.empty(), return true);
 		if (tag_stack_.empty())
 			return true;
 		curtag = &tag_stack_.back();
@@ -583,62 +583,57 @@ docstring xml::uniqueID(docstring const & label)
 
 docstring xml::cleanID(docstring const & orig)
 {
-	// The standard xml:id only allows letters,
-	// digits, '-' and '.' in a name.
-	// This routine replaces illegal characters by '-' or '.'
-	// and adds a number for uniqueness if need be.
-	docstring const allowed = from_ascii(".-_");
+	// The standard xml:id only allows letters, digits, '-' and '.' in a name.
+	// This routine replaces illegal characters by '-' or '.' and adds a number for uniqueness if need be.
 
 	// Use a cache of already mangled names: the alterations may merge several IDs as one. This ensures that the IDs
 	// are not mixed up in the document.
+	// This code could be improved: it uses Qt outside the GUI part. Any TLS implementation could do the trick.
 	typedef map<docstring, docstring> MangledMap;
 	static QThreadStorage<MangledMap> tMangledNames;
 	static QThreadStorage<int> tMangleID;
 
-	MangledMap & mangledNames = tMangledNames.localData();
-
 	// If the name is already known, just return it.
-	MangledMap::const_iterator const known = mangledNames.find(orig);
+	MangledMap & mangledNames = tMangledNames.localData();
+	auto const known = mangledNames.find(orig);
 	if (known != mangledNames.end())
 		return known->second;
 
 	// Start creating the mangled name by iterating over the characters.
 	docstring content;
-	docstring::const_iterator it  = orig.begin();
-	docstring::const_iterator end = orig.end();
+	auto it = orig.cbegin();
+	auto end = orig.cend();
 
 	// Make sure it starts with a letter.
-	if (!isAlphaASCII(*it) && allowed.find(*it) >= allowed.size())
+	if (!isAlphaASCII(*it))
 		content += "x";
 
-	// Do the mangling.
+	// Parse the ID character by character and change what needs to.
 	bool mangle = false; // Indicates whether the ID had to be changed, i.e. if ID no more ensured to be unique.
 	for (; it != end; ++it) {
 		char_type c = *it;
-		if (isAlphaASCII(c) || isDigitASCII(c) || c == '-' || c == '.'
-		      || allowed.find(c) < allowed.size())
+		if (isAlphaASCII(c) || isDigitASCII(c) || c == '-' || c == '.' || c == '_') {
 			content += c;
-		else if (c == '_' || c == ' ') {
-			mangle = true;
-			content += "-";
-		}
-		else if (c == ':' || c == ',' || c == ';' || c == '!') {
+		} else if (c == ':' || c == ',' || c == ';' || c == '!') {
 			mangle = true;
 			content += ".";
-		}
-		else {
+		} else { // Other invalid characters, such as ' '.
 			mangle = true;
 			content += "-";
 		}
 	}
 
-	if (mangle) {
+	// If there had to be a change, check if ID unicity is still guaranteed.
+	// This avoids having a clash if satisfying XML requirements for ID makes two IDs identical, like "a:b" and "a!b",
+	// as both of them would be transformed as "a.b". With this procedure, one will become "a.b" and the other "a.b-1".
+	if (mangle && mangledNames.find(content) != mangledNames.end()) {
 		int & mangleID = tMangleID.localData();
-		content += "-" + convert<docstring>(mangleID++);
+		content += "-" + convert<docstring>(mangleID);
+		mangleID += 1;
 	}
 
+	// Save the new ID to avoid recomputing it afterwards and to ensure stability over the document.
 	mangledNames[orig] = content;
-
 	return content;
 }
 

commit 6b94286316deaec6a84189b952f9acddd61af795
Author: Thibaut Cuvelier <tcuvelier at lyx.org>
Date:   Sun Aug 16 19:22:23 2020 +0200

    Fix compilation

diff --git a/src/mathed/InsetMathGrid.cpp b/src/mathed/InsetMathGrid.cpp
index 26dd55f..48e1993 100644
--- a/src/mathed/InsetMathGrid.cpp
+++ b/src/mathed/InsetMathGrid.cpp
@@ -1634,7 +1634,7 @@ void InsetMathGrid::doDispatch(Cursor & cur, FuncRequest & cmd)
 			for (row_type r = 0; r < numrows; ++r) {
 				for (col_type c = 0; c < numcols; ++c) {
 					idx_type i = index(r + startrow, c + startcol);
-					pos_type ipos = uint(cur.pos()) > cell(i).size()
+					pos_type ipos = pos_type(cur.pos()) > cell(i).size()
 							? cell(i).size()
 							: cur.pos();
 					cell(i).insert(ipos, grid.cell(grid.index(r, c)));

commit 3ec500aa9113cccfc1365c3a0deb966504bcf1ee
Author: Thibaut Cuvelier <tcuvelier at lyx.org>
Date:   Sun Aug 16 19:07:14 2020 +0200

    A few more constants to avoid copies

diff --git a/src/insets/InsetBibtex.cpp b/src/insets/InsetBibtex.cpp
index 876adea..34b22c1 100644
--- a/src/insets/InsetBibtex.cpp
+++ b/src/insets/InsetBibtex.cpp
@@ -1216,9 +1216,9 @@ void InsetBibtex::docbook(XMLStream & xs, OutputParams const &) const
 		if (! delayedTags.empty()) {
 			unsigned long remainingTags = delayedTags.size(); // Used as a workaround. With GCC 7, when erasing all
 			// elements one by one, some elements may still pop in later on (even though they were deleted previously).
-			auto hasTag = [&delayedTags](string key) { return delayedTags.find(key) != delayedTags.end(); };
-			auto getTag = [&delayedTags](string key) { return from_utf8(delayedTags[key]); };
-			auto eraseTag = [&delayedTags, &remainingTags](string key) {
+			auto hasTag = [&delayedTags](const string & key) { return delayedTags.find(key) != delayedTags.end(); };
+			auto getTag = [&delayedTags](const string & key) { return from_utf8(delayedTags[key]); };
+			auto eraseTag = [&delayedTags, &remainingTags](const string & key) {
 				remainingTags -= 1;
 				delayedTags.erase(key);
 			};

commit e83cc36a395d9ee427e30bb8b0a9cb5242b0d395
Author: Thibaut Cuvelier <tcuvelier at lyx.org>
Date:   Mon Aug 3 16:04:26 2020 +0200

    DocBook: add a layout tag to tell whether an item is the abstract or not.

diff --git a/autotests/export/docbook/bibliography_precooked_aastex.xml b/autotests/export/docbook/bibliography_precooked_aastex.xml
index e15bfdd..fe77b72 100644
--- a/autotests/export/docbook/bibliography_precooked_aastex.xml
+++ b/autotests/export/docbook/bibliography_precooked_aastex.xml
@@ -3,8 +3,8 @@
   See http://www.lyx.org/ for more information -->
 <article 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>Collapsed Cores in Globular Clusters,  Gauge-Boson Couplings, and AASTeX Examples</title>
-<author><personname>S. Djorgovski and Ivan R. King</personname>
+<!-- shouldBeInInfo --><title>Collapsed Cores in Globular Clusters,  Gauge-Boson Couplings, and AASTeX Examples</title>
+<!-- mustBeInInfo --><author><personname>S. Djorgovski and Ivan R. King</personname>
 <affiliation><orgname>Astronomy Department, University of California, Berkeley, CA 94720</orgname></affiliation>
 <affiliation role="alternate"><orgname>Visiting Astronomer Cerro Tololo Inter-American Observatory.CTIO is operated by AURA Inc. under contract to the National Science Foundation.</orgname></affiliation>
 <affiliation role="alternate"><orgname>Society of Fellows, Harvard University.</orgname></affiliation>
@@ -17,16 +17,11 @@
 <author><personname>R. J. Hanisch</personname>
 <affiliation><orgname>Space Telescope Science Institute, Baltimore, MD 21218</orgname></affiliation>
 <affiliation role="alternate"><orgname>Patron, Alonso's Bar and Grill</orgname></affiliation></author>
-<abstract><para>
-<para>This is a preliminary report on surface photometry of the major fraction of known globular clusters, to see which of them show the signs of a collapsed core. We also explore some diversionary mathematics and recreational tables. </para>
-<!-- Output Error: Tried to close `keyword' when tag was not open. Tag discarded. -->
-<!-- Output Error: Tried to close `keywordset' when tag was not open. Tag discarded. -->
-
 <keywordset><keyword>clusters: globular, peanut—bosons: bozos</keyword></keywordset>
-<!-- Output Error: Closing tag `info' when other tags are open, namely: -->
-<!-- Output Error: para -->
-</para><!-- Output Error: abstract -->
-</abstract></info>
+<!-- /info --><!-- abs --><abstract><para>
+<para>This is a preliminary report on surface photometry of the major fraction of known globular clusters, to see which of them show the signs of a collapsed core. We also explore some diversionary mathematics and recreational tables. </para>
+</para></abstract>
+<!-- 15 --><!-- /abs --></info>
 <section>
 <title>Introduction</title>
 <para>A focal problem today in the dynamics of globular clusters is core collapse. It has been predicted by theory for decades <biblioref endterm="hen61" />, <biblioref endterm="lyn68" />, <biblioref endterm="spi85" />, but observation has been less alert to the phenomenon. For many years the central brightness peak in M15 <biblioref endterm="kin75" />, <biblioref endterm="new78" /> seemed a unique anomaly. Then <biblioref endterm="aur82" /> suggested a central peak in NGC 6397, and a limited photographic survey of ours <biblioref endterm="djo84" /> found three more cases, including NGC 6624, whose sharp center had often been remarked on <biblioref endterm="can78" />. </para>
@@ -112,7 +107,7 @@
 </section>
 <section>
 <title>Helicity Amplitudes</title>
-<para>It has been realized that helicity amplitudes provide a convenient means for Feynman diagram<footnote><para>Footnotes can be inserted like this.</para>
+<para>It has been realized that helicity amplitudes provide a convenient means for Feynman diagram<footnote><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info --><para>Footnotes can be inserted like this.</para>
 </footnote> evaluations. These amplitude-level techniques are particularly convenient for calculations involving many Feynman diagrams, where the usual trace techniques for the amplitude squared becomes unwieldy. Our calculations use the helicity techniques developed by other authors <biblioref endterm="hag86" />; we briefly summarize below.</para>
 <section>
 <title>Formalism</title>
@@ -694,8 +689,7 @@ v(p,\lambda)_{\pm} & = & \pm\lambda(E\mp\lambda|{\textbf{p}}|)^{1/2}\chi
  </m:mtable>
  </m:math>
 </informalequation>
-<!-- Output Error: Tried to close `title' when tag was not open. Tag discarded. -->
-
+</MathLetters>
 </section>
 </section>
 <section>
@@ -957,7 +951,7 @@ v(p,\lambda)_{\pm} & = & \pm\lambda(E\mp\lambda|{\textbf{p}}|)^{1/2}\chi
   </m:msub>
  </m:mrow>
  </m:math>
-</inlineequation>, but the assumption is that the alternate results should be less than 90° out of phase with previous values. We have no observations of <!-- \ion{Ca}{2} -->. Roughly <inlineequation>
+</inlineequation>, but the assumption is that the alternate results should be less than 90° out of phase with previous values. We have no observations of <!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info --><!-- \ion{Ca}{2} -->. Roughly <inlineequation>
 <alt role='tex'>\nicefrac{4}{5}</alt>
  <m:math>
  
@@ -971,14 +965,13 @@ v(p,\lambda)_{\pm} & = & \pm\lambda(E\mp\lambda|{\textbf{p}}|)^{1/2}\chi
  </m:mrow>
  </m:math>
 </inlineequation> of the electronically submitted abstracts for AAS meetings are error-free. </para>
-<acknowledgement><para>We are grateful to V. Barger, T. Han, and R. J. N. Phillips for doing the math in section&#xA0;<xref linkend="bozomath" />. More information on the AASTeX macros package are available at <link xlink:href="http://www.aas.org/publications/aastex">http://www.aas.org/publications/aastex</link> or the <link xlink:href="ftp://www.aas.org/pubs/AAS ftp site">AAS ftp site</link>.</para>
+<acknowledgement><para>We are grateful to V. Barger, T. Han, and R. J. N. Phillips for doing the math in section&#xA0;<xref linkend="bozomath" />. More information on the AASTeX macros package are available at <link xlink:href="http://www.aas.org/publications/aastex"><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->http://www.aas.org/publications/aastex</link> or the <link xlink:href="ftp://www.aas.org/pubs/AAS ftp site">AAS ftp site</link>.</para>
 <application>IRAF, AIPS, Astropy, ...</application><!-- Output Error: Tried to close `para' when tag was not open. Tag discarded. -->
 
-<Appendix></Appendix>
 <bibliography>
 <bibliomixed xml:id='aur82'>Aurière, M. 1982, <!-- \aap -->, 109, 301 </bibliomixed>
 <bibliomixed xml:id='can78'>Canizares, C. R., Grindlay, J. E., Hiltner, W. A., Liller, W., and McClintock, J. E. 1978, <!-- \apj -->, 224, 39 </bibliomixed>
-<bibliomixed xml:id='djo84'>Djorgovski, S., and King, I. R. 1984, <!-- \apjl -->, 277, L49 </bibliomixed>
+<bibliomixed xml:id='djo84'>Djorgovski, S., and King, I. R. 1984, <!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info --><!-- \apjl -->, 277, L49 </bibliomixed>
 <bibliomixed xml:id='hag86'>Hagiwara, K., and Zeppenfeld, D. 1986, Nucl.Phys., 274, 1 </bibliomixed>
 <bibliomixed xml:id='har84'>Harris, W. E., and van den Bergh, S. 1984, <!-- \aj -->, 89, 1816 </bibliomixed>
 <bibliomixed xml:id='hen61'>Hénon, M. 1961, Ann.d'Ap., 24, 369 </bibliomixed>
@@ -986,19 +979,19 @@ v(p,\lambda)_{\pm} & = & \pm\lambda(E\mp\lambda|{\textbf{p}}|)^{1/2}\chi
 <bibliomixed xml:id='kin75'>King, I. R. 1975, Dynamics of Stellar Systems, A. Hayli, Dordrecht: Reidel, 1975, 99 </bibliomixed>
 <bibliomixed xml:id='kin68'>King, I. R., Hedemann, E., Hodge, S. M., and White, R. E. 1968, <!-- \aj -->, 73, 456 </bibliomixed>
 <bibliomixed xml:id='kro84'>Kron, G. E., Hewitt, A. V., and Wasserman, L. H. 1984, <!-- \pasp -->, 96, 198 </bibliomixed>
-<bibliomixed xml:id='lyn68'>Lynden-Bell, D., and Wood, R. 1968, <!-- \mnras -->, 138, 495 </bibliomixed>
+<bibliomixed xml:id='lyn68'>Lynden-Bell, D., and Wood, R. 1968, <!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info --><!-- \mnras -->, 138, 495 </bibliomixed>
 <bibliomixed xml:id='new78'>Newell, E. B., and O'Neil, E. J. 1978, <!-- \apjs -->, 37, 27 </bibliomixed>
 <bibliomixed xml:id='ort85'>Ortolani, S., Rosino, L., and Sandage, A. 1985, <!-- \aj -->, 90, 473 </bibliomixed>
 <bibliomixed xml:id='pet76'>Peterson, C. J. 1976, <!-- \aj -->, 81, 617 </bibliomixed>
 <bibliomixed xml:id='spi85'>Spitzer, L. 1985, Dynamics of Star Clusters, J. Goodman and P. Hut, Dordrecht: Reidel, 109 </bibliomixed>
 </bibliography>
 <table xml:id="tbl-2">
-<caption>Terribly relevant tabular information.</caption>
-<tbody>
+<caption><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->Terribly relevant tabular information.</caption>
+<!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info --><tbody>
 <tr>
-<td align='center' valign='top'>Star </td>
-<td align='right' valign='top'> Height </td>
-<td align='right' valign='top'> <inlineequation>
+<td align='center' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->Star </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info --> Height </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info --> <inlineequation>
 <alt role='tex'>d_{x}</alt>
  <m:math>
  
@@ -1012,7 +1005,7 @@ v(p,\lambda)_{\pm} & = & \pm\lambda(E\mp\lambda|{\textbf{p}}|)^{1/2}\chi
  </m:mrow>
  </m:math>
 </inlineequation></td>
-<td align='right' valign='top'> <inlineequation>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info --> <inlineequation>
 <alt role='tex'>d_{y}</alt>
  <m:math>
  
@@ -1026,7 +1019,7 @@ v(p,\lambda)_{\pm} & = & \pm\lambda(E\mp\lambda|{\textbf{p}}|)^{1/2}\chi
  </m:mrow>
  </m:math>
 </inlineequation></td>
-<td align='right' valign='top'> <inlineequation>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info --> <inlineequation>
 <alt role='tex'>n</alt>
  <m:math>
  
@@ -1034,7 +1027,7 @@ v(p,\lambda)_{\pm} & = & \pm\lambda(E\mp\lambda|{\textbf{p}}|)^{1/2}\chi
  </m:mrow>
  </m:math>
 </inlineequation></td>
-<td align='right' valign='top'> <inlineequation>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info --> <inlineequation>
 <alt role='tex'>\chi^{2}</alt>
  <m:math>
  
@@ -1048,7 +1041,7 @@ v(p,\lambda)_{\pm} & = & \pm\lambda(E\mp\lambda|{\textbf{p}}|)^{1/2}\chi
  </m:mrow>
  </m:math>
 </inlineequation></td>
-<td align='right' valign='top'> <inlineequation>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info --> <inlineequation>
 <alt role='tex'>R_{maj}</alt>
  <m:math>
  
@@ -1064,7 +1057,7 @@ v(p,\lambda)_{\pm} & = & \pm\lambda(E\mp\lambda|{\textbf{p}}|)^{1/2}\chi
  </m:mrow>
  </m:math>
 </inlineequation></td>
-<td align='right' valign='top'> <inlineequation>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info --> <inlineequation>
 <alt role='tex'>R_{min}</alt>
  <m:math>
  
@@ -1080,15 +1073,15 @@ v(p,\lambda)_{\pm} & = & \pm\lambda(E\mp\lambda|{\textbf{p}}|)^{1/2}\chi
  </m:mrow>
  </m:math>
 </inlineequation></td>
-<td align='center' valign='top' colspan='1'><inlineequation>
+<td align='center' valign='top' colspan='1'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info --><inlineequation>
 <alt role='tex'>P</alt>
  <m:math>
  
  <m:mrow><m:mi>P</m:mi>
  </m:mrow>
  </m:math>
-</inlineequation>a</td>
-<td align='right' valign='top'> <inlineequation>
+</inlineequation><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->a</td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info --> <inlineequation>
 <alt role='tex'>PR_{maj}</alt>
  <m:math>
  
@@ -1106,7 +1099,7 @@ v(p,\lambda)_{\pm} & = & \pm\lambda(E\mp\lambda|{\textbf{p}}|)^{1/2}\chi
  </m:mrow>
  </m:math>
 </inlineequation></td>
-<td align='right' valign='top'> <inlineequation>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info --> <inlineequation>
 <alt role='tex'>PR_{min}</alt>
  <m:math>
  
@@ -1124,105 +1117,105 @@ v(p,\lambda)_{\pm} & = & \pm\lambda(E\mp\lambda|{\textbf{p}}|)^{1/2}\chi
  </m:mrow>
  </m:math>
 </inlineequation></td>
-<td align='center' valign='top' colspan='1'><inlineequation>
+<td align='center' valign='top' colspan='1'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info --><inlineequation>
 <alt role='tex'>\Theta</alt>
  <m:math>
  
  <m:mrow><m:mo>&#x398;</m:mo>
  </m:mrow>
  </m:math>
-</inlineequation>b</td>
-<td align='center' valign='top'>Ref.</td>
+</inlineequation><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->b</td>
+<td align='center' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->Ref.</td>
 </tr>
 <tr>
-<td align='center' valign='top'><!-- \tableline\tableline -->1 </td>
-<td align='right' valign='top'>33472.5 </td>
-<td align='right' valign='top'>-0.1 </td>
-<td align='right' valign='top'>0.4 </td>
-<td align='right' valign='top'>53 </td>
-<td align='right' valign='top'>27.4 </td>
-<td align='right' valign='top'>2.065 </td>
-<td align='right' valign='top'>1.940 </td>
-<td align='right' valign='top'>3.900 </td>
-<td align='right' valign='top'>68.3 </td>
-<td align='right' valign='top'>116.2 </td>
-<td align='right' valign='top'>-27.639</td>
-<td align='center' valign='top'>1,2</td>
+<td align='center' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info --><!-- \tableline\tableline -->1 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->33472.5 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->-0.1 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->0.4 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->53 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->27.4 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->2.065 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->1.940 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->3.900 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->68.3 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->116.2 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->-27.639</td>
+<td align='center' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->1,2</td>
 </tr>
 <tr>
-<td align='center' valign='top'> 2 </td>
-<td align='right' valign='top'>27802.4 </td>
-<td align='right' valign='top'>-0.3 </td>
-<td align='right' valign='top'>-0.2 </td>
-<td align='right' valign='top'>60 </td>
-<td align='right' valign='top'>3.7 </td>
-<td align='right' valign='top'>1.628 </td>
-<td align='right' valign='top'>1.510 </td>
-<td align='right' valign='top'>2.156 </td>
-<td align='right' valign='top'>6.8 </td>
-<td align='right' valign='top'>7.5 </td>
-<td align='right' valign='top'>-26.764</td>
-<td align='center' valign='top'>3</td>
+<td align='center' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info --> 2 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->27802.4 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->-0.3 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->-0.2 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->60 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->3.7 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->1.628 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->1.510 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->2.156 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->6.8 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->7.5 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->-26.764</td>
+<td align='center' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->3</td>
 </tr>
 <tr>
-<td align='center' valign='top'> 3 </td>
-<td align='right' valign='top'>29210.6 </td>
-<td align='right' valign='top'>0.9 </td>
-<td align='right' valign='top'>0.3 </td>
-<td align='right' valign='top'>60 </td>
-<td align='right' valign='top'>3.4 </td>
-<td align='right' valign='top'>1.622 </td>
-<td align='right' valign='top'>1.551 </td>
-<td align='right' valign='top'>2.159 </td>
-<td align='right' valign='top'>6.7 </td>
-<td align='right' valign='top'>7.3 </td>
-<td align='right' valign='top'>-40.272</td>
-<td align='center' valign='top'>4</td>
+<td align='center' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info --> 3 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->29210.6 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->0.9 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->0.3 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->60 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->3.4 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->1.622 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->1.551 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->2.159 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->6.7 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->7.3 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->-40.272</td>
+<td align='center' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->4</td>
 </tr>
 <tr>
-<td align='center' valign='top'> 4 </td>
-<td align='right' valign='top'>32733.8 </td>
-<td align='right' valign='top'>-1.2c</td>
-<td align='right' valign='top'>-0.5 </td>
-<td align='right' valign='top'>41 </td>
-<td align='right' valign='top'>54.8 </td>
-<td align='right' valign='top'>2.282 </td>
-<td align='right' valign='top'>2.156 </td>
-<td align='right' valign='top'>4.313 </td>
-<td align='right' valign='top'>117.4 </td>
-<td align='right' valign='top'>78.2 </td>
-<td align='right' valign='top'>-35.847</td>
-<td align='center' valign='top'>5,6</td>
+<td align='center' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info --> 4 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->32733.8 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->-1.2<!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->c</td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->-0.5 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->41 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->54.8 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->2.282 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->2.156 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->4.313 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->117.4 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->78.2 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->-35.847</td>
+<td align='center' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->5,6</td>
 </tr>
 <tr>
-<td align='center' valign='top'> 5 </td>
-<td align='right' valign='top'> 9607.4 </td>
-<td align='right' valign='top'>-0.4 </td>
-<td align='right' valign='top'>-0.4 </td>
-<td align='right' valign='top'>60 </td>
-<td align='right' valign='top'>1.4 </td>
-<td align='right' valign='top'>1.669c</td>
-<td align='right' valign='top'>1.574 </td>
-<td align='right' valign='top'>2.343 </td>
-<td align='right' valign='top'>8.0 </td>
-<td align='right' valign='top'>8.9 </td>
-<td align='right' valign='top'>-33.417</td>
-<td align='center' valign='top'>7</td>
+<td align='center' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info --> 5 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info --> 9607.4 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->-0.4 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->-0.4 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->60 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->1.4 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->1.669<!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->c</td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->1.574 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->2.343 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->8.0 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->8.9 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->-33.417</td>
+<td align='center' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->7</td>
 </tr>
 <tr>
-<td align='center' valign='top'> 6 </td>
-<td align='right' valign='top'>31638.6 </td>
-<td align='right' valign='top'>1.6 </td>
-<td align='right' valign='top'>0.1 </td>
-<td align='right' valign='top'>39 </td>
-<td align='right' valign='top'>315.2 </td>
-<td align='right' valign='top'> 3.433 </td>
-<td align='right' valign='top'>3.075 </td>
-<td align='right' valign='top'>7.488 </td>
-<td align='right' valign='top'>92.1 </td>
-<td align='right' valign='top'>25.3 </td>
-<td align='right' valign='top'>-12.052 </td>
-<td align='center' valign='top'>8</td>
+<td align='center' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info --> 6 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->31638.6 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->1.6 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->0.1 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->39 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->315.2 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info --> 3.433 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->3.075 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->7.488 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->92.1 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->25.3 </td>
+<td align='right' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->-12.052 </td>
+<td align='center' valign='top'><!-- shouldBeInInfo --><!-- mustBeInInfo --><!-- /info -->8</td>
 </tr>
 </tbody>
 <Table note>a<!-- }{ -->Sample footnote for table&#xA0;<xref linkend="tbl-2" /> that was generated with the LaTeX table environment</Table note>
diff --git a/lib/layouts/aastex.layout b/lib/layouts/aastex.layout
index 97c8b64..74d2ab6 100644
--- a/lib/layouts/aastex.layout
+++ b/lib/layouts/aastex.layout
@@ -282,9 +282,6 @@ Style Abstract
 	  Series	Bold
 	  Size		Normal
 	EndFont
-	DocBookTag            abstract
-	DocBookItemTag        para
-	DocBookInInfo         always
 End
 
 
diff --git a/lib/layouts/stdstruct.inc b/lib/layouts/stdstruct.inc
index 83d46e9..b02499f 100644
--- a/lib/layouts/stdstruct.inc
+++ b/lib/layouts/stdstruct.inc
@@ -49,9 +49,10 @@ Style Abstract
 			font-weight: bold;
 		}
 	EndHTMLStyle
+	DocBookAbstract       true
+	DocBookInInfo         always
 	DocBookTag            abstract
 	DocBookItemTag        para
-	DocBookInInfo         always
 End
 
 
diff --git a/lib/scripts/layout2layout.py b/lib/scripts/layout2layout.py
index e69deba..2bb62e3 100644
--- a/lib/scripts/layout2layout.py
+++ b/lib/scripts/layout2layout.py
@@ -282,7 +282,7 @@ currentFormat = 83
 # - Removed tag Element for flex insets
 
 # Incremented to format 83, 2 August 2020 by dourouc05
-# New tag DocBookWrapperMergeWithPrevious
+# New tags DocBookWrapperMergeWithPrevious and DocBookAbstract
 
 # Do not forget to document format change in Customization
 # Manual (section "Declaring a new text class").
diff --git a/src/Layout.cpp b/src/Layout.cpp
index eeb58d0..5047506 100644
--- a/src/Layout.cpp
+++ b/src/Layout.cpp
@@ -107,6 +107,7 @@ enum LayoutTags {
 	LT_DOCBOOKTAG,
 	LT_DOCBOOKATTR,
 	LT_DOCBOOKININFO,
+	LT_DOCBOOKABSTRACT,
 	LT_DOCBOOKWRAPPERTAG,
 	LT_DOCBOOKWRAPPERATTR,
 	LT_DOCBOOKWRAPPERMERGEWITHPREVIOUS,
@@ -177,6 +178,7 @@ Layout::Layout()
 	htmllabelfirst_ = false;
 	htmlforcecss_ = false;
 	htmltitle_ = false;
+	docbookabstract_ = false;
 	docbookwrappermergewithprevious_ = false;
 	spellcheck = true;
 	forcelocal = 0;
@@ -221,6 +223,7 @@ bool Layout::readIgnoreForcelocal(Lexer & lex, TextClass const & tclass)
 		{ "commanddepth",   LT_COMMANDDEPTH },
 		{ "copystyle",      LT_COPYSTYLE },
 		{ "dependson",      LT_DEPENDSON },
+		{ "docbookabstract",         LT_DOCBOOKABSTRACT },
 		{ "docbookattr",             LT_DOCBOOKATTR },
 		{ "docbookforceabstracttag", LT_DOCBOOKFORCEABSTRACTTAG },
 		{ "docbookininfo",           LT_DOCBOOKININFO },
@@ -738,6 +741,10 @@ bool Layout::readIgnoreForcelocal(Lexer & lex, TextClass const & tclass)
 			lex >> docbookininfo_;
 			break;
 
+		case LT_DOCBOOKABSTRACT:
+			lex >> docbookabstract_;
+			break;
+
 		case LT_DOCBOOKWRAPPERTAG:
 			lex >> docbookwrappertag_;
 			break;
@@ -1603,6 +1610,7 @@ void Layout::write(ostream & os) const
 		os << "\tDocBookAttr " << docbookattr_ << '\n';
 	if(!docbookininfo_.empty())
 		os << "\tDocBookInInfo " << docbookininfo_ << '\n';
+	os << "\tDocBookAbstract " << docbookabstract_ << '\n';
 	if(!docbookwrappertag_.empty())
 		os << "\tDocBookWrapperTag " << docbookwrappertag_ << '\n';
 	if(!docbookwrapperattr_.empty())
diff --git a/src/Layout.h b/src/Layout.h
index d9eb893..a894142 100644
--- a/src/Layout.h
+++ b/src/Layout.h
@@ -199,6 +199,8 @@ public:
 	///
 	std::string const & docbookininfo() const;
 	///
+	bool docbookabstract() const { return docbookabstract_; }
+	///
 	std::string const & docbookwrappertag() const;
 	///
 	std::string const & docbookwrapperattr() const;
@@ -516,11 +518,14 @@ private:
 	mutable std::string docbookwrapperattr_;
 	/// Whether this wrapper tag may be merged with the previously opened wrapper tag.
 	bool docbookwrappermergewithprevious_;
-	/// Outer tag for this section, only if this layout represent a sectionning item, including chapters (default: section).
+	/// Outer tag for this section, only if this layout represent a sectionning item, including chapters
+	/// (default: section).
 	mutable std::string docbooksectiontag_;
 	/// Whether this tag must/can/can't go into an <info> tag (default: never, as it only makes sense for metadata).
 	mutable std::string docbookininfo_;
-	/// whether this element (root or not) does not accept text without a section(i.e. the first text that is met
+	/// Wehther this paragraph should be considered as abstract.
+	bool docbookabstract_;
+	/// Whether this element (root or not) does not accept text without a section (i.e. the first text that is met
 	/// in LyX must be considered as the abstract if this is true); this text must be output with the specific tag
 	/// held by this attribute
 	mutable std::string docbookforceabstracttag_;
diff --git a/src/output_docbook.cpp b/src/output_docbook.cpp
index fd38940..4430041 100644
--- a/src/output_docbook.cpp
+++ b/src/output_docbook.cpp
@@ -219,7 +219,8 @@ void openParTag(XMLStream & xs, const Paragraph * par, const Paragraph * prevpar
 	if (tag == "Plain Layout")
 		tag = "para";
 
-	xs << xml::ParTag(tag, lay.docbookattr());
+	if (!xs.isTagOpen(xml::ParTag(tag, lay.docbookattr()), 1)) // Don't nest a paragraph directly in a paragraph.
+		xs << xml::ParTag(tag, lay.docbookattr());
 
 	if (lay.docbookitemtag() != "NONE")
 		xs << xml::StartTag(lay.docbookitemtag(), lay.docbookitemattr());
@@ -554,30 +555,38 @@ ParagraphList::const_iterator makeEnvironment(
 	ParagraphList::const_iterator par = pbegin;
 	depth_type const origdepth = pbegin->params().depth();
 
-	// Find the previous paragraph.
-	auto prevpar = begin;
-	if (prevpar != par) {
-		auto prevpar_next = prevpar;
-		++prevpar_next;
-
-		while (prevpar_next != par) {
+	// Output the opening tag for this environment.
+	{
+		// Find the previous paragraph.
+		auto prevpar = begin;
+		if (prevpar != par) {
+			auto prevpar_next = prevpar;
 			++prevpar_next;
-			++prevpar;
+
+			while (prevpar_next != par) {
+				++prevpar_next;
+				++prevpar;
+			}
 		}
-	}
 
-	// open tag for this environment
-	openParTag(xs, &*par, &*prevpar);
-	xs << xml::CR();
+		// Open tag for this environment.
+		openParTag(xs, &*par, &*prevpar);
+		xs << xml::CR();
+	}
 
 	// we will on occasion need to remember a layout from before.
 	Layout const *lastlay = nullptr;
+	auto prevpar = par;
 
 	while (par != pend) {
 		Layout const & style = par->layout();
 		ParagraphList::const_iterator send;
 
+		auto parnext = par;
+		++parnext;
+
 		// Actual content of this paragraph.
+		prevpar = par;
 		switch (style.latextype) {
 		case LATEX_ENVIRONMENT:
 		case LATEX_LIST_ENVIRONMENT:
@@ -701,15 +710,15 @@ ParagraphList::const_iterator makeEnvironment(
 			break;
 		}
 		case LATEX_PARAGRAPH:
-			send = findLast(par, pend, LATEX_PARAGRAPH);
-			par = makeParagraphs(buf, xs, runparams, text, par, send);
+//			send = findLast(par, pend, LATEX_PARAGRAPH);
+			par = makeParagraphs(buf, xs, runparams, text, par, parnext);
 			break;
 		case LATEX_BIB_ENVIRONMENT:
-			send = findLast(par, pend, LATEX_BIB_ENVIRONMENT);
-			par = makeParagraphBibliography(buf, xs, runparams, text, par, send);
+//			send = findLast(par, pend, LATEX_BIB_ENVIRONMENT);
+			makeParagraphBibliography(buf, xs, runparams, text, par, parnext);
 			break;
 		case LATEX_COMMAND:
-			++par;
+			par = parnext;
 			break;
 		}
 	}
@@ -721,9 +730,10 @@ ParagraphList::const_iterator makeEnvironment(
 			xs << xml::CR();
 		}
 	}
-	auto nextpar = par;
-	++nextpar;
-	closeTag(xs, &*par, (nextpar != end) ? &*nextpar : nullptr);
+//	auto nextpar = par;
+//	++nextpar;
+	closeTag(xs, &*prevpar, &*par);
+//	closeTag(xs, &*par, (nextpar != end) ? &*nextpar : nullptr);
 	xs << xml::CR();
 	return pend;
 }
@@ -773,43 +783,80 @@ pair<ParagraphList::const_iterator, ParagraphList::const_iterator> makeAny(
 		ParagraphList::const_iterator send,
 		ParagraphList::const_iterator pend)
 {
-	Layout const & style = par->layout();
-
-	switch (style.latextype) {
-		case LATEX_COMMAND: {
-			// The files with which we are working never have more than
-			// one paragraph in a command structure.
-			// FIXME
-			// if (ourparams.docbook_in_par)
-			//   fix it so we don't get sections inside standard, e.g.
-			// note that we may then need to make runparams not const, so we
-			// can communicate that back.
-			// FIXME Maybe this fix should be in the routines themselves, in case
-			// they are called from elsewhere.
-			makeCommand(buf, xs, ourparams, text, par);
-			++par;
-			break;
-		}
-		case LATEX_ENVIRONMENT:
-		case LATEX_LIST_ENVIRONMENT:
-		case LATEX_ITEM_ENVIRONMENT:
-			// FIXME Same fix here.
-			send = findEndOfEnvironment(par, pend);
-			par = makeEnvironment(buf, xs, ourparams, text, par, send);
-			break;
-		case LATEX_PARAGRAPH:
-			send = findLast(par, pend, LATEX_PARAGRAPH);
-			par = makeParagraphs(buf, xs, ourparams, text, par, send);
-			break;
-		case LATEX_BIB_ENVIRONMENT:
-			send = findLast(par, pend, LATEX_BIB_ENVIRONMENT);
-			par = makeParagraphBibliography(buf, xs, ourparams, text, par, send);
-			break;
+	switch (par->layout().latextype) {
+	case LATEX_COMMAND: {
+		// The files with which we are working never have more than
+		// one paragraph in a command structure.
+		// FIXME
+		// if (ourparams.docbook_in_par)
+		//   fix it so we don't get sections inside standard, e.g.
+		// note that we may then need to make runparams not const, so we
+		// can communicate that back.
+		// FIXME Maybe this fix should be in the routines themselves, in case
+		// they are called from elsewhere.
+		makeCommand(buf, xs, ourparams, text, par);
+		++par;
+		break;
+	}
+	case LATEX_ENVIRONMENT:
+	case LATEX_LIST_ENVIRONMENT:
+	case LATEX_ITEM_ENVIRONMENT:
+		// FIXME Same fix here.
+		send = findEndOfEnvironment(par, pend);
+		par = makeEnvironment(buf, xs, ourparams, text, par, send);
+		break;
+	case LATEX_PARAGRAPH:
+		send = findLast(par, pend, LATEX_PARAGRAPH);
+		par = makeParagraphs(buf, xs, ourparams, text, par, send);
+		break;
+	case LATEX_BIB_ENVIRONMENT:
+		send = findLast(par, pend, LATEX_BIB_ENVIRONMENT);
+		par = makeParagraphBibliography(buf, xs, ourparams, text, par, send);
+		break;
 	}
 
 	return make_pair(par, send);
 }
 
+ParagraphList::const_iterator makeAnySimple(
+		Text const &text,
+		Buffer const &buf,
+		XMLStream &xs,
+		OutputParams const &ourparams,
+		ParagraphList::const_iterator par)
+{
+	auto parnext = par;
+	++parnext;
+
+	switch (par->layout().latextype) {
+	case LATEX_COMMAND: {
+		// The files with which we are working never have more than
+		// one paragraph in a command structure.
+		// FIXME
+		// if (ourparams.docbook_in_par)
+		//   fix it so we don't get sections inside standard, e.g.
+		// note that we may then need to make runparams not const, so we
+		// can communicate that back.
+		// FIXME Maybe this fix should be in the routines themselves, in case
+		// they are called from elsewhere.
+		makeCommand(buf, xs, ourparams, text, par);
+		return parnext;
+	}
+	case LATEX_ENVIRONMENT:
+	case LATEX_LIST_ENVIRONMENT:
+	case LATEX_ITEM_ENVIRONMENT:
+		// FIXME Same fix here.
+		return makeEnvironment(buf, xs, ourparams, text, par, parnext);
+	case LATEX_PARAGRAPH:
+		return makeParagraphs(buf, xs, ourparams, text, par, parnext);
+	case LATEX_BIB_ENVIRONMENT:
+		return makeParagraphBibliography(buf, xs, ourparams, text, par, parnext);
+	}
+
+	// This should never happen. Return the next paragraph to avoid an infinite loop.
+	return parnext;
+}
+
 } // end anonymous namespace
 
 
@@ -883,7 +930,7 @@ DocBookInfoTag getParagraphsWithInfo(ParagraphList const &paragraphs, pit_type b
 			continue;
 		}
 
-		if (par.layout().name() == from_ascii("Abstract"))
+		if (par.layout().docbookabstract())
 			hasAbstractLayout = true;
 
 		// Based on layout information, store this paragraph in one set: should be in <info>, must be.
@@ -908,7 +955,7 @@ DocBookInfoTag getParagraphsWithInfo(ParagraphList const &paragraphs, pit_type b
 	if (hasAbstractLayout) {
 		pit_type pit = bpit;
 		while (pit < cpit) { // Don't overshoot the <info> part.
-			if (paragraphs[pit].layout().name() == from_ascii("Abstract"))
+			if (paragraphs[pit].layout().docbookabstract())
 				abstract.emplace(pit);
 			pit++;
 		}
@@ -953,17 +1000,22 @@ pit_type generateDocBookParagraphWithoutSectioning(
 		XMLStream & xs,
 		OutputParams const & runparams,
 		ParagraphList const & paragraphs,
-		pit_type bpit,
-		pit_type epit)
+		DocBookInfoTag const & info)
 {
+	auto bpit = info.bpit;
 	auto par = paragraphs.iterator_at(bpit);
 	auto lastStartedPar = par;
 	ParagraphList::const_iterator send;
 	auto const pend =
-			(epit == (int) paragraphs.size()) ?
-			paragraphs.end() : paragraphs.iterator_at(epit);
+			(info.epit == (int) paragraphs.size()) ?
+			paragraphs.end() : paragraphs.iterator_at(info.epit);
+
+	while (bpit < info.epit) {
+		if (info.abstract.find(bpit) != info.abstract.end()) {
+			bpit += 1;
+			continue;
+		}
 
-	while (bpit < epit) {
 		tie(par, send) = makeAny(text, buf, xs, runparams, par, send, pend);
 		bpit += distance(lastStartedPar, par);
 		lastStartedPar = par;
@@ -988,18 +1040,25 @@ void outputDocBookInfo(
 	bool hasAbstract = !info.abstract.empty();
 	docstring abstract;
 	if (hasAbstract) {
-		pit_type bpitAbstract = *std::min_element(info.abstract.begin(), info.abstract.end());
-		pit_type epitAbstract = *std::max_element(info.abstract.begin(), info.abstract.end());
-
 		odocstringstream os2;
-		XMLStream xs2(os2);
-		generateDocBookParagraphWithoutSectioning(text, buf, xs2, runparams, paragraphs, bpitAbstract, epitAbstract);
+		{
+			XMLStream xs2(os2);
+			auto bpit = *std::min_element(info.abstract.begin(), info.abstract.end());
+			auto epit = 1 + *std::max_element(info.abstract.begin(), info.abstract.end());
+			// info.abstract is inclusive, epit is exclusive, hence +1 for looping.
+
+			while (bpit < epit) {
+				makeAnySimple(text, buf, xs2, runparams, paragraphs.iterator_at(bpit));
+				xs2 << XMLStream::ESCAPE_NONE << from_ascii("<!-- " + to_string(bpit) + " -->");
+				bpit += 1;
+			}
+		}
 
 		// Actually output the abstract if there is something to do. Don't count line feeds or spaces in this,
 		// even though they must be properly output if there is some abstract.
-		docstring abstractContent = os2.str();
+		abstract = os2.str();
 		static const lyx::regex reg("[ \\r\\n]*");
-		abstractContent = from_utf8(lyx::regex_replace(to_utf8(abstractContent), reg, string("")));
+		docstring abstractContent = from_utf8(lyx::regex_replace(to_utf8(abstract), reg, string("")));
 
 		// Nothing? Then there is no abstract!
 		if (abstractContent.empty())
@@ -1016,19 +1075,29 @@ void outputDocBookInfo(
 		xs << xml::CR();
 	}
 
-	// Output the elements that should go in <info>.
-	generateDocBookParagraphWithoutSectioning(text, buf, xs, runparams, paragraphs, info.bpit, info.epit);
+	// Output the elements that should go in <info>, before and after the abstract.
+	xs << XMLStream::ESCAPE_NONE << "<!-- shouldBeInInfo -->";
+	for (auto pit : info.shouldBeInInfo) // Typically, the title: these elements are so important and ubiquitous
+		// that mandating a wrapper like <info> would repel users.
+		makeAnySimple(text, buf, xs, runparams, paragraphs.iterator_at(pit));
+	xs << XMLStream::ESCAPE_NONE << "<!-- mustBeInInfo -->";
+	for (auto pit : info.mustBeInInfo)
+		if (info.abstract.find(pit) == info.abstract.end()) // The abstract must be in info, but is dealt with after.
+			makeAnySimple(text, buf, xs, runparams, paragraphs.iterator_at(pit));
+	xs << XMLStream::ESCAPE_NONE << "<!-- /info -->";
 
-	if (hasAbstract && !abstract.empty()) { // The second test is probably superfluous.
-		string tag = paragraphs[*info.abstract.begin()].layout().docbookforceabstracttag();
-		if (tag == "NONE")
-			tag = "abstract";
-
-		xs << xml::StartTag(tag);
-		xs << xml::CR();
+	if (hasAbstract) {
+//		string tag = paragraphs[*info.abstract.begin()].layout().docbookforceabstracttag();
+//		if (tag == "NONE")
+//			tag = "abstract";
+//
+//		xs << xml::StartTag(tag);
+//		xs << xml::CR();
+		xs << XMLStream::ESCAPE_NONE << "<!-- abs -->";
 		xs << XMLStream::ESCAPE_NONE << abstract;
-		xs << xml::EndTag(tag);
-		xs << xml::CR();
+		xs << XMLStream::ESCAPE_NONE << "<!-- /abs -->";
+//		xs << xml::EndTag(tag);
+//		xs << xml::CR();
 	}
 
 	// End the <info> tag if it was started.
@@ -1057,23 +1126,14 @@ void docbookFirstParagraphs(
 }
 
 
-bool isParagraphEmpty(const Paragraph &par)
-{
-	InsetList const &insets = par.insetList();
-	size_t insetsLength = distance(insets.begin(), insets.end());
-	bool hasParagraphOnlyNote = insetsLength == 1 && insets.get(0) && insets.get(0)->asInsetCollapsible() &&
-								dynamic_cast<InsetNote *>(insets.get(0));
-	return hasParagraphOnlyNote;
-}
-
-
 void docbookSimpleAllParagraphs(
 		Text const & text,
 		Buffer const & buf,
 		XMLStream & xs,
 		OutputParams const & runparams)
 {
-	// Handle the document, supposing it has no sections (i.e. a "simple" document).
+	// Handle the given text, supposing it has no sections (i.e. a "simple" text). The input may vary in length
+	// between a single paragraph to a whole document.
 
 	// First, the <info> tag.
 	ParagraphList const &paragraphs = text.paragraphs();
@@ -1081,27 +1141,14 @@ void docbookSimpleAllParagraphs(
 	pit_type const epit = runparams.par_end;
 	DocBookInfoTag info = getParagraphsWithInfo(paragraphs, bpit, epit);
 	outputDocBookInfo(text, buf, xs, runparams, paragraphs, info);
-	bpit = info.bpit;
-
-	// Then, the content.
-	ParagraphList::const_iterator const pend =
-			(epit == (int) paragraphs.size()) ?
-			paragraphs.end() : paragraphs.iterator_at(epit);
 
+	// Then, the content. It starts where the <info> ends.
+	bpit = info.epit;
 	while (bpit < epit) {
 		auto par = paragraphs.iterator_at(bpit);
-		ParagraphList::const_iterator const lastStartedPar = par;
-		ParagraphList::const_iterator send;
-
-		if (isParagraphEmpty(*par)) {
-			++par;
-			bpit += distance(lastStartedPar, par);
-			continue;
-		}
-
-		// Generate this paragraph.
-		tie(par, send) = makeAny(text, buf, xs, runparams, par, send, pend);
-		bpit += distance(lastStartedPar, par);
+		if (!hasOnlyNotes(*par))
+			makeAnySimple(text, buf, xs, runparams, par);
+		bpit += 1;
 	}
 }
 
@@ -1155,7 +1202,7 @@ void docbookParagraphs(Text const &text,
 		ParagraphList::const_iterator const lastStartedPar = par;
 		ParagraphList::const_iterator send;
 
-		if (isParagraphEmpty(*par)) {
+		if (hasOnlyNotes(*par)) {
 			++par;
 			bpit += distance(lastStartedPar, par);
 			continue;
@@ -1250,4 +1297,4 @@ void docbookParagraphs(Text const &text,
 	}
 }
 
-} // namespace lyx
+} // namespace lyx
\ No newline at end of file
diff --git a/src/xml.h b/src/xml.h
index b585a48..e63623c 100644
--- a/src/xml.h
+++ b/src/xml.h
@@ -18,6 +18,8 @@
 #include <deque>
 #include <memory>
 
+#include <iostream>
+
 namespace lyx {
 
 class Buffer;

commit 92a00a7cf5189339e306002f557bca36b889a164
Author: Thibaut Cuvelier <tcuvelier at lyx.org>
Date:   Sun Aug 2 20:43:39 2020 +0200

    DocBook: simplify code to handle abstracts.

diff --git a/autotests/export/docbook/bibliography_precooked_aastex.xml b/autotests/export/docbook/bibliography_precooked_aastex.xml
index 2c9f5bd..e15bfdd 100644
--- a/autotests/export/docbook/bibliography_precooked_aastex.xml
+++ b/autotests/export/docbook/bibliography_precooked_aastex.xml
@@ -19,8 +19,10 @@
 <affiliation role="alternate"><orgname>Patron, Alonso's Bar and Grill</orgname></affiliation></author>
 <abstract><para>
 <para>This is a preliminary report on surface photometry of the major fraction of known globular clusters, to see which of them show the signs of a collapsed core. We also explore some diversionary mathematics and recreational tables. </para>
-<!-- Output Error: Tried to close `Keywords' when tag was not open. Tag discarded. -->
+<!-- Output Error: Tried to close `keyword' when tag was not open. Tag discarded. -->
+<!-- Output Error: Tried to close `keywordset' when tag was not open. Tag discarded. -->
 
+<keywordset><keyword>clusters: globular, peanut—bosons: bozos</keyword></keywordset>
 <!-- Output Error: Closing tag `info' when other tags are open, namely: -->
 <!-- Output Error: para -->
 </para><!-- Output Error: abstract -->
diff --git a/lib/layouts/aastex.layout b/lib/layouts/aastex.layout
index 445d25f..97c8b64 100644
--- a/lib/layouts/aastex.layout
+++ b/lib/layouts/aastex.layout
@@ -282,6 +282,9 @@ Style Abstract
 	  Series	Bold
 	  Size		Normal
 	EndFont
+	DocBookTag            abstract
+	DocBookItemTag        para
+	DocBookInInfo         always
 End
 
 
@@ -331,6 +334,9 @@ Style Keywords
 	  Shape		Italic
 	  Size		Normal
 	EndFont
+	DocBookTag          keyword
+	DocBookWrapperTag   keywordset
+	DocBookInInfo       always
 End
 
 
diff --git a/src/output_docbook.cpp b/src/output_docbook.cpp
index d0536ee..fd38940 100644
--- a/src/output_docbook.cpp
+++ b/src/output_docbook.cpp
@@ -50,7 +50,7 @@ namespace lyx {
 
 namespace {
 
-std::string const fontToDocBookTag(xml::FontTypes type)
+std::string fontToDocBookTag(xml::FontTypes type)
 {
 	switch (type) {
 	case xml::FontTypes::FT_EMPH:
@@ -90,6 +90,7 @@ std::string const fontToDocBookTag(xml::FontTypes type)
 	}
 }
 
+
 string fontToRole(xml::FontTypes type)
 {
 	// Specific fonts are achieved with roles. The only common ones are "" for basic emphasis,
@@ -103,14 +104,13 @@ string fontToRole(xml::FontTypes type)
 		return "";
 	case xml::FontTypes::FT_BOLD:
 		return "bold";
-	case xml::FontTypes::FT_NOUN:
-		return ""; // Outputs a <person>
-	case xml::FontTypes::FT_TYPE:
-		return ""; // Outputs a <code>
+	case xml::FontTypes::FT_NOUN: // Outputs a <person>
+	case xml::FontTypes::FT_TYPE: // Outputs a <code>
+		return "";
 	case xml::FontTypes::FT_UBAR:
 		return "underline";
 
-		// All other roles are non-standard for DocBook.
+	// All other roles are non-standard for DocBook.
 
 	case xml::FontTypes::FT_WAVE:
 		return "wave";
@@ -814,7 +814,21 @@ pair<ParagraphList::const_iterator, ParagraphList::const_iterator> makeAny(
 
 
 using DocBookDocumentSectioning = tuple<bool, pit_type>;
-using DocBookInfoTag = tuple<set<pit_type>, set<pit_type>, pit_type, pit_type>;
+
+
+struct DocBookInfoTag
+{
+	const set<pit_type> shouldBeInInfo;
+	const set<pit_type> mustBeInInfo;
+	const set<pit_type> abstract;
+	pit_type bpit;
+	pit_type epit;
+
+	DocBookInfoTag(const set<pit_type> & shouldBeInInfo, const set<pit_type> & mustBeInInfo,
+				   const set<pit_type> & abstract, pit_type bpit, pit_type epit) :
+				   shouldBeInInfo(shouldBeInInfo), mustBeInInfo(mustBeInInfo), abstract(abstract),
+				   bpit(bpit), epit(epit) {}
+};
 
 
 DocBookDocumentSectioning hasDocumentSectioning(ParagraphList const &paragraphs, pit_type bpit, pit_type const epit) {
@@ -847,6 +861,7 @@ bool hasOnlyNotes(Paragraph const & par)
 DocBookInfoTag getParagraphsWithInfo(ParagraphList const &paragraphs, pit_type bpit, pit_type const epit) {
 	set<pit_type> shouldBeInInfo;
 	set<pit_type> mustBeInInfo;
+	set<pit_type> abstract;
 
 	// Find the first non empty paragraph by mutating bpit.
 	while (bpit < epit) {
@@ -859,14 +874,18 @@ DocBookInfoTag getParagraphsWithInfo(ParagraphList const &paragraphs, pit_type b
 
 	// Find the last info-like paragraph.
 	pit_type cpit = bpit;
+	bool hasAbstractLayout = false;
 	while (cpit < epit) {
 		// Skip paragraphs only containing one note.
-		Paragraph const &par = paragraphs[cpit];
+		Paragraph const & par = paragraphs[cpit];
 		if (hasOnlyNotes(par)) {
 			cpit += 1;
 			continue;
 		}
 
+		if (par.layout().name() == from_ascii("Abstract"))
+			hasAbstractLayout = true;
+
 		// Based on layout information, store this paragraph in one set: should be in <info>, must be.
 		Layout const &style = par.layout();
 
@@ -876,42 +895,55 @@ DocBookInfoTag getParagraphsWithInfo(ParagraphList const &paragraphs, pit_type b
 			shouldBeInInfo.emplace(cpit);
 		} else {
 			// Hypothesis: the <info> parts should be grouped together near the beginning bpit.
+			// There may be notes in between, but nothing else.
 			break;
 		}
 		cpit += 1;
 	}
 	// Now, cpit points to the last paragraph that has things that could go in <info>.
-	// bpit is still the beginning of the <info> part.
-
-	return make_tuple(shouldBeInInfo, mustBeInInfo, bpit, cpit);
-}
-
-
-bool hasAbstractBetween(ParagraphList const &paragraphs, pit_type const bpitAbstract, pit_type const epitAbstract)
-{
-	// Hypothesis: the paragraphs between bpitAbstract and epitAbstract can be considered an abstract because they
-	// are just after a document or part title.
-	if (epitAbstract - bpitAbstract <= 0)
-		return false;
-
-	// If there is something between these paragraphs, check if it's compatible with an abstract (i.e. some text).
-	pit_type bpit = bpitAbstract;
-	while (bpit < epitAbstract) {
-		const Paragraph &p = paragraphs.at(bpit);
-
-		if (p.layout().name() == from_ascii("Abstract"))
-			return true;
+	// bpit is the beginning of the <info> part.
+
+	// Go once again through the list of paragraphs to find the abstract. If there is an abstract
+	// layout, only consider it. Otherwise, an abstract is just a sequence of paragraphs with text.
+	if (hasAbstractLayout) {
+		pit_type pit = bpit;
+		while (pit < cpit) { // Don't overshoot the <info> part.
+			if (paragraphs[pit].layout().name() == from_ascii("Abstract"))
+				abstract.emplace(pit);
+			pit++;
+		}
+	} else {
+		pit_type lastAbstract = epit + 1; // A nonsensical value.
+		docstring lastAbstractLayout;
+
+		pit_type pit = bpit;
+		while (pit < cpit) { // Don't overshoot the <info> part.
+			const Paragraph & par = paragraphs.at(pit);
+			if (!par.insetList().empty()) {
+				for (const auto &i : par.insetList()) {
+					if (i.inset->getText(0) != nullptr) {
+						if (lastAbstract == epit + 1) {
+							// First paragraph that matches the heuristic definition of abstract.
+							lastAbstract = pit;
+							lastAbstractLayout = par.layout().name();
+						} else if (pit > lastAbstract + 1 || par.layout().name() != lastAbstractLayout) {
+							// This is either too far from the last abstract paragraph or doesn't
+							// have the right layout name, BUT there has already been an abstract
+							// in this document: done with detecting the abstract.
+							goto done; // Easier to get out of two nested loops.
+						}
 
-		if (!p.insetList().empty()) {
-			for (const auto &i : p.insetList()) {
-				if (i.inset->getText(0) != nullptr) {
-					return true;
+						abstract.emplace(pit);
+						break;
+					}
 				}
 			}
+			pit++;
 		}
-		bpit++;
 	}
-	return false;
+
+	done:
+	return DocBookInfoTag(shouldBeInInfo, mustBeInInfo, abstract, bpit, cpit);
 }
 
 
@@ -947,26 +979,18 @@ void outputDocBookInfo(
 		XMLStream & xs,
 		OutputParams const & runparams,
 		ParagraphList const & paragraphs,
-		DocBookInfoTag const & info,
-		pit_type bpitAbstract,
-		pit_type const epitAbstract)
+		DocBookInfoTag const & info)
 {
-	// Consider everything between bpitAbstract and epitAbstract (excluded) as paragraphs for the abstract.
-	// Use bpitAbstract >= epitAbstract to indicate there is no abstract.
-
-	set<pit_type> shouldBeInInfo;
-	set<pit_type> mustBeInInfo;
-	pit_type bpitInfo;
-	pit_type epitInfo;
-	tie(shouldBeInInfo, mustBeInInfo, bpitInfo, epitInfo) = info;
-
 	// Perform an additional check on the abstract. Sometimes, there are many paragraphs that should go
 	// into the abstract, but none generates actual content. Thus, first generate to a temporary stream,
 	// then only create the <abstract> tag if these paragraphs generate some content.
 	// This check must be performed *before* a decision on whether or not to output <info> is made.
-	bool hasAbstract = hasAbstractBetween(paragraphs, bpitAbstract, epitAbstract);
+	bool hasAbstract = !info.abstract.empty();
 	docstring abstract;
 	if (hasAbstract) {
+		pit_type bpitAbstract = *std::min_element(info.abstract.begin(), info.abstract.end());
+		pit_type epitAbstract = *std::max_element(info.abstract.begin(), info.abstract.end());
+
 		odocstringstream os2;
 		XMLStream xs2(os2);
 		generateDocBookParagraphWithoutSectioning(text, buf, xs2, runparams, paragraphs, bpitAbstract, epitAbstract);
@@ -983,7 +1007,7 @@ void outputDocBookInfo(
 	}
 
 	// The abstract must go in <info>.
-	bool needInfo = !mustBeInInfo.empty() || hasAbstract;
+	bool needInfo = !info.mustBeInInfo.empty() || hasAbstract;
 
 	// Start the <info> tag if required.
 	if (needInfo) {
@@ -993,10 +1017,10 @@ void outputDocBookInfo(
 	}
 
 	// Output the elements that should go in <info>.
-	generateDocBookParagraphWithoutSectioning(text, buf, xs, runparams, paragraphs, bpitInfo, epitInfo);
+	generateDocBookParagraphWithoutSectioning(text, buf, xs, runparams, paragraphs, info.bpit, info.epit);
 
 	if (hasAbstract && !abstract.empty()) { // The second test is probably superfluous.
-		string tag = paragraphs[bpitAbstract].layout().docbookforceabstracttag();
+		string tag = paragraphs[*info.abstract.begin()].layout().docbookforceabstracttag();
 		if (tag == "NONE")
 			tag = "abstract";
 
@@ -1029,7 +1053,7 @@ void docbookFirstParagraphs(
 	ParagraphList const &paragraphs = text.paragraphs();
 	pit_type bpit = runparams.par_begin;
 	DocBookInfoTag info = getParagraphsWithInfo(paragraphs, bpit, epit);
-	outputDocBookInfo(text, buf, xs, runparams, paragraphs, info, get<3>(info), epit);
+	outputDocBookInfo(text, buf, xs, runparams, paragraphs, info);
 }
 
 
@@ -1056,8 +1080,8 @@ void docbookSimpleAllParagraphs(
 	pit_type bpit = runparams.par_begin;
 	pit_type const epit = runparams.par_end;
 	DocBookInfoTag info = getParagraphsWithInfo(paragraphs, bpit, epit);
-	outputDocBookInfo(text, buf, xs, runparams, paragraphs, info, 0, 0);
-	bpit = get<3>(info); // Generate the content starting from the end of the <info> part.
+	outputDocBookInfo(text, buf, xs, runparams, paragraphs, info);
+	bpit = info.bpit;
 
 	// Then, the content.
 	ParagraphList::const_iterator const pend =

commit 7c67c34dfd133b30f364420e87fc58dee9b6254e
Author: Thibaut Cuvelier <tcuvelier at lyx.org>
Date:   Sun Aug 2 19:00:07 2020 +0200

    DocBook: eat a bit of that spaghetti code.

diff --git a/src/output_docbook.cpp b/src/output_docbook.cpp
index 339f1c3..d0536ee 100644
--- a/src/output_docbook.cpp
+++ b/src/output_docbook.cpp
@@ -202,14 +202,10 @@ void openParTag(XMLStream & xs, const Paragraph * par, const Paragraph * prevpar
 	// first paragraph of an author, then merging with the previous tag does not make sense. Say the
 	// next paragraph is the affiliation, then it should be output in the same <author> tag (different
 	// layout, same wrapper tag).
-	bool openWrapper = false;
-	if (prevpar == nullptr) {
-		openWrapper = lay.docbookwrappertag() != "NONE";
-	} else {
+	bool openWrapper = lay.docbookwrappertag() != "NONE";
+	if (prevpar != nullptr) {
 		Layout const & prevlay = prevpar->layout();
-		if (prevlay.docbookwrappertag() == "NONE") {
-			openWrapper = lay.docbookwrappertag() != "NONE";
-		} else {
+		if (prevlay.docbookwrappertag() != "NONE") {
 			openWrapper = prevlay.docbookwrappertag() == lay.docbookwrappertag()
 					&& !lay.docbookwrappermergewithprevious();
 		}
@@ -238,14 +234,10 @@ void closeTag(XMLStream & xs, Paragraph const * par, Paragraph const * nextpar)
 		nextpar = nullptr;
 
 	// See comment in openParTag.
-	bool closeWrapper = false;
-	if (nextpar == nullptr) {
-		closeWrapper = lay.docbookwrappertag() != "NONE";
-	} else {
+	bool closeWrapper = lay.docbookwrappertag() != "NONE";
+	if (nextpar != nullptr) {
 		Layout const & nextlay = nextpar->layout();
-		if (nextlay.docbookwrappertag() == "NONE") {
-			closeWrapper = lay.docbookwrappertag() != "NONE";
-		} else {
+		if (nextlay.docbookwrappertag() != "NONE") {
 			closeWrapper = nextlay.docbookwrappertag() == lay.docbookwrappertag()
 					&& !nextlay.docbookwrappermergewithprevious();
 		}

commit 94d363c385b6c8bd997d745bb033a08565bc57da
Author: Thibaut Cuvelier <tcuvelier at lyx.org>
Date:   Sun Aug 2 18:58:36 2020 +0200

    DocBook: use DocBookWrapperMergeWithPrevious in the code.

diff --git a/autotests/export/docbook/bibliography_precooked_aastex.xml b/autotests/export/docbook/bibliography_precooked_aastex.xml
index b663868..2c9f5bd 100644
--- a/autotests/export/docbook/bibliography_precooked_aastex.xml
+++ b/autotests/export/docbook/bibliography_precooked_aastex.xml
@@ -4,23 +4,27 @@
 <article 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>Collapsed Cores in Globular Clusters,  Gauge-Boson Couplings, and AASTeX Examples</title>
-<author><personname>S. Djorgovski and Ivan R. King</personname></author>
-<author><affiliation><orgname>Astronomy Department, University of California, Berkeley, CA 94720</orgname></affiliation></author>
-<author><affiliation role="alternate"><orgname>Visiting Astronomer Cerro Tololo Inter-American Observatory.CTIO is operated by AURA Inc. under contract to the National Science Foundation.</orgname></affiliation></author>
-<author><affiliation role="alternate"><orgname>Society of Fellows, Harvard University.</orgname></affiliation></author>
-<author><affiliation role="alternate"><orgname>present address: Center for Astrophysics60 Garden Street, Cambridge, MA 02138</orgname></affiliation></author>
-<author><personname>C. D. Biemesderfer</personname></author>
-<author><affiliation><orgname>National Optical Astronomy Observatories, Tucson, AZ 85719</orgname></affiliation></author>
-<author><affiliation role="alternate"><orgname>Visiting Programmer, Space Telescope Science Institute</orgname></affiliation></author>
-<author><affiliation role="alternate"><orgname>Patron, Alonso's Bar and Grill</orgname></affiliation></author>
-<author><email>aastex-help at aas.org</email></author>
-<author><personname>R. J. Hanisch</personname></author>
-<author><affiliation><orgname>Space Telescope Science Institute, Baltimore, MD 21218</orgname></affiliation></author>
-<author><affiliation role="alternate"><orgname>Patron, Alonso's Bar and Grill</orgname></affiliation></author>
+<author><personname>S. Djorgovski and Ivan R. King</personname>
+<affiliation><orgname>Astronomy Department, University of California, Berkeley, CA 94720</orgname></affiliation>
+<affiliation role="alternate"><orgname>Visiting Astronomer Cerro Tololo Inter-American Observatory.CTIO is operated by AURA Inc. under contract to the National Science Foundation.</orgname></affiliation>
+<affiliation role="alternate"><orgname>Society of Fellows, Harvard University.</orgname></affiliation>
+<affiliation role="alternate"><orgname>present address: Center for Astrophysics60 Garden Street, Cambridge, MA 02138</orgname></affiliation></author>
+<author><personname>C. D. Biemesderfer</personname>
+<affiliation><orgname>National Optical Astronomy Observatories, Tucson, AZ 85719</orgname></affiliation>
+<affiliation role="alternate"><orgname>Visiting Programmer, Space Telescope Science Institute</orgname></affiliation>
+<affiliation role="alternate"><orgname>Patron, Alonso's Bar and Grill</orgname></affiliation>
+<email>aastex-help at aas.org</email></author>
+<author><personname>R. J. Hanisch</personname>
+<affiliation><orgname>Space Telescope Science Institute, Baltimore, MD 21218</orgname></affiliation>
+<affiliation role="alternate"><orgname>Patron, Alonso's Bar and Grill</orgname></affiliation></author>
 <abstract><para>
 <para>This is a preliminary report on surface photometry of the major fraction of known globular clusters, to see which of them show the signs of a collapsed core. We also explore some diversionary mathematics and recreational tables. </para>
-</para></abstract>
-</info>
+<!-- Output Error: Tried to close `Keywords' when tag was not open. Tag discarded. -->
+
+<!-- Output Error: Closing tag `info' when other tags are open, namely: -->
+<!-- Output Error: para -->
+</para><!-- Output Error: abstract -->
+</abstract></info>
 <section>
 <title>Introduction</title>
 <para>A focal problem today in the dynamics of globular clusters is core collapse. It has been predicted by theory for decades <biblioref endterm="hen61" />, <biblioref endterm="lyn68" />, <biblioref endterm="spi85" />, but observation has been less alert to the phenomenon. For many years the central brightness peak in M15 <biblioref endterm="kin75" />, <biblioref endterm="new78" /> seemed a unique anomaly. Then <biblioref endterm="aur82" /> suggested a central peak in NGC 6397, and a limited photographic survey of ours <biblioref endterm="djo84" /> found three more cases, including NGC 6624, whose sharp center had often been remarked on <biblioref endterm="can78" />. </para>
@@ -688,7 +692,8 @@ v(p,\lambda)_{\pm} & = & \pm\lambda(E\mp\lambda|{\textbf{p}}|)^{1/2}\chi
  </m:mtable>
  </m:math>
 </informalequation>
-</MathLetters>
+<!-- Output Error: Tried to close `title' when tag was not open. Tag discarded. -->
+
 </section>
 </section>
 <section>
@@ -964,8 +969,9 @@ v(p,\lambda)_{\pm} & = & \pm\lambda(E\mp\lambda|{\textbf{p}}|)^{1/2}\chi
  </m:mrow>
  </m:math>
 </inlineequation> of the electronically submitted abstracts for AAS meetings are error-free. </para>
-<acknowledgement><para>We are grateful to V. Barger, T. Han, and R. J. N. Phillips for doing the math in section&#xA0;<xref linkend="bozomath" />. More information on the AASTeX macros package are available at <link xlink:href="http://www.aas.org/publications/aastex">http://www.aas.org/publications/aastex</link> or the <link xlink:href="ftp://www.aas.org/pubs/AAS ftp site">AAS ftp site</link>.</para></acknowledgement>
-<para><application>IRAF, AIPS, Astropy, ...</application></para>
+<acknowledgement><para>We are grateful to V. Barger, T. Han, and R. J. N. Phillips for doing the math in section&#xA0;<xref linkend="bozomath" />. More information on the AASTeX macros package are available at <link xlink:href="http://www.aas.org/publications/aastex">http://www.aas.org/publications/aastex</link> or the <link xlink:href="ftp://www.aas.org/pubs/AAS ftp site">AAS ftp site</link>.</para>
+<application>IRAF, AIPS, Astropy, ...</application><!-- Output Error: Tried to close `para' when tag was not open. Tag discarded. -->
+
 <Appendix></Appendix>
 <bibliography>
 <bibliomixed xml:id='aur82'>Aurière, M. 1982, <!-- \aap -->, 109, 301 </bibliomixed>
diff --git a/lib/layouts/aastex.layout b/lib/layouts/aastex.layout
index 5db7dee..445d25f 100644
--- a/lib/layouts/aastex.layout
+++ b/lib/layouts/aastex.layout
@@ -175,10 +175,11 @@ Style Affiliation
 	  Family	Roman
 	  Size		Normal
 	EndFont
-	DocBookTag            affiliation
-	DocBookWrapperTag     author
-	DocBookItemTag        orgname
-	DocBookInInfo         always
+	DocBookTag                        affiliation
+	DocBookWrapperTag                 author
+	DocBookWrapperMergeWithPrevious   true
+	DocBookItemTag                    orgname
+	DocBookInInfo                     always
 End
 
 
@@ -201,11 +202,12 @@ Style Altaffilation
 	LabelFont
 	  Color		green
 	EndFont
-	DocBookTag            affiliation
-	DocBookAttr           role="alternate"
-	DocBookItemTag        orgname
-	DocBookWrapperTag     author
-	DocBookInInfo         always
+	DocBookTag                        affiliation
+	DocBookAttr                       role="alternate"
+	DocBookWrapperTag                 author
+	DocBookWrapperMergeWithPrevious   true
+	DocBookItemTag                    orgname
+	DocBookInInfo                     always
 End
 
 
@@ -225,9 +227,10 @@ Style Email
 	  Size		Normal
 	  Shape		Italic
 	EndFont
-	DocBookTag            email
-	DocBookWrapperTag     author
-	DocBookInInfo         always
+	DocBookTag                        email
+	DocBookWrapperTag                 author
+	DocBookWrapperMergeWithPrevious   true
+	DocBookInInfo                     always
 End
 
 
diff --git a/src/output_docbook.cpp b/src/output_docbook.cpp
index a081b2d..339f1c3 100644
--- a/src/output_docbook.cpp
+++ b/src/output_docbook.cpp
@@ -189,11 +189,34 @@ namespace {
 
 // convenience functions
 
-void openParTag(XMLStream & xs, Paragraph const & par)
+void openParTag(XMLStream & xs, const Paragraph * par, const Paragraph * prevpar)
 {
-	Layout const & lay = par.layout();
+	Layout const & lay = par->layout();
+
+	if (par == prevpar)
+		prevpar = nullptr;
+
+	// When should the wrapper be opened here? Only if the previous paragraph has the SAME wrapper tag
+	// (usually, they won't have the same layout) and the CURRENT one allows merging.
+	// The main use case is author information in several paragraphs: if the name of the author is the
+	// first paragraph of an author, then merging with the previous tag does not make sense. Say the
+	// next paragraph is the affiliation, then it should be output in the same <author> tag (different
+	// layout, same wrapper tag).
+	bool openWrapper = false;
+	if (prevpar == nullptr) {
+		openWrapper = lay.docbookwrappertag() != "NONE";
+	} else {
+		Layout const & prevlay = prevpar->layout();
+		if (prevlay.docbookwrappertag() == "NONE") {
+			openWrapper = lay.docbookwrappertag() != "NONE";
+		} else {
+			openWrapper = prevlay.docbookwrappertag() == lay.docbookwrappertag()
+					&& !lay.docbookwrappermergewithprevious();
+		}
+	}
 
-	if (lay.docbookwrappertag() != "NONE")
+	// Main logic.
+	if (openWrapper)
 		xs << xml::StartTag(lay.docbookwrappertag(), lay.docbookwrapperattr());
 
 	string tag = lay.docbooktag();
@@ -207,10 +230,28 @@ void openParTag(XMLStream & xs, Paragraph const & par)
 }
 
 
-void closeTag(XMLStream & xs, Paragraph const & par)
+void closeTag(XMLStream & xs, Paragraph const * par, Paragraph const * nextpar)
 {
-	Layout const & lay = par.layout();
+	Layout const & lay = par->layout();
+
+	if (par == nextpar)
+		nextpar = nullptr;
+
+	// See comment in openParTag.
+	bool closeWrapper = false;
+	if (nextpar == nullptr) {
+		closeWrapper = lay.docbookwrappertag() != "NONE";
+	} else {
+		Layout const & nextlay = nextpar->layout();
+		if (nextlay.docbookwrappertag() == "NONE") {
+			closeWrapper = lay.docbookwrappertag() != "NONE";
+		} else {
+			closeWrapper = nextlay.docbookwrappertag() == lay.docbookwrappertag()
+					&& !nextlay.docbookwrappermergewithprevious();
+		}
+	}
 
+	// Main logic.
 	if (lay.docbookitemtag() != "NONE")
 		xs << xml::EndTag(lay.docbookitemtag());
 
@@ -219,7 +260,7 @@ void closeTag(XMLStream & xs, Paragraph const & par)
 		tag = "para";
 
 	xs << xml::EndTag(tag);
-	if (lay.docbookwrappertag() != "NONE")
+	if (closeWrapper)
 		xs << xml::EndTag(lay.docbookwrappertag());
 }
 
@@ -399,9 +440,12 @@ ParagraphList::const_iterator makeParagraphs(
 		ParagraphList::const_iterator const & pbegin,
 		ParagraphList::const_iterator const & pend)
 {
-	ParagraphList::const_iterator const begin = text.paragraphs().begin();
+	auto const begin = text.paragraphs().begin();
+	auto const end = text.paragraphs().end();
 	ParagraphList::const_iterator par = pbegin;
-	for (; par != pend; ++par) {
+	ParagraphList::const_iterator prevpar = pbegin;
+
+	for (; par != pend; prevpar = par, ++par) {
 		// We want to open the paragraph tag if:
 		//   (i) the current layout permits multiple paragraphs
 		//  (ii) we are either not already inside a paragraph (HTMLIsBlock) OR
@@ -417,7 +461,7 @@ ParagraphList::const_iterator makeParagraphs(
 		// because of branches, e.g., a branch that contains an entire new section.
 		// We do not really want to wrap that whole thing in a <div>...</div>.
 		bool special_case = false;
-		Inset const *specinset = par->size() == 1 ? par->getInset(0) : 0;
+		Inset const *specinset = par->size() == 1 ? par->getInset(0) : nullptr;
 		if (specinset && !specinset->getLayout().htmlisblock()) { // TODO: Convert htmlisblock to a DocBook parameter?
 			Layout const &style = par->layout();
 			FontInfo const first_font = style.labeltype == LABEL_MANUAL ?
@@ -466,7 +510,7 @@ ParagraphList::const_iterator makeParagraphs(
 		//		or we're not in the last paragraph, anyway.
 		//   (ii) We didn't open it and docbook_in_par is true,
 		//		but we are in the first par, and there is a next par.
-		ParagraphList::const_iterator nextpar = par;
+		auto nextpar = par;
 		++nextpar;
 		bool const close_par =
 				((open_par && (!runparams.docbook_in_par || nextpar != pend))
@@ -484,12 +528,12 @@ ParagraphList::const_iterator makeParagraphs(
 
 		if (!cleaned.empty()) {
 			if (open_par)
-				openParTag(xs, *par);
+				openParTag(xs, &*par, &*prevpar);
 
 			xs << XMLStream::ESCAPE_NONE << os2.str();
 
 			if (close_par) {
-				closeTag(xs, *par);
+				closeTag(xs, &*par, (nextpar != end) ? &*nextpar : nullptr);
 				xs << xml::CR();
 			}
 		}
@@ -514,11 +558,24 @@ ParagraphList::const_iterator makeEnvironment(
 		ParagraphList::const_iterator const & pend)
 {
 	auto const begin = text.paragraphs().begin();
+	auto const end = text.paragraphs().end();
 	ParagraphList::const_iterator par = pbegin;
 	depth_type const origdepth = pbegin->params().depth();
 
+	// Find the previous paragraph.
+	auto prevpar = begin;
+	if (prevpar != par) {
+		auto prevpar_next = prevpar;
+		++prevpar_next;
+
+		while (prevpar_next != par) {
+			++prevpar_next;
+			++prevpar;
+		}
+	}
+
 	// open tag for this environment
-	openParTag(xs, *par);
+	openParTag(xs, &*par, &*prevpar);
 	xs << xml::CR();
 
 	// we will on occasion need to remember a layout from before.
@@ -672,7 +729,9 @@ ParagraphList::const_iterator makeEnvironment(
 			xs << xml::CR();
 		}
 	}
-	closeTag(xs, *par);
+	auto nextpar = par;
+	++nextpar;
+	closeTag(xs, &*par, (nextpar != end) ? &*nextpar : nullptr);
 	xs << xml::CR();
 	return pend;
 }
@@ -686,14 +745,30 @@ void makeCommand(
 		ParagraphList::const_iterator const & pbegin)
 {
 	// No need for labels, as they are handled by DocBook tags.
+	auto const begin = text.paragraphs().begin();
+	auto const end = text.paragraphs().end();
+	auto nextpar = pbegin;
+	++nextpar;
+
+	// Find the previous paragraph.
+	auto prevpar = begin;
+	if (prevpar != pbegin) {
+		auto prevpar_next = prevpar;
+		++prevpar_next;
+
+		while (prevpar_next != pbegin) {
+			++prevpar_next;
+			++prevpar;
+		}
+	}
 
-	openParTag(xs, *pbegin);
+	// Generate this command.
+	openParTag(xs, &*pbegin, &*prevpar);
 
-	auto const begin = text.paragraphs().begin();
 	pbegin->simpleDocBookOnePar(buf, xs, runparams,
 								text.outerFont(distance(begin, pbegin)));
 
-	closeTag(xs, *pbegin);
+	closeTag(xs, &*pbegin, (nextpar != end) ? &*nextpar : nullptr);
 	xs << xml::CR();
 }
 

commit 654e4acd6407087a1ca3f6ccfa3cf9be8f0df226
Author: Thibaut Cuvelier <tcuvelier at lyx.org>
Date:   Sun Aug 2 18:07:07 2020 +0200

    DocBook: fix for ordering.

diff --git a/src/Layout.cpp b/src/Layout.cpp
index a7e80ea..eeb58d0 100644
--- a/src/Layout.cpp
+++ b/src/Layout.cpp
@@ -235,8 +235,8 @@ bool Layout::readIgnoreForcelocal(Lexer & lex, TextClass const & tclass)
 		{ "docbooksectiontag",       LT_DOCBOOKSECTIONTAG },
 		{ "docbooktag",              LT_DOCBOOKTAG },
 		{ "docbookwrapperattr",      LT_DOCBOOKWRAPPERATTR },
-		{ "docbookwrappertag",       LT_DOCBOOKWRAPPERTAG },
 		{ "docbookwrappermergewithprevious", LT_DOCBOOKWRAPPERMERGEWITHPREVIOUS },
+		{ "docbookwrappertag",       LT_DOCBOOKWRAPPERTAG },
 		{ "end",            LT_END },
 		{ "endlabelstring", LT_ENDLABELSTRING },
 		{ "endlabeltype",   LT_ENDLABELTYPE },

commit 4fde95ff2b031e59eba8f4d70e03a8fb9801442d
Author: Thibaut Cuvelier <tcuvelier at lyx.org>
Date:   Sun Aug 2 17:35:16 2020 +0200

    DocBook: make openParTag/closeTag use paragraphs instead of layouts.
    
    Not useful per se, but will be next with checking whether the wrapper tags should be opened/closed.

diff --git a/src/output_docbook.cpp b/src/output_docbook.cpp
index 2e7b637..a081b2d 100644
--- a/src/output_docbook.cpp
+++ b/src/output_docbook.cpp
@@ -189,8 +189,10 @@ namespace {
 
 // convenience functions
 
-void openParTag(XMLStream & xs, Layout const & lay)
+void openParTag(XMLStream & xs, Paragraph const & par)
 {
+	Layout const & lay = par.layout();
+
 	if (lay.docbookwrappertag() != "NONE")
 		xs << xml::StartTag(lay.docbookwrappertag(), lay.docbookwrapperattr());
 
@@ -205,8 +207,10 @@ void openParTag(XMLStream & xs, Layout const & lay)
 }
 
 
-void closeTag(XMLStream & xs, Layout const & lay)
+void closeTag(XMLStream & xs, Paragraph const & par)
 {
+	Layout const & lay = par.layout();
+
 	if (lay.docbookitemtag() != "NONE")
 		xs << xml::EndTag(lay.docbookitemtag());
 
@@ -294,8 +298,8 @@ ParagraphList::const_iterator findEndOfEnvironment(
 		ParagraphList::const_iterator const & pend)
 {
 	ParagraphList::const_iterator p = pstart;
-	Layout const &bstyle = p->layout();
 	size_t const depth = p->params().depth();
+
 	for (++p; p != pend; ++p) {
 		Layout const &style = p->layout();
 		// It shouldn't happen that e.g. a section command occurs inside
@@ -315,9 +319,10 @@ ParagraphList::const_iterator findEndOfEnvironment(
 		// FIXME I am not sure about the first check.
 		// Surely we *could* have different layouts that count as
 		// LATEX_PARAGRAPH, right?
-		if (style.latextype == LATEX_PARAGRAPH || style != bstyle)
+		if (style.latextype == LATEX_PARAGRAPH || style != p->layout())
 			return p;
 	}
+
 	return pend;
 }
 
@@ -397,8 +402,6 @@ ParagraphList::const_iterator makeParagraphs(
 	ParagraphList::const_iterator const begin = text.paragraphs().begin();
 	ParagraphList::const_iterator par = pbegin;
 	for (; par != pend; ++par) {
-		Layout const &lay = par->layout();
-
 		// We want to open the paragraph tag if:
 		//   (i) the current layout permits multiple paragraphs
 		//  (ii) we are either not already inside a paragraph (HTMLIsBlock) OR
@@ -428,7 +431,7 @@ ParagraphList::const_iterator makeParagraphs(
 		}
 
 		// Plain layouts must be ignored.
-		if (!special_case && buf.params().documentClass().isPlainLayout(lay) && !runparams.docbook_force_pars)
+		if (!special_case && buf.params().documentClass().isPlainLayout(par->layout()) && !runparams.docbook_force_pars)
 			special_case = true;
 		// TODO: Could get rid of this with a DocBook equivalent to htmlisblock?
 		if (!special_case && par->size() == 1 && par->getInset(0)) {
@@ -481,12 +484,12 @@ ParagraphList::const_iterator makeParagraphs(
 
 		if (!cleaned.empty()) {
 			if (open_par)
-				openParTag(xs, lay);
+				openParTag(xs, *par);
 
 			xs << XMLStream::ESCAPE_NONE << os2.str();
 
 			if (close_par) {
-				closeTag(xs, lay);
+				closeTag(xs, *par);
 				xs << xml::CR();
 			}
 		}
@@ -510,13 +513,12 @@ ParagraphList::const_iterator makeEnvironment(
 		ParagraphList::const_iterator const & pbegin,
 		ParagraphList::const_iterator const & pend)
 {
-	ParagraphList::const_iterator const begin = text.paragraphs().begin();
+	auto const begin = text.paragraphs().begin();
 	ParagraphList::const_iterator par = pbegin;
-	Layout const &bstyle = par->layout();
 	depth_type const origdepth = pbegin->params().depth();
 
 	// open tag for this environment
-	openParTag(xs, bstyle);
+	openParTag(xs, *par);
 	xs << xml::CR();
 
 	// we will on occasion need to remember a layout from before.
@@ -535,7 +537,7 @@ ParagraphList::const_iterator makeEnvironment(
 			// One is that we are still in the environment in which we
 			// started---which we will be if the depth is the same.
 			if (par->params().depth() == origdepth) {
-				LATTEST(bstyle == style);
+				LATTEST(par->layout() == style);
 				if (lastlay != nullptr) {
 					closeItemTag(xs, *lastlay);
 					if (lastlay->docbookitemwrappertag() != "NONE") {
@@ -670,7 +672,7 @@ ParagraphList::const_iterator makeEnvironment(
 			xs << xml::CR();
 		}
 	}
-	closeTag(xs, bstyle);
+	closeTag(xs, *par);
 	xs << xml::CR();
 	return pend;
 }
@@ -683,16 +685,15 @@ void makeCommand(
 		Text const & text,
 		ParagraphList::const_iterator const & pbegin)
 {
-	Layout const &style = pbegin->layout();
-
 	// No need for labels, as they are handled by DocBook tags.
 
-	openParTag(xs, style);
+	openParTag(xs, *pbegin);
 
-	ParagraphList::const_iterator const begin = text.paragraphs().begin();
+	auto const begin = text.paragraphs().begin();
 	pbegin->simpleDocBookOnePar(buf, xs, runparams,
 								text.outerFont(distance(begin, pbegin)));
-	closeTag(xs, style);
+
+	closeTag(xs, *pbegin);
 	xs << xml::CR();
 }
 

commit 00c43995280178021b0502620fd6fe9c424b6495
Author: Thibaut Cuvelier <tcuvelier at lyx.org>
Date:   Sun Aug 2 17:28:50 2020 +0200

    DocBook: use DocBookItemTag within paragraphs.
    
    This is at least helpful for AAS, even though it slightly resembles a repurposition of that parameter.

diff --git a/autotests/export/docbook/bibliography_precooked_aastex.xml b/autotests/export/docbook/bibliography_precooked_aastex.xml
index 37dada8..b663868 100644
--- a/autotests/export/docbook/bibliography_precooked_aastex.xml
+++ b/autotests/export/docbook/bibliography_precooked_aastex.xml
@@ -5,21 +5,21 @@
 <info>
 <title>Collapsed Cores in Globular Clusters,  Gauge-Boson Couplings, and AASTeX Examples</title>
 <author><personname>S. Djorgovski and Ivan R. King</personname></author>
-<author><affiliation>Astronomy Department, University of California, Berkeley, CA 94720</affiliation></author>
-<author><affiliation role="alternate">Visiting Astronomer Cerro Tololo Inter-American Observatory.CTIO is operated by AURA Inc. under contract to the National Science Foundation.</affiliation></author>
-<author><affiliation role="alternate">Society of Fellows, Harvard University.</affiliation></author>
-<author><affiliation role="alternate">present address: Center for Astrophysics60 Garden Street, Cambridge, MA 02138</affiliation></author>
+<author><affiliation><orgname>Astronomy Department, University of California, Berkeley, CA 94720</orgname></affiliation></author>
+<author><affiliation role="alternate"><orgname>Visiting Astronomer Cerro Tololo Inter-American Observatory.CTIO is operated by AURA Inc. under contract to the National Science Foundation.</orgname></affiliation></author>
+<author><affiliation role="alternate"><orgname>Society of Fellows, Harvard University.</orgname></affiliation></author>
+<author><affiliation role="alternate"><orgname>present address: Center for Astrophysics60 Garden Street, Cambridge, MA 02138</orgname></affiliation></author>
 <author><personname>C. D. Biemesderfer</personname></author>
-<author><affiliation>National Optical Astronomy Observatories, Tucson, AZ 85719</affiliation></author>
-<author><affiliation role="alternate">Visiting Programmer, Space Telescope Science Institute</affiliation></author>
-<author><affiliation role="alternate">Patron, Alonso's Bar and Grill</affiliation></author>
+<author><affiliation><orgname>National Optical Astronomy Observatories, Tucson, AZ 85719</orgname></affiliation></author>
+<author><affiliation role="alternate"><orgname>Visiting Programmer, Space Telescope Science Institute</orgname></affiliation></author>
+<author><affiliation role="alternate"><orgname>Patron, Alonso's Bar and Grill</orgname></affiliation></author>
 <author><email>aastex-help at aas.org</email></author>
 <author><personname>R. J. Hanisch</personname></author>
-<author><affiliation>Space Telescope Science Institute, Baltimore, MD 21218</affiliation></author>
-<author><affiliation role="alternate">Patron, Alonso's Bar and Grill</affiliation></author>
-<abstract>
+<author><affiliation><orgname>Space Telescope Science Institute, Baltimore, MD 21218</orgname></affiliation></author>
+<author><affiliation role="alternate"><orgname>Patron, Alonso's Bar and Grill</orgname></affiliation></author>
+<abstract><para>
 <para>This is a preliminary report on surface photometry of the major fraction of known globular clusters, to see which of them show the signs of a collapsed core. We also explore some diversionary mathematics and recreational tables. </para>
-</abstract>
+</para></abstract>
 </info>
 <section>
 <title>Introduction</title>
diff --git a/lib/layouts/aastex.layout b/lib/layouts/aastex.layout
index 275018a..5db7dee 100644
--- a/lib/layouts/aastex.layout
+++ b/lib/layouts/aastex.layout
@@ -155,6 +155,9 @@ Style Author
 	  Series	Medium
 	  Shape		SmallCaps
 	EndFont
+	DocBookTag            personname
+	DocBookWrapperTag     author
+	DocBookInInfo         always
 End
 
 
@@ -172,6 +175,10 @@ Style Affiliation
 	  Family	Roman
 	  Size		Normal
 	EndFont
+	DocBookTag            affiliation
+	DocBookWrapperTag     author
+	DocBookItemTag        orgname
+	DocBookInInfo         always
 End
 
 
@@ -194,6 +201,11 @@ Style Altaffilation
 	LabelFont
 	  Color		green
 	EndFont
+	DocBookTag            affiliation
+	DocBookAttr           role="alternate"
+	DocBookItemTag        orgname
+	DocBookWrapperTag     author
+	DocBookInInfo         always
 End
 
 
@@ -213,6 +225,9 @@ Style Email
 	  Size		Normal
 	  Shape		Italic
 	EndFont
+	DocBookTag            email
+	DocBookWrapperTag     author
+	DocBookInInfo         always
 End
 
 
diff --git a/src/output_docbook.cpp b/src/output_docbook.cpp
index 434148b..2e7b637 100644
--- a/src/output_docbook.cpp
+++ b/src/output_docbook.cpp
@@ -191,20 +191,25 @@ namespace {
 
 void openParTag(XMLStream & xs, Layout const & lay)
 {
-	if (lay.docbookwrappertag() != "NONE") {
+	if (lay.docbookwrappertag() != "NONE")
 		xs << xml::StartTag(lay.docbookwrappertag(), lay.docbookwrapperattr());
-	}
 
 	string tag = lay.docbooktag();
 	if (tag == "Plain Layout")
 		tag = "para";
 
 	xs << xml::ParTag(tag, lay.docbookattr());
+
+	if (lay.docbookitemtag() != "NONE")
+		xs << xml::StartTag(lay.docbookitemtag(), lay.docbookitemattr());
 }
 
 
 void closeTag(XMLStream & xs, Layout const & lay)
 {
+	if (lay.docbookitemtag() != "NONE")
+		xs << xml::EndTag(lay.docbookitemtag());
+
 	string tag = lay.docbooktag();
 	if (tag == "Plain Layout")
 		tag = "para";

commit c46ea5b207ab7b86cd68e04e38bbd684d11062c4
Author: Thibaut Cuvelier <tcuvelier at lyx.org>
Date:   Sun Aug 2 17:23:37 2020 +0200

    Merge findLastParagraph and findLastBibliographyParagraph to lower code duplication.
    
    Maybe these functions should move to ParagraphList.h/cpp?

diff --git a/src/output_docbook.cpp b/src/output_docbook.cpp
index 5b788f3..434148b 100644
--- a/src/output_docbook.cpp
+++ b/src/output_docbook.cpp
@@ -266,10 +266,11 @@ inline void closeItemTag(XMLStream & xs, Layout const & lay)
 
 // end of convenience functions
 
-ParagraphList::const_iterator findLastParagraph(
+ParagraphList::const_iterator findLast(
 		ParagraphList::const_iterator p,
-		ParagraphList::const_iterator const & pend) {
-	for (++p; p != pend && p->layout().latextype == LATEX_PARAGRAPH; ++p);
+		ParagraphList::const_iterator const & pend,
+		LatexType type) {
+	for (++p; p != pend && p->layout().latextype == type; ++p);
 
 	return p;
 }
@@ -644,11 +645,11 @@ ParagraphList::const_iterator makeEnvironment(
 			break;
 		}
 		case LATEX_PARAGRAPH:
-			send = findLastParagraph(par, pend);
+			send = findLast(par, pend, LATEX_PARAGRAPH);
 			par = makeParagraphs(buf, xs, runparams, text, par, send);
 			break;
 		case LATEX_BIB_ENVIRONMENT:
-			send = findLastBibliographyParagraph(par, pend);
+			send = findLast(par, pend, LATEX_BIB_ENVIRONMENT);
 			par = makeParagraphBibliography(buf, xs, runparams, text, par, send);
 			break;
 		case LATEX_COMMAND:
@@ -718,22 +719,19 @@ pair<ParagraphList::const_iterator, ParagraphList::const_iterator> makeAny(
 		}
 		case LATEX_ENVIRONMENT:
 		case LATEX_LIST_ENVIRONMENT:
-		case LATEX_ITEM_ENVIRONMENT: {
+		case LATEX_ITEM_ENVIRONMENT:
 			// FIXME Same fix here.
 			send = findEndOfEnvironment(par, pend);
 			par = makeEnvironment(buf, xs, ourparams, text, par, send);
 			break;
-		}
-		case LATEX_BIB_ENVIRONMENT: {
-			send = findLastBibliographyParagraph(par, pend);
-			par = makeParagraphBibliography(buf, xs, ourparams, text, par, send);
-			break;
-		}
-		case LATEX_PARAGRAPH: {
-			send = findLastParagraph(par, pend);
+		case LATEX_PARAGRAPH:
+			send = findLast(par, pend, LATEX_PARAGRAPH);
 			par = makeParagraphs(buf, xs, ourparams, text, par, send);
 			break;
-		}
+		case LATEX_BIB_ENVIRONMENT:
+			send = findLast(par, pend, LATEX_BIB_ENVIRONMENT);
+			par = makeParagraphBibliography(buf, xs, ourparams, text, par, send);
+			break;
 	}
 
 	return make_pair(par, send);

commit 686ed9071898da4368c9664f265e2b09c35289fa
Author: Thibaut Cuvelier <tcuvelier at lyx.org>
Date:   Sun Aug 2 17:17:25 2020 +0200

    Slight code-consistency improvements.

diff --git a/src/output_docbook.cpp b/src/output_docbook.cpp
index 2199239..5b788f3 100644
--- a/src/output_docbook.cpp
+++ b/src/output_docbook.cpp
@@ -189,7 +189,7 @@ namespace {
 
 // convenience functions
 
-void openParTag(XMLStream &xs, Layout const &lay)
+void openParTag(XMLStream & xs, Layout const & lay)
 {
 	if (lay.docbookwrappertag() != "NONE") {
 		xs << xml::StartTag(lay.docbookwrappertag(), lay.docbookwrapperattr());
@@ -203,7 +203,7 @@ void openParTag(XMLStream &xs, Layout const &lay)
 }
 
 
-void closeTag(XMLStream &xs, Layout const &lay)
+void closeTag(XMLStream & xs, Layout const & lay)
 {
 	string tag = lay.docbooktag();
 	if (tag == "Plain Layout")
@@ -228,14 +228,14 @@ void closeLabelTag(XMLStream & xs, Layout const & lay)
 }
 
 
-void openItemTag(XMLStream &xs, Layout const &lay)
+void openItemTag(XMLStream & xs, Layout const & lay)
 {
 	xs << xml::StartTag(lay.docbookitemtag(), lay.docbookitemattr());
 }
 
 
 // Return true when new elements are output in a paragraph, false otherwise.
-bool openInnerItemTag(XMLStream &xs, Layout const &lay)
+bool openInnerItemTag(XMLStream & xs, Layout const & lay)
 {
 	if (lay.docbookiteminnertag() != "NONE") {
 		xs << xml::CR();
@@ -249,7 +249,7 @@ bool openInnerItemTag(XMLStream &xs, Layout const &lay)
 }
 
 
-void closeInnerItemTag(XMLStream &xs, Layout const &lay)
+void closeInnerItemTag(XMLStream & xs, Layout const & lay)
 {
 	if (lay.docbookiteminnertag()!= "NONE") {
 		xs << xml::EndTag(lay.docbookiteminnertag());
@@ -258,7 +258,7 @@ void closeInnerItemTag(XMLStream &xs, Layout const &lay)
 }
 
 
-inline void closeItemTag(XMLStream &xs, Layout const &lay)
+inline void closeItemTag(XMLStream & xs, Layout const & lay)
 {
 	xs << xml::EndTag(lay.docbookitemtag());
 	xs << xml::CR();

commit 8124fc85c01f22bfc374848580224c4baceeb128
Author: Thibaut Cuvelier <tcuvelier at lyx.org>
Date:   Sun Aug 2 17:07:38 2020 +0200

    DocBook: add new layout parameter DocBookWrapperMergeWithPrevious.

diff --git a/lib/scripts/layout2layout.py b/lib/scripts/layout2layout.py
index 60d4593..e69deba 100644
--- a/lib/scripts/layout2layout.py
+++ b/lib/scripts/layout2layout.py
@@ -11,7 +11,7 @@
 # This script will update a .layout file to current format
 
 # The latest layout format is also defined in src/TextClass.cpp
-currentFormat = 82
+currentFormat = 83
 
 
 # Incremented to format 4, 6 April 2007, lasgouttes
@@ -281,6 +281,9 @@ currentFormat = 82
 # - Removed tag Header from ClassOptionsClassOptions
 # - Removed tag Element for flex insets
 
+# Incremented to format 83, 2 August 2020 by dourouc05
+# New tag DocBookWrapperMergeWithPrevious
+
 # Do not forget to document format change in Customization
 # Manual (section "Declaring a new text class").
 
diff --git a/src/Layout.cpp b/src/Layout.cpp
index c45fd5c..a7e80ea 100644
--- a/src/Layout.cpp
+++ b/src/Layout.cpp
@@ -109,6 +109,7 @@ enum LayoutTags {
 	LT_DOCBOOKININFO,
 	LT_DOCBOOKWRAPPERTAG,
 	LT_DOCBOOKWRAPPERATTR,
+	LT_DOCBOOKWRAPPERMERGEWITHPREVIOUS,
 	LT_DOCBOOKSECTIONTAG,
 	LT_DOCBOOKITEMWRAPPERTAG,
 	LT_DOCBOOKITEMWRAPPERATTR,
@@ -176,6 +177,7 @@ Layout::Layout()
 	htmllabelfirst_ = false;
 	htmlforcecss_ = false;
 	htmltitle_ = false;
+	docbookwrappermergewithprevious_ = false;
 	spellcheck = true;
 	forcelocal = 0;
 	itemcommand_ = "item";
@@ -234,6 +236,7 @@ bool Layout::readIgnoreForcelocal(Lexer & lex, TextClass const & tclass)
 		{ "docbooktag",              LT_DOCBOOKTAG },
 		{ "docbookwrapperattr",      LT_DOCBOOKWRAPPERATTR },
 		{ "docbookwrappertag",       LT_DOCBOOKWRAPPERTAG },
+		{ "docbookwrappermergewithprevious", LT_DOCBOOKWRAPPERMERGEWITHPREVIOUS },
 		{ "end",            LT_END },
 		{ "endlabelstring", LT_ENDLABELSTRING },
 		{ "endlabeltype",   LT_ENDLABELTYPE },
@@ -743,6 +746,10 @@ bool Layout::readIgnoreForcelocal(Lexer & lex, TextClass const & tclass)
 			lex >> docbookwrapperattr_;
 			break;
 
+		case LT_DOCBOOKWRAPPERMERGEWITHPREVIOUS:
+			lex >> docbookwrappermergewithprevious_;
+			break;
+
 		case LT_DOCBOOKSECTIONTAG:
 			lex >> docbooksectiontag_;
 			break;
@@ -1610,6 +1617,7 @@ void Layout::write(ostream & os) const
 		os << "\tDocBookItemWrapperTag " << docbookitemwrappertag_ << '\n';
 	if(!docbookitemwrapperattr_.empty())
 		os << "\tDocBookItemWrapperAttr " << docbookitemwrapperattr_ << '\n';
+	os << "\tDocBookItemWrapperMergeWithPrevious " << docbookwrappermergewithprevious_ << '\n';
 	if(!docbookitemlabeltag_.empty())
 		os << "\tDocBookItemLabelTag " << docbookitemlabeltag_ << '\n';
 	if(!docbookitemlabelattr_.empty())
diff --git a/src/Layout.h b/src/Layout.h
index 7e9409a..d9eb893 100644
--- a/src/Layout.h
+++ b/src/Layout.h
@@ -203,6 +203,8 @@ public:
 	///
 	std::string const & docbookwrapperattr() const;
 	///
+	bool docbookwrappermergewithprevious() const { return docbookwrappermergewithprevious_; }
+	///
 	std::string const & docbooksectiontag() const;
 	///
 	std::string const & docbookitemwrappertag() const;
@@ -512,6 +514,8 @@ private:
 	mutable std::string docbookwrappertag_;
 	/// Roles to add to docbookwrappertag_, if any (default: none).
 	mutable std::string docbookwrapperattr_;
+	/// Whether this wrapper tag may be merged with the previously opened wrapper tag.
+	bool docbookwrappermergewithprevious_;
 	/// Outer tag for this section, only if this layout represent a sectionning item, including chapters (default: section).
 	mutable std::string docbooksectiontag_;
 	/// Whether this tag must/can/can't go into an <info> tag (default: never, as it only makes sense for metadata).
diff --git a/src/TextClass.cpp b/src/TextClass.cpp
index eb92612..79cdabd 100644
--- a/src/TextClass.cpp
+++ b/src/TextClass.cpp
@@ -62,7 +62,7 @@ namespace lyx {
 // You should also run the development/tools/updatelayouts.py script,
 // to update the format of all of our layout files.
 //
-int const LAYOUT_FORMAT = 82; // dourouc05: DocBook additions.
+int const LAYOUT_FORMAT = 83; // tcuvelier: DocBookWrapperMergeWithPrevious.
 
 
 // Layout format for the current lyx file format. Controls which format is

commit cd6dd9c95722948b45620216b34ffcdbd1636090
Author: Thibaut Cuvelier <tcuvelier at lyx.org>
Date:   Sun Aug 2 16:52:33 2020 +0200

    DocBook: allow empty paragraphs before the <info> section.

diff --git a/autotests/export/docbook/bibliography_precooked_aastex.xml b/autotests/export/docbook/bibliography_precooked_aastex.xml
index 89b1714..37dada8 100644
--- a/autotests/export/docbook/bibliography_precooked_aastex.xml
+++ b/autotests/export/docbook/bibliography_precooked_aastex.xml
@@ -3,6 +3,23 @@
   See http://www.lyx.org/ for more information -->
 <article 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>Collapsed Cores in Globular Clusters,  Gauge-Boson Couplings, and AASTeX Examples</title>
+<author><personname>S. Djorgovski and Ivan R. King</personname></author>
+<author><affiliation>Astronomy Department, University of California, Berkeley, CA 94720</affiliation></author>
+<author><affiliation role="alternate">Visiting Astronomer Cerro Tololo Inter-American Observatory.CTIO is operated by AURA Inc. under contract to the National Science Foundation.</affiliation></author>
+<author><affiliation role="alternate">Society of Fellows, Harvard University.</affiliation></author>
+<author><affiliation role="alternate">present address: Center for Astrophysics60 Garden Street, Cambridge, MA 02138</affiliation></author>
+<author><personname>C. D. Biemesderfer</personname></author>
+<author><affiliation>National Optical Astronomy Observatories, Tucson, AZ 85719</affiliation></author>
+<author><affiliation role="alternate">Visiting Programmer, Space Telescope Science Institute</affiliation></author>
+<author><affiliation role="alternate">Patron, Alonso's Bar and Grill</affiliation></author>
+<author><email>aastex-help at aas.org</email></author>
+<author><personname>R. J. Hanisch</personname></author>
+<author><affiliation>Space Telescope Science Institute, Baltimore, MD 21218</affiliation></author>
+<author><affiliation role="alternate">Patron, Alonso's Bar and Grill</affiliation></author>
+<abstract>
+<para>This is a preliminary report on surface photometry of the major fraction of known globular clusters, to see which of them show the signs of a collapsed core. We also explore some diversionary mathematics and recreational tables. </para>
+</abstract>
 </info>
 <section>
 <title>Introduction</title>
diff --git a/src/output_docbook.cpp b/src/output_docbook.cpp
index 5e15edc..2199239 100644
--- a/src/output_docbook.cpp
+++ b/src/output_docbook.cpp
@@ -764,15 +764,34 @@ DocBookDocumentSectioning hasDocumentSectioning(ParagraphList const &paragraphs,
 }
 
 
-DocBookInfoTag getParagraphsWithInfo(ParagraphList const &paragraphs, pit_type const bpit, pit_type const epit) {
+bool hasOnlyNotes(Paragraph const & par)
+{
+	for (int i = 0; i < par.size(); ++i)
+		if (!par.isInset(i) || !dynamic_cast<InsetNote *>(par.insetList().get(i)))
+			return false;
+	return true;
+}
+
+
+DocBookInfoTag getParagraphsWithInfo(ParagraphList const &paragraphs, pit_type bpit, pit_type const epit) {
 	set<pit_type> shouldBeInInfo;
 	set<pit_type> mustBeInInfo;
 
+	// Find the first non empty paragraph by mutating bpit.
+	while (bpit < epit) {
+		Paragraph const &par = paragraphs[bpit];
+		if (par.empty() || hasOnlyNotes(par))
+			bpit += 1;
+		else
+			break;
+	}
+
+	// Find the last info-like paragraph.
 	pit_type cpit = bpit;
 	while (cpit < epit) {
 		// Skip paragraphs only containing one note.
 		Paragraph const &par = paragraphs[cpit];
-		if (par.size() == 1 && dynamic_cast<InsetNote*>(paragraphs[cpit].insetList().get(0))) {
+		if (hasOnlyNotes(par)) {
 			cpit += 1;
 			continue;
 		}

commit ad9ef78ab713d48bac18ba83cdeba44d077ba35c
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Sun Aug 16 17:30:53 2020 +0200

    Add testcase

diff --git a/autotests/export/latex/languages/mixed_ltr-art_arabi-standard-font.lyx b/autotests/export/latex/languages/mixed_ltr-art_arabi-standard-font.lyx
new file mode 100644
index 0000000..b48493e
--- /dev/null
+++ b/autotests/export/latex/languages/mixed_ltr-art_arabi-standard-font.lyx
@@ -0,0 +1,189 @@
+#LyX 2.1 created this file. For more info see http://www.lyx.org/
+\lyxformat 474
+\begin_document
+\begin_header
+\textclass article
+\use_default_options false
+\maintain_unincluded_children false
+\language english
+\language_package default
+\inputencoding auto
+\fontencoding default
+\font_roman default
+\font_sans default
+\font_typewriter default
+\font_math auto
+\font_default_family default
+\use_non_tex_fonts false
+\font_sc false
+\font_osf false
+\font_sf_scale 100
+\font_tt_scale 100
+\graphics default
+\default_output_format default
+\output_sync 0
+\bibtex_command default
+\index_command default
+\paperfontsize default
+\spacing single
+\use_hyperref false
+\papersize default
+\use_geometry false
+\use_package amsmath 1
+\use_package amssymb 0
+\use_package cancel 0
+\use_package esint 1
+\use_package mathdots 0
+\use_package mathtools 0
+\use_package mhchem 0
+\use_package stackrel 0
+\use_package stmaryrd 0
+\use_package undertilde 0
+\cite_engine basic
+\cite_engine_type default
+\biblio_style plain
+\use_bibtopic false
+\use_indices false
+\paperorientation portrait
+\suppress_date false
+\justification true
+\use_refstyle 0
+\index Index
+\shortcut idx
+\color #008000
+\end_index
+\secnumdepth 3
+\tocdepth 3
+\paragraph_separation indent
+\paragraph_indentation default
+\quotes_language english
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\tracking_changes false
+\output_changes false
+\html_math_output 0
+\html_css_as_file 0
+\html_be_strict false
+\end_header
+
+\begin_body
+
+\begin_layout Title
+Mixed text Latin and Arabic characters
+\end_layout
+
+\begin_layout Section
+Main Text Latin Characters
+\end_layout
+
+\begin_layout Standard
+This is a paragraph in English.
+\begin_inset Foot
+status collapsed
+
+\begin_layout Plain Layout
+A footnote in Latin characters.
+\end_layout
+
+\end_inset
+
+ This is a paragraph in English.
+ This is a paragraph in English.
+ This is a paragraph in English.
+ This is a paragraph in English.
+ 
+\lang arabic_arabi
+بعض الكلمات بالحروف العربية
+\lang english
+ This is a paragraph in English.
+ This is a paragraph in English.
+ This is a paragraph in English.
+ This is a paragraph in English.
+ This is a paragraph in English.
+\begin_inset Foot
+status collapsed
+
+\begin_layout Plain Layout
+
+\lang arabic_arabi
+حاشية عربية.
+\end_layout
+
+\end_inset
+
+ This is a paragraph in English.
+ This is a paragraph in English.
+\end_layout
+
+\begin_layout Section
+Main Text Arabic Characters
+\end_layout
+
+\begin_layout Standard
+
+\lang arabic_arabi
+بعض الكلمات
+\lang english
+
+\begin_inset Foot
+status open
+
+\begin_layout Plain Layout
+Footnote in English.
+\end_layout
+
+\end_inset
+
+
+\lang arabic_arabi
+ بالحروف العربية.
+\lang english
+
+\begin_inset Foot
+status open
+
+\begin_layout Plain Layout
+
+\lang arabic_arabi
+حاشية عربية.
+\end_layout
+
+\end_inset
+
+
+\lang arabic_arabi
+ 
+\lang english
+Some text in Latin characters.
+
+\family roman
+\series medium
+\shape up
+\size normal
+\emph off
+\bar no
+\strikeout off
+\uuline off
+\uwave off
+\noun off
+\color none
+\lang arabic_arabi
+ 
+\family default
+\series default
+\shape default
+\size default
+\emph default
+\bar default
+\strikeout default
+\uuline default
+\uwave default
+\noun default
+\color inherit
+بعض الكلمات بالعربية.
+\end_layout
+
+\end_body
+\end_document
+

commit 957b615b1fd02ca8b5d7a44c26789c1bb90afd72
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Sun Aug 16 17:23:16 2020 +0200

    Fix another crash with Grid pasting (follow-up to #11906)

diff --git a/src/mathed/InsetMathGrid.cpp b/src/mathed/InsetMathGrid.cpp
index 0a637ec..26dd55f 100644
--- a/src/mathed/InsetMathGrid.cpp
+++ b/src/mathed/InsetMathGrid.cpp
@@ -1634,8 +1634,10 @@ void InsetMathGrid::doDispatch(Cursor & cur, FuncRequest & cmd)
 			for (row_type r = 0; r < numrows; ++r) {
 				for (col_type c = 0; c < numcols; ++c) {
 					idx_type i = index(r + startrow, c + startcol);
-					cell(i).insert(c == 0 ? cur.pos() : 0,
-					               grid.cell(grid.index(r, c)));
+					pos_type ipos = uint(cur.pos()) > cell(i).size()
+							? cell(i).size()
+							: cur.pos();
+					cell(i).insert(ipos, grid.cell(grid.index(r, c)));
 				}
 				if (hline_enabled)
 					rowinfo_[r].lines += grid.rowinfo_[r].lines;

commit 2dae4ab4f35458f3caa4f85f8c0e64e5fe9065d1
Author: Stephan Witt <switt at lyx.org>
Date:   Sun Aug 16 17:07:04 2020 +0200

    Improved character count statistics for letter based insets (e.g. the LyX logo).

diff --git a/src/Buffer.cpp b/src/Buffer.cpp
index dff7fae..97a6cfb 100644
--- a/src/Buffer.cpp
+++ b/src/Buffer.cpp
@@ -5362,8 +5362,11 @@ void Buffer::Impl::updateStatistics(DocIterator & from, DocIterator & to, bool s
 					++word_count_;
 					inword = true;
 				}
-				if (ins && ins->isLetter())
-					++char_count_;
+				if (ins && ins->isLetter()) {
+					odocstringstream os;
+					ins->toString(os);
+					char_count_ += os.str().length();
+				}
 				else if (ins && ins->isSpace())
 					++blank_count_;
 				else {

commit 7ec0bdbf2819d9ec3a81b7f7cdb773986b6dff58
Author: Stephan Witt <switt at lyx.org>
Date:   Sun Aug 16 17:05:44 2020 +0200

    #6401 For correct document traversal special logo chars should be treated like letters

diff --git a/src/insets/InsetSpecialChar.cpp b/src/insets/InsetSpecialChar.cpp
index 33d3d0b..56925c4 100644
--- a/src/insets/InsetSpecialChar.cpp
+++ b/src/insets/InsetSpecialChar.cpp
@@ -672,7 +672,9 @@ bool InsetSpecialChar::isChar() const
 bool InsetSpecialChar::isLetter() const
 {
 	return kind_ == HYPHENATION || kind_ == LIGATURE_BREAK
-		|| kind_ == NOBREAKDASH;
+		|| kind_ == NOBREAKDASH
+		|| kind_ == PHRASE_LYX || kind_ == PHRASE_LATEX
+		|| kind_ == PHRASE_TEX || kind_ == PHRASE_LATEX2E;
 }
 
 

commit ba21c946a1583d0b1f68f34f2ea378887ed502f9
Author: Stephan Witt <switt at lyx.org>
Date:   Sun Aug 16 16:54:03 2020 +0200

    #6401 improve doc iterator to allow easy backward navigation

diff --git a/src/DocIterator.cpp b/src/DocIterator.cpp
index 0f4bc10..6eba5a7 100644
--- a/src/DocIterator.cpp
+++ b/src/DocIterator.cpp
@@ -500,6 +500,18 @@ void DocIterator::backwardPos()
 }
 
 
+void DocIterator::backwardPosIgnoreCollapsed()
+{
+	backwardPos();
+	if (inTexted()) {
+		Inset const * ins = realInset();
+		if (ins && !ins->editable()) {
+			pop_back(); // move out of collapsed inset
+		}
+	}
+}
+
+
 #if 0
 // works, but currently not needed
 void DocIterator::backwardInset()
diff --git a/src/DocIterator.h b/src/DocIterator.h
index 8ee4d4e..69930fc 100644
--- a/src/DocIterator.h
+++ b/src/DocIterator.h
@@ -69,6 +69,8 @@ public:
 
 	/// does this iterator have any content?
 	bool empty() const { return slices_.empty(); }
+	/// is this the begin position?
+	bool atBegin() const { return depth() == 1 && pit() == 0 && pos() == 0; }
 	/// is this the end position?
 	bool atEnd() const { return slices_.empty(); }
 
@@ -210,6 +212,8 @@ public:
 	void forwardInset();
 	/// move backward one logical position
 	void backwardPos();
+	/// move backward one logical position, skip collapsed insets
+	void backwardPosIgnoreCollapsed();
 	/// move backward one physical character or inset
 	void backwardChar();
 	/// move backward one paragraph

commit d9f1f7e348d3175bb9bd72d42a113bf1e644031e
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Sun Aug 16 11:31:56 2020 +0200

    Remove now redundant string

diff --git a/src/frontends/qt/GuiAbout.cpp b/src/frontends/qt/GuiAbout.cpp
index d479029..9ddc6bd 100644
--- a/src/frontends/qt/GuiAbout.cpp
+++ b/src/frontends/qt/GuiAbout.cpp
@@ -254,7 +254,7 @@ static QString version()
 			loc_release_date = toqstr(lyx_release_date);
 	}
 	docstring version_date =
-		bformat(_("LyX Version %1$s\n(%2$s)"),
+		bformat(_("Version %1$s\n(%2$s)"),
 			from_ascii(lyx_version),
 			qstring_to_ucs4(loc_release_date))+"\n";
 	if (std::string(lyx_git_commit_hash) != "none")

commit a7ad074776451ebc631e7eb1116c7391afc39b76
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Sun Aug 16 11:22:53 2020 +0200

    he/Tutorial: fix conditional so that this also works with LuaTeX
    
    (requires forthcoming polyglossia 1.50 to work properly)

diff --git a/lib/doc/he/Tutorial.lyx b/lib/doc/he/Tutorial.lyx
index c1dc32e..14c3a75 100644
--- a/lib/doc/he/Tutorial.lyx
+++ b/lib/doc/he/Tutorial.lyx
@@ -15,11 +15,10 @@
 % the documentation team
 % email: lyx-docs at lists.lyx.org
 
-\usepackage{ifpdf} % part of the hyperref bundle
-\ifpdf % if pdflatex is used
-
-% XeTeX with Hebrew does not like this bookmark code
-% so it is in the conditional.
+\usepackage{iftex}
+\ifpdftex % if pdflatex is used
+% XeTeX and LuaTeX with Hebrew do not like this
+% bookmark code, so it is in the conditional.
 % The pages of the TOC is numbered roman
 % and a pdf-bookmark for the TOC is added
 \let\myTOC\tableofcontents

commit 812ff7de7550f7c5370584294e61d59d8bbb8700
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Sun Aug 16 11:18:49 2020 +0200

    Take out inheritFont() condition

diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index 6c90297..dcba46a 100644
--- a/src/Paragraph.cpp
+++ b/src/Paragraph.cpp
@@ -1033,7 +1033,7 @@ void Paragraph::Private::latexInset(BufferParams const & bparams,
 		close = true;
 	}
 
-	if (open_font && (!inset->inheritFont() || fontswitch_inset)) {
+	if (open_font && fontswitch_inset) {
 		bool lang_closed = false;
 		// Close language if needed
 		if (closeLanguage) {

commit 92f6e4806e97baf4691304c292272fff965eebe0
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Sun Aug 16 10:47:46 2020 +0200

    Fix language closing before inset

diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index 92fb804..6c90297 100644
--- a/src/Paragraph.cpp
+++ b/src/Paragraph.cpp
@@ -1078,6 +1078,7 @@ void Paragraph::Private::latexInset(BufferParams const & bparams,
 						      rp, running_font,
 						      basefont, true,
 						      cprotect);
+		open_font = true;
 		column += count2;
 		if (count2 == 0 && (lang_closed || lang_switched_at_inset))
 			// All fonts closed
@@ -2572,7 +2573,7 @@ void Paragraph::latex(BufferParams const & bparams,
 		++column;
 
 		// Fully instantiated font
-		Font const current_font = getFont(bparams, i, outerfont);
+		Font current_font = getFont(bparams, i, outerfont);
 		// Previous font
 		Font const prev_font = (i > 0) ?
 					getFont(bparams, i - 1, outerfont)
@@ -2612,8 +2613,7 @@ void Paragraph::latex(BufferParams const & bparams,
 		    ((current_font != running_font
 		      || current_font.language() != running_font.language())
 		     || (fontswitch_inset
-			 && (current_font == prev_font
-			     || current_font.language() == prev_font.language()))))
+			 && (current_font == prev_font))))
 		{
 			// ensure there is no open script-wrapper
 			if (!alien_script.empty()) {
@@ -2628,6 +2628,9 @@ void Paragraph::latex(BufferParams const & bparams,
 				os << '}';
 				column += 1;
 			}
+			if (closeLanguage)
+				// Force language closing
+				current_font.setLanguage(basefont.language());
 			column += running_font.latexWriteEndChanges(
 				    os, bparams, runparams, basefont,
 				    (i == body_pos-1) ? basefont : current_font,
@@ -2683,7 +2686,8 @@ void Paragraph::latex(BufferParams const & bparams,
 		}
 
 		// Do we need to change font?
-		if ((current_font != running_font ||
+		if (!fontswitch_inset &&
+		    (current_font != running_font ||
 		     current_font.language() != running_font.language())
 		    && i != body_pos - 1)
 		{
@@ -2699,16 +2703,14 @@ void Paragraph::latex(BufferParams const & bparams,
 				column += 1;
 			}
 			otexstringstream ots;
-			if (!fontswitch_inset) {
-				InsetText const * textinset = inInset().asInsetText();
-				bool const cprotect = textinset
-					? textinset->hasCProtectContent(runparams.moving_arg)
-					  && !textinset->text().isMainText()
-					: false;
-				column += current_font.latexWriteStartChanges(ots, bparams,
-									      runparams, basefont, last_font, false,
-									      cprotect);
-			}
+			InsetText const * textinset = inInset().asInsetText();
+			bool const cprotect = textinset
+				? textinset->hasCProtectContent(runparams.moving_arg)
+				  && !textinset->text().isMainText()
+				: false;
+			column += current_font.latexWriteStartChanges(ots, bparams,
+								      runparams, basefont, last_font, false,
+								      cprotect);
 			// Check again for display math in ulem commands as a
 			// font change may also occur just before a math inset.
 			if (runparams.inDisplayMath && !deleted_display_math

commit 24af4ffcb3cb123b5fa2b753f5efa9faefb3b1ed
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Sun Aug 16 10:47:08 2020 +0200

    Redo "Move some tests upstream, since we'll need it there" properly

diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index 8dbe0be..92fb804 100644
--- a/src/Paragraph.cpp
+++ b/src/Paragraph.cpp
@@ -343,7 +343,9 @@ public:
 				   Layout const & style,
 				   pos_type & i,
 				   unsigned int & column,
-				   bool const fontswitch_inset);
+				   bool const fontswitch_inset,
+				   bool const closeLanguage,
+				   bool const lang_switched_at_inset);
 
 	///
 	void latexSpecialChar(
@@ -959,7 +961,9 @@ void Paragraph::Private::latexInset(BufferParams const & bparams,
 				    Layout const & style,
 				    pos_type & i,
 				    unsigned int & column,
-				    bool const fontswitch_inset)
+				    bool const fontswitch_inset,
+				    bool const closeLanguage,
+				    bool const lang_switched_at_inset)
 {
 	Inset * inset = owner_->getInset(i);
 	LBUFERR(inset);
@@ -1030,21 +1034,7 @@ void Paragraph::Private::latexInset(BufferParams const & bparams,
 	}
 
 	if (open_font && (!inset->inheritFont() || fontswitch_inset)) {
-		// Some insets cannot be inside a font change command.
-		// However, even such insets *can* be placed in \L or \R
-		// or their equivalents (for RTL language switches),
-		// so we don't close the language in those cases
-		// (= differing isRightToLeft()).
-		// ArabTeX, though, doesn't seem to handle this special behavior.
-		bool const inRLSwitch = 
-				basefont.isRightToLeft() != running_font.isRightToLeft()
-				&& basefont.language()->lang() != "arabic_arabtex"
-				&& running_font.language()->lang() != "arabic_arabtex";
-		// Having said that, PassThru insets must be inside a font change command,
-		// as we do not re-open the font inside. So:
-		bool const closeLanguage = !inset->isPassThru() && !inRLSwitch;
 		bool lang_closed = false;
-		bool lang_switched_at_inset = false;
 		// Close language if needed
 		if (closeLanguage) {
 			// We need prev_font here as language changes directly at inset
@@ -1060,7 +1050,6 @@ void Paragraph::Private::latexInset(BufferParams const & bparams,
 									  needPar, closeLanguage);
 			column += count;
 			lang_closed = count > 0;
-			lang_switched_at_inset = prev_font.language() != running_font.language();
 		}
 		// Update the running_font, making sure, however,
 		// to leave the language as it was.
@@ -2601,6 +2590,23 @@ void Paragraph::latex(BufferParams const & bparams,
 				&& getInset(i)->allowMultiPar()
 				&& getInset(i)->lyxCode() != ERT_CODE;
 
+		bool closeLanguage = false;
+		bool lang_switched_at_inset = false;
+		if (fontswitch_inset) {
+			// Some insets cannot be inside a font change command.
+			// However, even such insets *can* be placed in \L or \R
+			// or their equivalents (for RTL language switches),
+			// so we don't close the language in those cases
+			// (= differing isRightToLeft()).
+			// ArabTeX, though, doesn't seem to handle this special behavior.
+			closeLanguage = basefont.isRightToLeft() == current_font.isRightToLeft()
+					|| basefont.language()->lang() == "arabic_arabtex"
+					|| current_font.language()->lang() == "arabic_arabtex";
+			// We need to check prev_font as language changes directly at inset
+			// will only be started inside the inset.
+			lang_switched_at_inset = prev_font.language() != current_font.language();
+		}
+
 		// Do we need to close the previous font?
 		if (open_font &&
 		    ((current_font != running_font
@@ -2798,7 +2804,8 @@ void Paragraph::latex(BufferParams const & bparams,
 				Font const save_basefont = basefont;
 				d->latexInset(bparams, os, rp, running_font,
 						basefont, real_outerfont, open_font,
-						runningChange, style, i, column, fontswitch_inset);
+						runningChange, style, i, column, fontswitch_inset,
+						closeLanguage, lang_switched_at_inset);
 				if (fontswitch_inset) {
 					if (open_font) {
 						bool needPar = false;

commit d31e8294620d66f6ebdd48bd6f1f8da9380e59d7
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Sat Aug 15 19:21:01 2020 +0200

    typo

diff --git a/lib/doc/de/UserGuide.lyx b/lib/doc/de/UserGuide.lyx
index b9372d6..e751384 100644
--- a/lib/doc/de/UserGuide.lyx
+++ b/lib/doc/de/UserGuide.lyx
@@ -29123,7 +29123,7 @@ Literaturverweis
 \family sans
 Alle Autornamen
 \family default
- verwendet wurde, schalter 
+ verwendet wurde, schaltet 
 \begin_inset Quotes gld
 \end_inset
 

commit 6876a306b94bfb41b4947e77498fbe58952f88ce
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Sat Aug 15 19:20:30 2020 +0200

    Consider encoding when re-setting language

diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index 7b46d1e..8dbe0be 100644
--- a/src/Paragraph.cpp
+++ b/src/Paragraph.cpp
@@ -1071,6 +1071,8 @@ void Paragraph::Private::latexInset(BufferParams const & bparams,
 		running_font = basefont;
 		if (!closeLanguage)
 			running_font.setLanguage(copy_font.language());
+		OutputParams rp = runparams;
+		rp.encoding = basefont.language()->encoding();
 		// For these, we use switches, so they should be taken as
 		// base inside the inset.
 		basefont.fontInfo().setSize(copy_font.fontInfo().size());
@@ -1084,7 +1086,7 @@ void Paragraph::Private::latexInset(BufferParams const & bparams,
 			  && !textinset->text().isMainText()
 			: false;
 		unsigned int count2 = basefont.latexWriteStartChanges(os, bparams,
-						      runparams, running_font,
+						      rp, running_font,
 						      basefont, true,
 						      cprotect);
 		column += count2;

commit a8094051c1ae9c546c76bb0d3300d83e6cdbadef
Author: José Matos <jamatos at lyx.org>
Date:   Sat Aug 15 17:49:23 2020 +0100

    Consider file encoding for modules in reconfigure
    
    If the modules are not in utf8 then we warn and skip that file
    like it happens for layout files.
    
    It would be nice in both cases to have a warn in the gui and not only in the config.log

diff --git a/lib/configure.py b/lib/configure.py
index b638f93..2b4d61f 100644
--- a/lib/configure.py
+++ b/lib/configure.py
@@ -1562,9 +1562,17 @@ def checkModulesConfig():
           continue
 
       seen.append(filename)
-      retval = processModuleFile(file, filename)
-      if retval:
-          tx.write(retval)
+      try:
+          retval = processModuleFile(file, filename)
+          if retval:
+              tx.write(retval)
+      except UnicodeDecodeError:
+          logger.warning("**************************************************\n"
+                         "Module file '%s'\n"
+                         "cannot be decoded in utf-8.\n"
+                         "Please check if the file has the correct encoding.\n"
+                         "Skipping this file!\n"
+                         "**************************************************" % filename)
   tx.close()
   logger.info('\tdone')
 

commit 5a212823d7bf103b59be0c79f72448a718186494
Author: José Matos <jamatos at lyx.org>
Date:   Sat Aug 15 16:36:34 2020 +0100

    Trim endline whitespace

diff --git a/lib/configure.py b/lib/configure.py
index cea9bdc..b638f93 100644
--- a/lib/configure.py
+++ b/lib/configure.py
@@ -217,7 +217,7 @@ def checkTeXPaths():
             if sys.version_info[0] < 3:
                 inpname = shortPath(unicode(tmpfname, encoding)).replace('\\', '/')
             else:
-                inpname = shortPath(tmpfname).replace('\\', '/') 
+                inpname = shortPath(tmpfname).replace('\\', '/')
         else:
             inpname = cmdOutput('cygpath -m ' + tmpfname)
         logname = os.path.basename(re.sub("(?i).ltx", ".log", inpname))
@@ -1157,7 +1157,7 @@ def checkConverterEntries():
 \converter svgz       png        "%%"    ""'''],
             path = ['', inkscape_path])
     #
-    checkProg('Gnuplot', ['gnuplot'], 
+    checkProg('Gnuplot', ['gnuplot'],
         rc_entry = [ r'''\Format gnuplot     "gp, gnuplot"    "Gnuplot"     "" "" ""  "vector"	"text/plain"
 \converter gnuplot      pdf6      "python -tt $$s/scripts/gnuplot2pdf.py $$i $$o"    "needauth"''' ])
     #

commit 3c5c41ddc2d4a4f30d5ad27ea3dcd679b7a4db24
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Sat Aug 15 16:46:18 2020 +0200

    Only exclude ERT from language switch doing

diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index 6696188..7b46d1e 100644
--- a/src/Paragraph.cpp
+++ b/src/Paragraph.cpp
@@ -2597,7 +2597,7 @@ void Paragraph::latex(BufferParams const & bparams,
 				c == META_INSET
 				&& getInset(i)
 				&& getInset(i)->allowMultiPar()
-				&& !getInset(i)->isPassThru();
+				&& getInset(i)->lyxCode() != ERT_CODE;
 
 		// Do we need to close the previous font?
 		if (open_font &&

commit 5490e7545b1207e207f05d7c692f02cf4cd1ffe8
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Sat Aug 15 16:07:12 2020 +0200

    Polish About dialog
    
    (this might need adaptation with HiDPI)

diff --git a/src/frontends/qt/GuiAbout.cpp b/src/frontends/qt/GuiAbout.cpp
index 8e720df..d479029 100644
--- a/src/frontends/qt/GuiAbout.cpp
+++ b/src/frontends/qt/GuiAbout.cpp
@@ -258,14 +258,16 @@ static QString version()
 			from_ascii(lyx_version),
 			qstring_to_ucs4(loc_release_date))+"\n";
 	if (std::string(lyx_git_commit_hash) != "none")
-		version_date += _("Built from git commit hash ")
+		version_date += from_ascii("</p><p>") + _("Built from git commit hash ")
 			+ from_utf8(lyx_git_commit_hash).substr(0,8);
 
 	QString res;
 	QTextStream out(&res);
-	out << toqstr(version_date) << "\n";
-	out << toqstr(bformat(_("Qt Version (run-time): %1$s"), from_ascii(qVersion()))) << "\n";
+	out << toqstr("<html><head/><body><p><span style=\" font-weight:600;\">");
+	out << toqstr(version_date) << "</span></p><p>";
+	out << toqstr(bformat(_("Qt Version (run-time): %1$s"), from_ascii(qVersion()))) << "</p><p>";
 	out << toqstr(bformat(_("Qt Version (compile-time): %1$s"), from_ascii(QT_VERSION_STR)));
+	out << toqstr("</p></body></html>");
 	return res;
 }
 
@@ -299,9 +301,6 @@ GuiAbout::GuiAbout(GuiView & lv)
 {
 	d->ui.setupUi(this);
 
-	// fix height to minimum
-	setFixedHeight(sizeHint().height());
-
 	d->ui.copyrightTB->setPlainText(copyright());
 	d->ui.copyrightTB->append(QString());
 	d->ui.copyrightTB->append(license());
@@ -309,6 +308,11 @@ GuiAbout::GuiAbout(GuiView & lv)
 	d->ui.copyrightTB->append(disclaimer());
 
 	d->ui.versionLA->setText(version());
+	QPixmap icon = getPixmap("images/", "lyx", "svg,png");
+	int const iconsize = d->ui.versionLA->height() * 1.5;
+	d->ui.iconLA->setPixmap(icon.scaled(iconsize, iconsize,
+					    Qt::IgnoreAspectRatio,
+					    Qt::SmoothTransformation));
 	d->ui.dirLibraryLA->setText(dirLibrary());
 	d->ui.dirUserLA->setText(dirUser());
 	d->ui.buildinfoTB->setText(buildinfo());
@@ -317,6 +321,9 @@ GuiAbout::GuiAbout(GuiView & lv)
 	d->ui.creditsTB->setHtml(credits());
 
 	d->ui.tab->setUsesScrollButtons(false);
+
+	// fix height to minimum
+	setFixedHeight(sizeHint().height());
 }
 
 
diff --git a/src/frontends/qt/ui/AboutUi.ui b/src/frontends/qt/ui/AboutUi.ui
index 4db3359..9ae795d 100644
--- a/src/frontends/qt/ui/AboutUi.ui
+++ b/src/frontends/qt/ui/AboutUi.ui
@@ -7,7 +7,7 @@
     <x>0</x>
     <y>0</y>
     <width>424</width>
-    <height>376</height>
+    <height>409</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -16,22 +16,7 @@
   <property name="sizeGripEnabled">
    <bool>true</bool>
   </property>
-  <layout class="QGridLayout">
-   <property name="leftMargin">
-    <number>9</number>
-   </property>
-   <property name="topMargin">
-    <number>9</number>
-   </property>
-   <property name="rightMargin">
-    <number>9</number>
-   </property>
-   <property name="bottomMargin">
-    <number>9</number>
-   </property>
-   <property name="spacing">
-    <number>6</number>
-   </property>
+  <layout class="QGridLayout" name="gridLayout_2">
    <item row="0" column="0">
     <widget class="QTabWidget" name="tab">
      <property name="currentIndex">
@@ -41,42 +26,72 @@
       <attribute name="title">
        <string>Version</string>
       </attribute>
-      <layout class="QVBoxLayout">
-       <property name="spacing">
-        <number>6</number>
-       </property>
-       <property name="leftMargin">
-        <number>9</number>
-       </property>
-       <property name="topMargin">
-        <number>9</number>
-       </property>
-       <property name="rightMargin">
-        <number>9</number>
-       </property>
-       <property name="bottomMargin">
-        <number>9</number>
-       </property>
-       <item>
-        <widget class="QLabel" name="versionLA">
-         <property name="cursor">
-          <cursorShape>IBeamCursor</cursorShape>
-         </property>
-         <property name="text">
-          <string notr="true"><html><head/><body><p>LyX version info goes here.</p><p>Qt version (run-time) goes here.</p><p>Qt version (compile-time) goes here.</p></body></html></string>
-         </property>
-         <property name="alignment">
-          <set>Qt::AlignCenter</set>
-         </property>
-         <property name="wordWrap">
-          <bool>true</bool>
-         </property>
-         <property name="textInteractionFlags">
-          <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
-         </property>
-        </widget>
+      <layout class="QGridLayout" name="gridLayout">
+       <item row="0" column="0">
+        <layout class="QHBoxLayout" name="horizontalLayout">
+         <item>
+          <widget class="QLabel" name="iconLA">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="minimumSize">
+            <size>
+             <width>80</width>
+             <height>80</height>
+            </size>
+           </property>
+           <property name="text">
+            <string notr="true">LyX Icon</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <spacer name="horizontalSpacer_2">
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeType">
+            <enum>QSizePolicy::Fixed</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>20</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+         <item>
+          <widget class="QLabel" name="versionLA">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="cursor">
+            <cursorShape>IBeamCursor</cursorShape>
+           </property>
+           <property name="text">
+            <string notr="true"><html><head/><body><p><span style=" font-weight:600;">LyX version info goes here.</span></p><p>Qt version (run-time) goes here.</p><p>Qt version (compile-time) goes here.</p></body></html></string>
+           </property>
+           <property name="alignment">
+            <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
+           </property>
+           <property name="wordWrap">
+            <bool>true</bool>
+           </property>
+           <property name="textInteractionFlags">
+            <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
+           </property>
+          </widget>
+         </item>
+        </layout>
        </item>
-       <item>
+       <item row="1" column="0">
         <spacer name="verticalSpacer">
          <property name="orientation">
           <enum>Qt::Vertical</enum>
@@ -89,7 +104,7 @@
          </property>
         </spacer>
        </item>
-       <item>
+       <item row="2" column="0">
         <widget class="QGroupBox" name="gridGroupBox">
          <property name="title">
           <string>Library directory</string>
@@ -136,7 +151,7 @@
          </layout>
         </widget>
        </item>
-       <item>
+       <item row="3" column="0">
         <widget class="QGroupBox" name="gridGroupBox1">
          <property name="title">
           <string>User directory</string>

commit cba24bb642606bbb8c890b21e799d9f225ad9a3d
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Sat Aug 15 16:06:56 2020 +0200

    Fix deprecation warning

diff --git a/src/frontends/qt/GuiAbout.cpp b/src/frontends/qt/GuiAbout.cpp
index 3c874df..8e720df 100644
--- a/src/frontends/qt/GuiAbout.cpp
+++ b/src/frontends/qt/GuiAbout.cpp
@@ -203,12 +203,27 @@ static QString buildinfo()
 	QString res;
 	QTextStream out(&res);
 	out << "LyX " << lyx_version
-		<< " (" << lyx_release_date << ")" << endl;
+		<< " (" << lyx_release_date << ")"
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
+		<< Qt::endl;
+#else
+		<< endl;
+#endif
 	if (std::string(lyx_git_commit_hash) != "none")
 		out << qt_("  Git commit hash ")
-		    << QString(lyx_git_commit_hash).left(8) << endl;
-
-	out << lyx_version_info << endl;
+		    << QString(lyx_git_commit_hash).left(8)
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
+		    << Qt::endl;
+#else
+		    << endl;
+#endif
+
+	out << lyx_version_info 
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
+	    << Qt::endl;
+#else
+	    << endl;
+#endif
 	return res;
 }
 

commit 0d5020661036c379d044e08c3625fce35c1ccce4
Author: Kornel Benko <kornel at lyx.org>
Date:   Sat Aug 15 15:57:02 2020 +0200

    Cmake tests: Correct an entry (file name has changed)

diff --git a/development/autotests/ignoredTests b/development/autotests/ignoredTests
index 5d74ca2..6a47f3f 100644
--- a/development/autotests/ignoredTests
+++ b/development/autotests/ignoredTests
@@ -186,7 +186,7 @@ export/export/latex/languages/supported-languages_polyglossia_.*(dvi|pdf.?|texF)
 export/export/latex/languages/supported-languages_XeTeX_.*(dvi|pdf.?|texF)
 export/export/latex/lyxbugs-resolved/9633-.*(dvi|pdf.?|texF)
 export/export/latex/lyxbugs/11522-systemfonts-Math-missingchars_pdf5_texF
-export/templates/Articles/American_Psychological_Association_%28APA_v\.7%29_(dvi3|pdf5)_texF
+export/templates/Articles/American_Psychological_Association_%28APA%29,_v\._7_(dvi3|pdf5)_texF
 export/export/latex/languages/latinErt_(dvi3|pdf5)_texF
 
 # lyx2lyx

commit 1c3ccc0ac22802bf5fccf35b4289fd90f317012a
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Sat Aug 15 15:32:15 2020 +0200

    Revert "Move some tests upstream, since we'll need it there"
    
    This reverts commit 0a44c1687e11d7943517ae36ee413c4a7568714d.

diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index e81eb2f..6696188 100644
--- a/src/Paragraph.cpp
+++ b/src/Paragraph.cpp
@@ -343,9 +343,7 @@ public:
 				   Layout const & style,
 				   pos_type & i,
 				   unsigned int & column,
-				   bool const fontswitch_inset,
-				   bool const closeLanguage,
-				   bool const lang_switched_at_inset);
+				   bool const fontswitch_inset);
 
 	///
 	void latexSpecialChar(
@@ -961,9 +959,7 @@ void Paragraph::Private::latexInset(BufferParams const & bparams,
 				    Layout const & style,
 				    pos_type & i,
 				    unsigned int & column,
-				    bool const fontswitch_inset,
-				    bool const closeLanguage,
-				    bool const lang_switched_at_inset)
+				    bool const fontswitch_inset)
 {
 	Inset * inset = owner_->getInset(i);
 	LBUFERR(inset);
@@ -1034,7 +1030,21 @@ void Paragraph::Private::latexInset(BufferParams const & bparams,
 	}
 
 	if (open_font && (!inset->inheritFont() || fontswitch_inset)) {
+		// Some insets cannot be inside a font change command.
+		// However, even such insets *can* be placed in \L or \R
+		// or their equivalents (for RTL language switches),
+		// so we don't close the language in those cases
+		// (= differing isRightToLeft()).
+		// ArabTeX, though, doesn't seem to handle this special behavior.
+		bool const inRLSwitch = 
+				basefont.isRightToLeft() != running_font.isRightToLeft()
+				&& basefont.language()->lang() != "arabic_arabtex"
+				&& running_font.language()->lang() != "arabic_arabtex";
+		// Having said that, PassThru insets must be inside a font change command,
+		// as we do not re-open the font inside. So:
+		bool const closeLanguage = !inset->isPassThru() && !inRLSwitch;
 		bool lang_closed = false;
+		bool lang_switched_at_inset = false;
 		// Close language if needed
 		if (closeLanguage) {
 			// We need prev_font here as language changes directly at inset
@@ -1050,6 +1060,7 @@ void Paragraph::Private::latexInset(BufferParams const & bparams,
 									  needPar, closeLanguage);
 			column += count;
 			lang_closed = count > 0;
+			lang_switched_at_inset = prev_font.language() != running_font.language();
 		}
 		// Update the running_font, making sure, however,
 		// to leave the language as it was.
@@ -2783,27 +2794,9 @@ void Paragraph::latex(BufferParams const & bparams,
 				// We need to restore parts of this after insets with
 				// allowMultiPar() true
 				Font const save_basefont = basefont;
-				Font const save_runningfont = running_font;
-				bool closeLanguage = false;
-				bool lang_switched_at_inset = false;
-				if (fontswitch_inset) {
-					// Some insets cannot be inside a font change command.
-					// However, even such insets *can* be placed in \L or \R
-					// or their equivalents (for RTL language switches),
-					// so we don't close the language in those cases
-					// (= differing isRightToLeft()).
-					// ArabTeX, though, doesn't seem to handle this special behavior.
-					closeLanguage = basefont.isRightToLeft() != running_font.isRightToLeft()
-							&& basefont.language()->lang() != "arabic_arabtex"
-							&& running_font.language()->lang() != "arabic_arabtex";
-					// We need to check prev_font as language changes directly at inset
-					// will only be started inside the inset.
-					lang_switched_at_inset = prev_font.language() != running_font.language();
-				}
 				d->latexInset(bparams, os, rp, running_font,
 						basefont, real_outerfont, open_font,
-						runningChange, style, i, column,
-						fontswitch_inset, closeLanguage, lang_switched_at_inset);
+						runningChange, style, i, column, fontswitch_inset);
 				if (fontswitch_inset) {
 					if (open_font) {
 						bool needPar = false;

commit fb2077df118bbb0ff32f81d80150dd068efb2f3a
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Sat Aug 15 15:21:19 2020 +0200

    Revert "Fix a lang edgecase"
    
    This reverts commit dc4b11b0e92e364eedd91c081d9999f0959839a8.

diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index 54d266e..e81eb2f 100644
--- a/src/Paragraph.cpp
+++ b/src/Paragraph.cpp
@@ -1058,15 +1058,13 @@ void Paragraph::Private::latexInset(BufferParams const & bparams,
 		Font const copy_font(running_font);
 		basefont = owner_->getLayoutFont(bparams, outerfont);
 		running_font = basefont;
-		if (!closeLanguage && !lang_switched_at_inset)
+		if (!closeLanguage)
 			running_font.setLanguage(copy_font.language());
 		// For these, we use switches, so they should be taken as
 		// base inside the inset.
 		basefont.fontInfo().setSize(copy_font.fontInfo().size());
 		basefont.fontInfo().setFamily(copy_font.fontInfo().family());
 		basefont.fontInfo().setSeries(copy_font.fontInfo().series());
-		if (!closeLanguage && lang_switched_at_inset)
-			basefont.setLanguage(copy_font.language());
 		// Now re-do font changes in a way needed here
 		// (using switches with multi-par insets)
 		InsetText const * textinset = inset->asInsetText();
@@ -1076,7 +1074,7 @@ void Paragraph::Private::latexInset(BufferParams const & bparams,
 			: false;
 		unsigned int count2 = basefont.latexWriteStartChanges(os, bparams,
 						      runparams, running_font,
-						      running_font, true,
+						      basefont, true,
 						      cprotect);
 		column += count2;
 		if (count2 == 0 && (lang_closed || lang_switched_at_inset))
@@ -2817,10 +2815,6 @@ void Paragraph::latex(BufferParams const & bparams,
 					basefont.fontInfo().setSize(save_basefont.fontInfo().size());
 					basefont.fontInfo().setFamily(save_basefont.fontInfo().family());
 					basefont.fontInfo().setSeries(save_basefont.fontInfo().series());
-					if (!closeLanguage && lang_switched_at_inset) {
-						basefont.setLanguage(save_basefont.language());
-						running_font.setLanguage(save_runningfont.language());
-					}
 				}
 				if (incremented)
 					--parInline;

commit e33017a78dc01bf3d6bb45ac4550dd77df7829a6
Author: Kornel Benko <kornel at lyx.org>
Date:   Sat Aug 15 14:47:37 2020 +0200

    Cmake tests: Adapt to new testcase

diff --git a/development/autotests/ignoredTests b/development/autotests/ignoredTests
index a8465b0..5d74ca2 100644
--- a/development/autotests/ignoredTests
+++ b/development/autotests/ignoredTests
@@ -187,6 +187,7 @@ export/export/latex/languages/supported-languages_XeTeX_.*(dvi|pdf.?|texF)
 export/export/latex/lyxbugs-resolved/9633-.*(dvi|pdf.?|texF)
 export/export/latex/lyxbugs/11522-systemfonts-Math-missingchars_pdf5_texF
 export/templates/Articles/American_Psychological_Association_%28APA_v\.7%29_(dvi3|pdf5)_texF
+export/export/latex/languages/latinErt_(dvi3|pdf5)_texF
 
 # lyx2lyx
 # dedicated lyx2lyx tests

commit 6fd566fbec6494adf144cf43912666982982560e
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Sat Aug 15 13:18:19 2020 +0200

    Flag placeholder string nontranslatable
    
    This is just wasted efforts for the translators, as this string never
    appears in the GUI.

diff --git a/src/frontends/qt/ui/AboutUi.ui b/src/frontends/qt/ui/AboutUi.ui
index fd07468..4db3359 100644
--- a/src/frontends/qt/ui/AboutUi.ui
+++ b/src/frontends/qt/ui/AboutUi.ui
@@ -7,7 +7,7 @@
     <x>0</x>
     <y>0</y>
     <width>424</width>
-    <height>370</height>
+    <height>376</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -63,7 +63,7 @@
           <cursorShape>IBeamCursor</cursorShape>
          </property>
          <property name="text">
-          <string><html><head/><body><p>LyX version info goes here.</p><p>Qt version (run-time) goes here.</p><p>Qt version (compile-time) goes here.</p></body></html></string>
+          <string notr="true"><html><head/><body><p>LyX version info goes here.</p><p>Qt version (run-time) goes here.</p><p>Qt version (compile-time) goes here.</p></body></html></string>
          </property>
          <property name="alignment">
           <set>Qt::AlignCenter</set>
@@ -107,7 +107,7 @@
              <cursorShape>IBeamCursor</cursorShape>
             </property>
             <property name="text">
-             <string>Library directory goes here.</string>
+             <string notr="true">Library directory goes here.</string>
             </property>
             <property name="textFormat">
              <enum>Qt::PlainText</enum>
@@ -148,7 +148,7 @@
              <cursorShape>IBeamCursor</cursorShape>
             </property>
             <property name="text">
-             <string>User directory goes here.</string>
+             <string notr="true">User directory goes here.</string>
             </property>
             <property name="textFormat">
              <enum>Qt::PlainText</enum>

commit ed28996f4230415e2249a6c8f52fc30d47056543
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Sat Aug 15 13:15:12 2020 +0200

    de.po

diff --git a/po/de.po b/po/de.po
index 8dab422..20a144c 100644
--- a/po/de.po
+++ b/po/de.po
@@ -94,8 +94,8 @@ msgid ""
 msgstr ""
 "Project-Id-Version: LyX 2.4git\n"
 "Report-Msgid-Bugs-To: lyx-devel at lists.lyx.org\n"
-"POT-Creation-Date: 2020-08-10 10:00+0200\n"
-"PO-Revision-Date: 2020-08-10 10:02+0200\n"
+"POT-Creation-Date: 2020-08-15 13:11+0200\n"
+"PO-Revision-Date: 2020-08-15 13:14+0200\n"
 "Last-Translator: Jürgen Spitzmüller <spitz at lyx.org>\n"
 "Language-Team: Deutsch <lyx-docs at lists.lyx.org>\n"
 "Language: de\n"
@@ -109,27 +109,40 @@ msgstr ""
 msgid "Version"
 msgstr "Version"
 
-#: src/frontends/qt/ui/AboutUi.ui:69
-msgid "Version goes here"
-msgstr "Die Versionsnummer kommt hierher"
+#: src/frontends/qt/ui/AboutUi.ui:95
+msgid "Library directory"
+msgstr "Systemverzeichnis"
 
-#: src/frontends/qt/ui/AboutUi.ui:86
+#: src/frontends/qt/ui/AboutUi.ui:132 src/frontends/qt/ui/AboutUi.ui:173
+#: src/frontends/qt/GuiApplication.cpp:659
+msgid "Open"
+msgstr "Öffnen"
+
+#: src/frontends/qt/ui/AboutUi.ui:142
+msgid "User directory"
+msgstr "Benutzerverzeichnis"
+
+#: src/frontends/qt/ui/AboutUi.ui:187
 msgid "Credits"
 msgstr "Mitwirkende"
 
-#: src/frontends/qt/ui/AboutUi.ui:111 lib/layouts/apa.layout:205
+#: src/frontends/qt/ui/AboutUi.ui:212 lib/layouts/apa.layout:205
 #: lib/layouts/apax.inc:314
 msgid "Copyright"
 msgstr "Urheberrecht"
 
-#: src/frontends/qt/ui/AboutUi.ui:136
+#: src/frontends/qt/ui/AboutUi.ui:237
 msgid "Build Info"
 msgstr "Erstellung"
 
-#: src/frontends/qt/ui/AboutUi.ui:161
+#: src/frontends/qt/ui/AboutUi.ui:262
 msgid "Release Notes"
 msgstr "Versionshinweise"
 
+#: src/frontends/qt/ui/AboutUi.ui:307
+msgid "Copy Version Info"
+msgstr "Versionsinformationen kopieren"
+
 #: src/frontends/qt/ui/BibitemUi.ui:26 src/frontends/qt/ui/BibitemUi.ui:45
 msgid "The bibliography key"
 msgstr "Der Literaturschlüssel"
@@ -1672,7 +1685,7 @@ msgstr "&Groß-/Kleinschreibung beachten"
 msgid "Find next occurrence [Enter]"
 msgstr "Nächster Treffer [Eingabe]"
 
-#: src/frontends/qt/ui/FindAndReplaceUi.ui:150
+#: src/frontends/qt/ui/FindAndReplaceUi.ui:150 src/frontends/qt/ui/LogUi.ui:118
 #: src/frontends/qt/ui/SearchUi.ui:105
 msgid "Find &Next"
 msgstr "&Nächstes suchen"
@@ -2902,35 +2915,32 @@ msgstr "Springe zur nächsten Fehlermeldung."
 msgid "Next &Error"
 msgstr "Nächster &Fehler"
 
-#: src/frontends/qt/ui/LogUi.ui:81
+#: src/frontends/qt/ui/LogUi.ui:84
 msgid "Jump to the next warning message."
 msgstr "Springe zur nächsten Warnmeldung."
 
-#: src/frontends/qt/ui/LogUi.ui:84
+#: src/frontends/qt/ui/LogUi.ui:87
 msgid "Next &Warning"
 msgstr "Nächste &Warnung"
 
-#: src/frontends/qt/ui/LogUi.ui:95
+#: src/frontends/qt/ui/LogUi.ui:101
 msgid "&Find:"
 msgstr "&Suchen:"
 
-#: src/frontends/qt/ui/LogUi.ui:105
-msgid "Hit Enter to search, or click Go!"
-msgstr "Drücken Sie die Enter-Taste oder klicken Sie \"Los!\" an"
-
-#: src/frontends/qt/ui/LogUi.ui:112
-msgid "&Go!"
-msgstr "&Los!"
+#: src/frontends/qt/ui/LogUi.ui:111
+msgid "Hit Enter or click 'Find Next' to search"
+msgstr ""
+"Um die Suche zu starten drücken Sie die Return-Taste oder ,Nächstes suchen` "
 
-#: src/frontends/qt/ui/LogUi.ui:121
+#: src/frontends/qt/ui/LogUi.ui:130
 msgid "&Open Containing Directory"
 msgstr "Beinhaltendes &Verzeichnis öffnen"
 
-#: src/frontends/qt/ui/LogUi.ui:144
+#: src/frontends/qt/ui/LogUi.ui:156
 msgid "Update the display"
 msgstr "Anzeige aktualisieren"
 
-#: src/frontends/qt/ui/LogUi.ui:147 src/frontends/qt/ui/ViewSourceUi.ui:150
+#: src/frontends/qt/ui/LogUi.ui:159 src/frontends/qt/ui/ViewSourceUi.ui:150
 #: src/frontends/qt/GuiRef.cpp:79
 msgid "&Update"
 msgstr "A&ktualisieren"
@@ -3143,39 +3153,39 @@ msgstr "&Spalten:"
 msgid "Resize this to the correct table dimensions"
 msgstr "Verändern Sie die Größe hinsichtlich der korrekten Tabellenmaße"
 
-#: src/frontends/qt/ui/MathsUi.ui:48
+#: src/frontends/qt/ui/MathsUi.ui:51
 msgid "All packages:"
 msgstr "Alle Pakete:"
 
-#: src/frontends/qt/ui/MathsUi.ui:55
+#: src/frontends/qt/ui/MathsUi.ui:58
 msgid "Load A&utomatically"
 msgstr "&Automatisch laden"
 
-#: src/frontends/qt/ui/MathsUi.ui:62
+#: src/frontends/qt/ui/MathsUi.ui:65
 msgid "Load Alwa&ys"
 msgstr "&Immer laden"
 
-#: src/frontends/qt/ui/MathsUi.ui:69
+#: src/frontends/qt/ui/MathsUi.ui:72
 msgid "Do &Not Load"
 msgstr "&Nicht laden"
 
-#: src/frontends/qt/ui/MathsUi.ui:76
+#: src/frontends/qt/ui/MathsUi.ui:79
 msgid "Indent displayed formulas instead of centering"
 msgstr "Abgesetzte Formeln einrücken (nicht zentrieren)"
 
-#: src/frontends/qt/ui/MathsUi.ui:79
+#: src/frontends/qt/ui/MathsUi.ui:82
 msgid "Indent &formulas"
 msgstr "&Formeln einrücken"
 
-#: src/frontends/qt/ui/MathsUi.ui:95 src/frontends/qt/ui/TextLayoutUi.ui:183
+#: src/frontends/qt/ui/MathsUi.ui:98 src/frontends/qt/ui/TextLayoutUi.ui:183
 msgid "Size of the indentation"
 msgstr "Länge der Einrückung"
 
-#: src/frontends/qt/ui/MathsUi.ui:173
+#: src/frontends/qt/ui/MathsUi.ui:176
 msgid "Formula numbering side:"
 msgstr "Seite der Formelnummerierung:"
 
-#: src/frontends/qt/ui/MathsUi.ui:189
+#: src/frontends/qt/ui/MathsUi.ui:192
 msgid "Side where formulas are numbered"
 msgstr "Seite, auf der Formeln nummeriert werden"
 
@@ -3345,7 +3355,7 @@ msgstr "Bilder"
 #: src/frontends/qt/ui/OutputUi.ui:222 lib/layouts/aapaper.layout:63
 #: lib/layouts/egs.layout:702 lib/languages:145
 #: src/frontends/qt/GuiDocument.cpp:1600 src/frontends/qt/GuiErrorList.cpp:51
-#: src/frontends/qt/GuiLog.cpp:246 src/frontends/qt/GuiPrefs.cpp:641
+#: src/frontends/qt/GuiLog.cpp:236 src/frontends/qt/GuiPrefs.cpp:641
 msgid "LaTeX"
 msgstr "LaTeX"
 
@@ -9721,7 +9731,7 @@ msgstr "Article (Standardklasse)"
 msgid "Part"
 msgstr "Teil"
 
-#: lib/layouts/article.layout:32 lib/layouts/mwart.layout:35
+#: lib/layouts/article.layout:29 lib/layouts/mwart.layout:35
 #: lib/layouts/scrartcl.layout:32 lib/layouts/stdstarsections.inc:13
 #: lib/layouts/svcommon.inc:246
 msgid "Part*"
@@ -11044,8 +11054,8 @@ msgstr "Benutzerdefinierter Kopf-/Fußzeilentext"
 #: lib/layouts/customHeadersFooters.module:8
 msgid ""
 "Adds environments to define header and footer lines. NOTE: To use this "
-"module you must set the 'Headings style' in the menu Document Settings -> "
-"Page Layout to 'fancy'!"
+"module you must set the 'Page style' in the menu Document Settings -> Page "
+"Layout to 'fancy'!"
 msgstr ""
 "Fügt Umgebungen zur Definition von Kopf- und Fußzeilen hinzu. WICHTIG: Um "
 "dieses Modul verwenden zu können, müssen Sie in Dokument > Einstellungen > "
@@ -19587,7 +19597,7 @@ msgstr "Große Anfangsbuchstaben|A"
 #: lib/ui/stdcontext.inc:577 lib/ui/stdcontext.inc:590
 #: lib/ui/stdcontext.inc:600 lib/ui/stdcontext.inc:621
 #: lib/ui/stdcontext.inc:629 lib/ui/stdcontext.inc:675
-#: lib/ui/stdcontext.inc:682 lib/ui/stdmenus.inc:575
+#: lib/ui/stdcontext.inc:684 lib/ui/stdmenus.inc:575
 msgid "Settings...|S"
 msgstr "Einstellungen...|E"
 
@@ -20177,27 +20187,31 @@ msgstr "Abschnitt auswählen|h"
 msgid "Wrap by Preview|y"
 msgstr "Sofortige Vorschau|V"
 
-#: lib/ui/stdcontext.inc:691 lib/ui/stdmenus.inc:361
+#: lib/ui/stdcontext.inc:677
+msgid "Open Target...|O"
+msgstr "Verweisziel öffnen...|ö"
+
+#: lib/ui/stdcontext.inc:693 lib/ui/stdmenus.inc:361
 msgid "Lock Toolbars|L"
 msgstr "Verankere die Werkzeugleisten|V"
 
-#: lib/ui/stdcontext.inc:693 lib/ui/stdmenus.inc:363
+#: lib/ui/stdcontext.inc:695 lib/ui/stdmenus.inc:363
 msgid "Small-sized Icons"
 msgstr "Kleine Symbole"
 
-#: lib/ui/stdcontext.inc:694 lib/ui/stdmenus.inc:364
+#: lib/ui/stdcontext.inc:696 lib/ui/stdmenus.inc:364
 msgid "Normal-sized Icons"
 msgstr "Normalgroße Symbole"
 
-#: lib/ui/stdcontext.inc:695 lib/ui/stdmenus.inc:365
+#: lib/ui/stdcontext.inc:697 lib/ui/stdmenus.inc:365
 msgid "Big-sized Icons"
 msgstr "Große Symbole"
 
-#: lib/ui/stdcontext.inc:696 lib/ui/stdmenus.inc:366
+#: lib/ui/stdcontext.inc:698 lib/ui/stdmenus.inc:366
 msgid "Huge-sized Icons"
 msgstr "Riesige Symbole"
 
-#: lib/ui/stdcontext.inc:697 lib/ui/stdmenus.inc:367
+#: lib/ui/stdcontext.inc:699 lib/ui/stdmenus.inc:367
 msgid "Giant-sized Icons"
 msgstr "Gigantische Symbole"
 
@@ -21885,7 +21899,7 @@ msgstr "Andere Formate ansehen"
 msgid "Update Other Formats"
 msgstr "Andere Formate aktualisieren"
 
-#: lib/ui/stdtoolbars.inc:294 src/frontends/qt/GuiLog.cpp:267
+#: lib/ui/stdtoolbars.inc:294 src/frontends/qt/GuiLog.cpp:257
 msgid "Version Control"
 msgstr "Versionskontrolle"
 
@@ -26445,7 +26459,7 @@ msgstr "LyX-HTML"
 msgid "LyXHTML|y"
 msgstr "LyXHTML|y"
 
-#: lib/configure.py:725 src/frontends/qt/GuiLog.cpp:253
+#: lib/configure.py:725 src/frontends/qt/GuiLog.cpp:243
 #: src/insets/InsetBibtex.cpp:149
 msgid "BibTeX"
 msgstr "BibTeX"
@@ -27037,7 +27051,7 @@ msgstr ""
 "Bitte installieren Sie beide Pakete oder definieren Sie \\lyxadded und "
 "\\lyxdeleted im LaTeX-Vorspann neu."
 
-#: src/Buffer.cpp:1089 src/BufferParams.cpp:469 src/frontends/qt/GuiLog.cpp:257
+#: src/Buffer.cpp:1089 src/BufferParams.cpp:469 src/frontends/qt/GuiLog.cpp:247
 #: src/insets/InsetIndex.cpp:642
 msgid "Index"
 msgstr "Stichwortverzeichnis"
@@ -27751,7 +27765,7 @@ msgid "Document class not available"
 msgstr "Die Dokumentklasse ist nicht verfügbar"
 
 #: src/BufferParams.cpp:1751 src/BufferParams.cpp:2194 src/Encoding.cpp:253
-#: src/Paragraph.cpp:2790 src/frontends/qt/LaTeXHighlighter.cpp:122
+#: src/Paragraph.cpp:2859 src/frontends/qt/LaTeXHighlighter.cpp:122
 #: src/insets/InsetCommandParams.cpp:510 src/insets/InsetCommandParams.cpp:518
 #: src/insets/InsetGraphics.cpp:885 src/insets/InsetGraphics.cpp:893
 #: src/insets/InsetListings.cpp:301 src/insets/InsetListings.cpp:309
@@ -27761,7 +27775,7 @@ msgid "LyX Warning: "
 msgstr "LyX-Warnung: "
 
 #: src/BufferParams.cpp:1752 src/BufferParams.cpp:2195 src/Encoding.cpp:254
-#: src/Paragraph.cpp:2791 src/insets/InsetCommandParams.cpp:511
+#: src/Paragraph.cpp:2860 src/insets/InsetCommandParams.cpp:511
 #: src/insets/InsetCommandParams.cpp:519 src/insets/InsetGraphics.cpp:886
 #: src/insets/InsetGraphics.cpp:894 src/insets/InsetListings.cpp:302
 #: src/insets/InsetListings.cpp:310 src/mathed/MathExtern.cpp:1441
@@ -29408,7 +29422,7 @@ msgstr ""
 "zusammen.\n"
 "Weitere Optionen sind in der LyX-Manpage aufgeführt."
 
-#: src/LyX.cpp:1250 src/frontends/qt/GuiAbout.cpp:242
+#: src/LyX.cpp:1250 src/frontends/qt/GuiAbout.cpp:208
 msgid "  Git commit hash "
 msgstr " Git-Revision (commit hash) "
 
@@ -30074,15 +30088,15 @@ msgstr "Zur gespeicherten Version des Dokuments zurückkehren?"
 msgid "&Revert"
 msgstr "&Wiederherstellen"
 
-#: src/Paragraph.cpp:2040
+#: src/Paragraph.cpp:2053
 msgid "Senseless with this layout!"
 msgstr "Für dieses Format nicht relevant!"
 
-#: src/Paragraph.cpp:2094
+#: src/Paragraph.cpp:2107
 msgid "Alignment not permitted"
 msgstr "Ausrichtung nicht erlaubt"
 
-#: src/Paragraph.cpp:2095
+#: src/Paragraph.cpp:2108
 msgid ""
 "The new layout does not permit the alignment previously used.\n"
 "Setting to default."
@@ -30183,7 +30197,7 @@ msgstr ", Zeichen: 0x"
 msgid ", Boundary: "
 msgstr ", Grenze: "
 
-#: src/Text2.cpp:414
+#: src/Text2.cpp:418
 msgid "No font change defined."
 msgstr "Keine Schriftänderung definiert."
 
@@ -30873,11 +30887,11 @@ msgstr "Dokumentvoreinstellung"
 msgid "Float Settings"
 msgstr "Gleitobjekt-Einstellungen"
 
-#: src/frontends/qt/GuiAbout.cpp:51
+#: src/frontends/qt/GuiAbout.cpp:53
 msgid "ERROR: LyX wasn't able to find the CREDITS file\n"
 msgstr "Fehler: LyX konnte die Datei CREDITS nicht finden\n"
 
-#: src/frontends/qt/GuiAbout.cpp:52 src/frontends/qt/GuiAbout.cpp:57
+#: src/frontends/qt/GuiAbout.cpp:54 src/frontends/qt/GuiAbout.cpp:59
 msgid ""
 "Please install correctly to estimate the great\n"
 "amount of work other people have done for the LyX project."
@@ -30885,15 +30899,15 @@ msgstr ""
 "Bitte installieren Sie diese Datei, um die große Menge\n"
 "an Arbeit abschätzen zu können, die andere in LyX gesteckt haben."
 
-#: src/frontends/qt/GuiAbout.cpp:56
+#: src/frontends/qt/GuiAbout.cpp:58
 msgid "ERROR: LyX wasn't able to read the CREDITS file\n"
 msgstr "Fehler: LyX konnte die Datei CREDITS nicht lesen\n"
 
-#: src/frontends/qt/GuiAbout.cpp:93
+#: src/frontends/qt/GuiAbout.cpp:95
 msgid "ERROR: LyX wasn't able to find the RELEASE-NOTES file\n"
 msgstr "Fehler: LyX konnte die Datei RELEASE-NOTES nicht finden\n"
 
-#: src/frontends/qt/GuiAbout.cpp:94 src/frontends/qt/GuiAbout.cpp:99
+#: src/frontends/qt/GuiAbout.cpp:96 src/frontends/qt/GuiAbout.cpp:101
 msgid ""
 "Please install correctly to see what has changed\n"
 "for this version of LyX."
@@ -30901,11 +30915,11 @@ msgstr ""
 "Bitte installieren Sie diese Datei, um zu sehen, was sich\n"
 "für diese LyX-Version grundlegend geändert hat."
 
-#: src/frontends/qt/GuiAbout.cpp:98
+#: src/frontends/qt/GuiAbout.cpp:100
 msgid "ERROR: LyX wasn't able to read the RELEASE-NOTES file\n"
 msgstr "Fehler: LyX konnte die Datei RELEASE-NOTES nicht lesen\n"
 
-#: src/frontends/qt/GuiAbout.cpp:181
+#: src/frontends/qt/GuiAbout.cpp:183
 #, c-format
 msgid ""
 "LyX is Copyright (C) 1995 by Matthias Ettrich,\n"
@@ -30914,7 +30928,7 @@ msgstr ""
 "LyX -- Copyright (C) 1995 Matthias Ettrich,\n"
 "1995--%1$s LyX-Team"
 
-#: src/frontends/qt/GuiAbout.cpp:189
+#: src/frontends/qt/GuiAbout.cpp:191
 msgid ""
 "This program is free software; you can redistribute it and/or modify it "
 "under the terms of the GNU General Public License as published by the Free "
@@ -30926,7 +30940,7 @@ msgstr ""
 "Software Foundation weitergeben und/oder verändern. Verwenden Sie Version 2 "
 "oder (nach Ihrer Entscheidung) eine spätere Version der Lizenz."
 
-#: src/frontends/qt/GuiAbout.cpp:195
+#: src/frontends/qt/GuiAbout.cpp:197
 msgid ""
 "LyX is distributed in the hope that it will be useful, but WITHOUT ANY "
 "WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS "
@@ -30945,11 +30959,11 @@ msgstr ""
 "Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, "
 "USA."
 
-#: src/frontends/qt/GuiAbout.cpp:208
+#: src/frontends/qt/GuiAbout.cpp:237
 msgid "not released yet"
 msgstr "noch nicht veröffentlicht"
 
-#: src/frontends/qt/GuiAbout.cpp:213
+#: src/frontends/qt/GuiAbout.cpp:242
 #, c-format
 msgid ""
 "LyX Version %1$s\n"
@@ -30958,29 +30972,21 @@ msgstr ""
 "LyX Version %1$s\n"
 "(%2$s)"
 
-#: src/frontends/qt/GuiAbout.cpp:217
+#: src/frontends/qt/GuiAbout.cpp:246
 msgid "Built from git commit hash "
 msgstr "Erstellt aus Git-Revision "
 
-#: src/frontends/qt/GuiAbout.cpp:224
-msgid "Library directory: "
-msgstr "Systemverzeichnis: "
-
-#: src/frontends/qt/GuiAbout.cpp:227
-msgid "User directory: "
-msgstr "Benutzerverzeichnis: "
-
-#: src/frontends/qt/GuiAbout.cpp:230
+#: src/frontends/qt/GuiAbout.cpp:252
 #, c-format
 msgid "Qt Version (run-time): %1$s"
 msgstr "Qt-Version (Laufzeit): %1$s"
 
-#: src/frontends/qt/GuiAbout.cpp:231
+#: src/frontends/qt/GuiAbout.cpp:253
 #, c-format
 msgid "Qt Version (compile-time): %1$s"
 msgstr "Qt-Version (bei Erstellung): %1$s"
 
-#: src/frontends/qt/GuiAbout.cpp:257
+#: src/frontends/qt/GuiAbout.cpp:282
 msgid "About LyX"
 msgstr "Ãœber LyX"
 
@@ -31016,10 +31022,6 @@ msgstr "Anwenden"
 msgid "Reset"
 msgstr "Zurücksetzen"
 
-#: src/frontends/qt/GuiApplication.cpp:659
-msgid "Open"
-msgstr "Öffnen"
-
 #: src/frontends/qt/GuiApplication.cpp:1127
 msgid "Nothing to do"
 msgstr "Nichts zu tun"
@@ -31309,7 +31311,7 @@ msgstr "alle Literaturverzeichnisse"
 #: src/frontends/qt/GuiCompare.cpp:163 src/frontends/qt/GuiCompare.cpp:167
 #: src/frontends/qt/GuiDocument.cpp:2837 src/frontends/qt/GuiExternal.cpp:677
 #: src/frontends/qt/GuiGraphics.cpp:791 src/frontends/qt/GuiInclude.cpp:330
-#: src/frontends/qt/GuiLyXFiles.cpp:353 src/frontends/qt/GuiLyXFiles.cpp:359
+#: src/frontends/qt/GuiLyXFiles.cpp:368 src/frontends/qt/GuiLyXFiles.cpp:374
 #: src/frontends/qt/GuiView.cpp:2388 src/frontends/qt/GuiView.cpp:2447
 #: src/frontends/qt/GuiView.cpp:2585 src/frontends/qt/GuiView.cpp:2719
 #: src/frontends/qt/GuiView.cpp:2838 src/frontends/qt/GuiView.cpp:2960
@@ -31705,7 +31707,7 @@ msgstr "Vergleiche LyX-Dateien"
 msgid "Select document"
 msgstr "Dokument wählen"
 
-#: src/frontends/qt/GuiCompare.cpp:157 src/frontends/qt/GuiLyXFiles.cpp:352
+#: src/frontends/qt/GuiCompare.cpp:157 src/frontends/qt/GuiLyXFiles.cpp:367
 #: src/frontends/qt/GuiView.cpp:2392 src/frontends/qt/GuiView.cpp:2450
 #: src/frontends/qt/GuiView.cpp:2723 src/frontends/qt/GuiView.cpp:2849
 msgid "LyX Documents (*.lyx)"
@@ -32433,7 +32435,7 @@ msgstr "TeX-Code-Einstellungen"
 msgid "DocBook"
 msgstr "DocBook"
 
-#: src/frontends/qt/GuiErrorList.cpp:47 src/frontends/qt/GuiLog.cpp:261
+#: src/frontends/qt/GuiErrorList.cpp:47 src/frontends/qt/GuiLog.cpp:251
 msgid "Literate"
 msgstr "Literal"
 
@@ -33004,44 +33006,44 @@ msgstr "Programmlisting-Einstellungen"
 msgid "No dialect"
 msgstr "Kein Dialekt"
 
-#: src/frontends/qt/GuiLog.cpp:119 src/frontends/qt/GuiLog.cpp:289
+#: src/frontends/qt/GuiLog.cpp:117 src/frontends/qt/GuiLog.cpp:279
 msgid "LaTeX Log"
 msgstr "LaTeX-Protokoll"
 
-#: src/frontends/qt/GuiLog.cpp:251
+#: src/frontends/qt/GuiLog.cpp:241
 msgid "Biber"
 msgstr "Biber"
 
-#: src/frontends/qt/GuiLog.cpp:264
+#: src/frontends/qt/GuiLog.cpp:254
 msgid "LyX2LyX"
 msgstr "LyX2LyX"
 
-#: src/frontends/qt/GuiLog.cpp:291
+#: src/frontends/qt/GuiLog.cpp:281
 msgid "Literate Programming Build Log"
 msgstr "Erstellungsprotokoll für die literarische Programmierung"
 
-#: src/frontends/qt/GuiLog.cpp:293
+#: src/frontends/qt/GuiLog.cpp:283
 msgid "lyx2lyx Error Log"
 msgstr "lyx2lyx-Fehlerprotokoll"
 
-#: src/frontends/qt/GuiLog.cpp:295
+#: src/frontends/qt/GuiLog.cpp:285
 msgid "Version Control Log"
 msgstr "Protokoll der Versionskontrolle"
 
-#: src/frontends/qt/GuiLog.cpp:323
+#: src/frontends/qt/GuiLog.cpp:313
 msgid "Log file not found."
 msgstr "Protokolldatei nicht gefunden."
 
-#: src/frontends/qt/GuiLog.cpp:326
+#: src/frontends/qt/GuiLog.cpp:316
 msgid "No literate programming build log file found."
 msgstr ""
 "Keine Erstellungsprotokolldatei für die literarische Programmierung gefunden."
 
-#: src/frontends/qt/GuiLog.cpp:329
+#: src/frontends/qt/GuiLog.cpp:319
 msgid "No lyx2lyx error log file found."
 msgstr "Keine lyx2lyx-Fehlerprotokolldatei gefunden."
 
-#: src/frontends/qt/GuiLog.cpp:332
+#: src/frontends/qt/GuiLog.cpp:322
 msgid "No version control log file found."
 msgstr "Es wurde keine Protokolldatei der Versionskontrolle gefunden."
 
@@ -33049,7 +33051,7 @@ msgstr "Es wurde keine Protokolldatei der Versionskontrolle gefunden."
 msgid "Preferred &Language:"
 msgstr "Bevorzugte S&prache:"
 
-#: src/frontends/qt/GuiLyXFiles.cpp:161 src/frontends/qt/GuiLyXFiles.cpp:575
+#: src/frontends/qt/GuiLyXFiles.cpp:161 src/frontends/qt/GuiLyXFiles.cpp:590
 msgid "New File From Template"
 msgstr "Neu von Vorlage"
 
@@ -33073,11 +33075,11 @@ msgstr "Nur Benutzerdateien"
 msgid "System Files Only"
 msgstr "Nur Systemdateien"
 
-#: src/frontends/qt/GuiLyXFiles.cpp:304
+#: src/frontends/qt/GuiLyXFiles.cpp:319
 msgid "File &Language:"
 msgstr "S&prache des Dokuments:"
 
-#: src/frontends/qt/GuiLyXFiles.cpp:305
+#: src/frontends/qt/GuiLyXFiles.cpp:320
 msgid ""
 "All available languages of the selected file are displayed here.\n"
 "The selected language version will be opened."
@@ -33086,65 +33088,65 @@ msgstr ""
 "angezeigt.\n"
 "Die Datei wird in der ausgewählten Sprachversion geöffnet."
 
-#: src/frontends/qt/GuiLyXFiles.cpp:351
+#: src/frontends/qt/GuiLyXFiles.cpp:366
 msgid "Select example file"
 msgstr "Wählen Sie eine Beispieldatei"
 
-#: src/frontends/qt/GuiLyXFiles.cpp:354 src/frontends/qt/GuiView.cpp:2448
+#: src/frontends/qt/GuiLyXFiles.cpp:369 src/frontends/qt/GuiView.cpp:2448
 #: src/frontends/qt/GuiView.cpp:2586 src/frontends/qt/GuiView.cpp:2720
 msgid "&Examples"
 msgstr "&Beispiele"
 
-#: src/frontends/qt/GuiLyXFiles.cpp:358 src/frontends/qt/GuiView.cpp:2387
+#: src/frontends/qt/GuiLyXFiles.cpp:373 src/frontends/qt/GuiView.cpp:2387
 msgid "Select template file"
 msgstr "Wählen Sie eine Vorlagendatei"
 
-#: src/frontends/qt/GuiLyXFiles.cpp:360 src/frontends/qt/GuiView.cpp:2389
+#: src/frontends/qt/GuiLyXFiles.cpp:375 src/frontends/qt/GuiView.cpp:2389
 #: src/frontends/qt/GuiView.cpp:2839
 msgid "&Templates"
 msgstr "&Vorlagen"
 
-#: src/frontends/qt/GuiLyXFiles.cpp:365
+#: src/frontends/qt/GuiLyXFiles.cpp:380
 msgid "&User files"
 msgstr "&Benutzerdateien"
 
-#: src/frontends/qt/GuiLyXFiles.cpp:366
+#: src/frontends/qt/GuiLyXFiles.cpp:381
 msgid "&System files"
 msgstr "&Systemdateien"
 
-#: src/frontends/qt/GuiLyXFiles.cpp:369
+#: src/frontends/qt/GuiLyXFiles.cpp:384
 msgid "Chose UI file"
 msgstr "Wählen Sie eine 'UI'-Datei"
 
-#: src/frontends/qt/GuiLyXFiles.cpp:370
+#: src/frontends/qt/GuiLyXFiles.cpp:385
 msgid "LyX UI Files (*.ui)"
 msgstr "LyX-UI-Dateien (*.ui)"
 
-#: src/frontends/qt/GuiLyXFiles.cpp:373
+#: src/frontends/qt/GuiLyXFiles.cpp:388
 msgid "Chose bind file"
 msgstr "Wählen Sie eine Tastaturkürzel-Datei"
 
-#: src/frontends/qt/GuiLyXFiles.cpp:374
+#: src/frontends/qt/GuiLyXFiles.cpp:389
 msgid "LyX Bind Files (*.bind)"
 msgstr "LyX-Tastaturkürzel-Dateien (*.bind)"
 
-#: src/frontends/qt/GuiLyXFiles.cpp:377
+#: src/frontends/qt/GuiLyXFiles.cpp:392
 msgid "Chose keyboard map"
 msgstr "Wählen Sie eine Tastaturtabelle"
 
-#: src/frontends/qt/GuiLyXFiles.cpp:378
+#: src/frontends/qt/GuiLyXFiles.cpp:393
 msgid "LyX Keymap Files (*.kmap)"
 msgstr "LyX-Tastaturtabellen (*.kmap)"
 
-#: src/frontends/qt/GuiLyXFiles.cpp:436
+#: src/frontends/qt/GuiLyXFiles.cpp:451
 msgid "Default Template"
 msgstr "Standardvorlage"
 
-#: src/frontends/qt/GuiLyXFiles.cpp:573
+#: src/frontends/qt/GuiLyXFiles.cpp:588
 msgid "Open Example File"
 msgstr "Beispieldatei öffnen"
 
-#: src/frontends/qt/GuiLyXFiles.cpp:577
+#: src/frontends/qt/GuiLyXFiles.cpp:592
 msgid "Open File"
 msgstr "Datei öffnen"
 
@@ -34887,16 +34889,16 @@ msgstr ""
 "LyX bietet keine LaTeX-Unterstützung für Dateinamen, die eines der folgenden "
 "Zeichen enthalten:\n"
 
-#: src/frontends/qt/qt_helpers.cpp:311
+#: src/frontends/qt/qt_helpers.cpp:329
 msgid "Could not update TeX information"
 msgstr "Die TeX-Informationen konnten nicht aktualisiert werden"
 
-#: src/frontends/qt/qt_helpers.cpp:312
+#: src/frontends/qt/qt_helpers.cpp:330
 #, c-format
 msgid "The script `%1$s' failed."
 msgstr "Das Skript ,%1$s` ist fehlgeschlagen."
 
-#: src/frontends/qt/qt_helpers.cpp:560
+#: src/frontends/qt/qt_helpers.cpp:578
 msgid "All Files "
 msgstr "Alle Dateien "
 
@@ -35348,23 +35350,23 @@ msgstr ""
 msgid "Graphics file: %1$s"
 msgstr "Grafikdatei: %1$s"
 
-#: src/insets/InsetHyperlink.cpp:64
+#: src/insets/InsetHyperlink.cpp:68
 msgid "Hyperlink: "
 msgstr "Hyperlink: "
 
-#: src/insets/InsetHyperlink.cpp:259
+#: src/insets/InsetHyperlink.cpp:272
 msgid "www"
 msgstr "www"
 
-#: src/insets/InsetHyperlink.cpp:261
+#: src/insets/InsetHyperlink.cpp:274
 msgid "email"
 msgstr "E-Mail"
 
-#: src/insets/InsetHyperlink.cpp:263
+#: src/insets/InsetHyperlink.cpp:276
 msgid "file"
 msgstr "Datei"
 
-#: src/insets/InsetHyperlink.cpp:264
+#: src/insets/InsetHyperlink.cpp:277
 #, c-format
 msgid "Hyperlink (%1$s) to %2$s"
 msgstr "Hyperlink (%1$s) to %2$s"
@@ -36378,22 +36380,22 @@ msgstr ""
 "Die Informationen für die Änderungen von Tabellenzeilen- oder -spalten sind "
 "unvollständig. Sie werden ignoriert."
 
-#: src/insets/InsetTabular.cpp:5521
+#: src/insets/InsetTabular.cpp:5533
 msgid "Selections not supported."
 msgstr ""
 "Gleichzeitiges Verschieben mehrerer Zeilen/Spalten ist leider nicht möglich."
 
-#: src/insets/InsetTabular.cpp:5543
+#: src/insets/InsetTabular.cpp:5555
 msgid "Multi-column in current or destination column."
 msgstr ""
 "Diese oder die Zielspalte ist eine Mehrfachspalte. Verschieben nicht möglich."
 
-#: src/insets/InsetTabular.cpp:5555
+#: src/insets/InsetTabular.cpp:5567
 msgid "Multi-row in current or destination row."
 msgstr ""
 "Diese oder die Zielzeile ist eine Mehrfachzeile. Verschieben nicht möglich."
 
-#: src/insets/InsetTabular.cpp:6070
+#: src/insets/InsetTabular.cpp:6082
 msgid "Selection size should match clipboard content."
 msgstr ""
 "Die Anzahl der ausgewählten Zellen stimmt nicht mit dem Inhalt der "
@@ -37097,6 +37099,23 @@ msgstr ""
 msgid "Unknown user"
 msgstr "Unbekannter Benutzer"
 
+#, fuzzy
+#~ msgid "Library directory goes here."
+#~ msgstr "Systemverzeichnis: "
+
+#, fuzzy
+#~ msgid "User directory goes here."
+#~ msgstr "Benutzerverzeichnis: "
+
+#~ msgid "Version goes here"
+#~ msgstr "Die Versionsnummer kommt hierher"
+
+#~ msgid "Hit Enter to search, or click Go!"
+#~ msgstr "Drücken Sie die Enter-Taste oder klicken Sie \"Los!\" an"
+
+#~ msgid "&Go!"
+#~ msgstr "&Los!"
+
 #, fuzzy, c-format
 #~ msgid "%1$s"
 #~ msgstr "Unter-%1$s"

commit dc4b11b0e92e364eedd91c081d9999f0959839a8
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Sat Aug 15 12:28:38 2020 +0200

    Fix a lang edgecase

diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index e81eb2f..54d266e 100644
--- a/src/Paragraph.cpp
+++ b/src/Paragraph.cpp
@@ -1058,13 +1058,15 @@ void Paragraph::Private::latexInset(BufferParams const & bparams,
 		Font const copy_font(running_font);
 		basefont = owner_->getLayoutFont(bparams, outerfont);
 		running_font = basefont;
-		if (!closeLanguage)
+		if (!closeLanguage && !lang_switched_at_inset)
 			running_font.setLanguage(copy_font.language());
 		// For these, we use switches, so they should be taken as
 		// base inside the inset.
 		basefont.fontInfo().setSize(copy_font.fontInfo().size());
 		basefont.fontInfo().setFamily(copy_font.fontInfo().family());
 		basefont.fontInfo().setSeries(copy_font.fontInfo().series());
+		if (!closeLanguage && lang_switched_at_inset)
+			basefont.setLanguage(copy_font.language());
 		// Now re-do font changes in a way needed here
 		// (using switches with multi-par insets)
 		InsetText const * textinset = inset->asInsetText();
@@ -1074,7 +1076,7 @@ void Paragraph::Private::latexInset(BufferParams const & bparams,
 			: false;
 		unsigned int count2 = basefont.latexWriteStartChanges(os, bparams,
 						      runparams, running_font,
-						      basefont, true,
+						      running_font, true,
 						      cprotect);
 		column += count2;
 		if (count2 == 0 && (lang_closed || lang_switched_at_inset))
@@ -2815,6 +2817,10 @@ void Paragraph::latex(BufferParams const & bparams,
 					basefont.fontInfo().setSize(save_basefont.fontInfo().size());
 					basefont.fontInfo().setFamily(save_basefont.fontInfo().family());
 					basefont.fontInfo().setSeries(save_basefont.fontInfo().series());
+					if (!closeLanguage && lang_switched_at_inset) {
+						basefont.setLanguage(save_basefont.language());
+						running_font.setLanguage(save_runningfont.language());
+					}
 				}
 				if (incremented)
 					--parInline;

commit 0a2fce358d70ec062042b9845db3f86b4f7df2aa
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Sat Aug 15 12:27:58 2020 +0200

    Do not attempt to use switches around PassThur insets.
    
    This is bound to break with ERT snippets f. ex.

diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index 3acdd93..e81eb2f 100644
--- a/src/Paragraph.cpp
+++ b/src/Paragraph.cpp
@@ -1033,7 +1033,7 @@ void Paragraph::Private::latexInset(BufferParams const & bparams,
 		close = true;
 	}
 
-	if (open_font && (!inset->inheritFont() || inset->allowMultiPar())) {
+	if (open_font && (!inset->inheritFont() || fontswitch_inset)) {
 		bool lang_closed = false;
 		// Close language if needed
 		if (closeLanguage) {
@@ -2581,14 +2581,18 @@ void Paragraph::latex(BufferParams const & bparams,
 					     && runningChange == change
 					     && change.type == Change::DELETED
 					     && !os.afterParbreak());
-		bool const multipar_inset =
-			(c == META_INSET && getInset(i) && getInset(i)->allowMultiPar());
+		// Insets where font switches are used (rather than font commands)
+		bool const fontswitch_inset =
+				c == META_INSET
+				&& getInset(i)
+				&& getInset(i)->allowMultiPar()
+				&& !getInset(i)->isPassThru();
 
 		// Do we need to close the previous font?
 		if (open_font &&
 		    ((current_font != running_font
 		      || current_font.language() != running_font.language())
-		     || (multipar_inset
+		     || (fontswitch_inset
 			 && (current_font == prev_font
 			     || current_font.language() == prev_font.language()))))
 		{
@@ -2676,7 +2680,7 @@ void Paragraph::latex(BufferParams const & bparams,
 				column += 1;
 			}
 			otexstringstream ots;
-			if (!multipar_inset) {
+			if (!fontswitch_inset) {
 				InsetText const * textinset = inInset().asInsetText();
 				bool const cprotect = textinset
 					? textinset->hasCProtectContent(runparams.moving_arg)
@@ -2789,22 +2793,18 @@ void Paragraph::latex(BufferParams const & bparams,
 					// so we don't close the language in those cases
 					// (= differing isRightToLeft()).
 					// ArabTeX, though, doesn't seem to handle this special behavior.
-					bool const inRLSwitch = 
-							basefont.isRightToLeft() != running_font.isRightToLeft()
+					closeLanguage = basefont.isRightToLeft() != running_font.isRightToLeft()
 							&& basefont.language()->lang() != "arabic_arabtex"
 							&& running_font.language()->lang() != "arabic_arabtex";
-					// Having said that, PassThru insets must be inside a font change command,
-					// as we do not re-open the font inside. So:
-					closeLanguage = !inset->isPassThru() && !inRLSwitch;;
 					// We need to check prev_font as language changes directly at inset
 					// will only be started inside the inset.
 					lang_switched_at_inset = prev_font.language() != running_font.language();
 				}
 				d->latexInset(bparams, os, rp, running_font,
 						basefont, real_outerfont, open_font,
-				if (multipar_inset) {
 						runningChange, style, i, column,
 						fontswitch_inset, closeLanguage, lang_switched_at_inset);
+				if (fontswitch_inset) {
 					if (open_font) {
 						bool needPar = false;
 						column += running_font.latexWriteEndChanges(

commit 0a44c1687e11d7943517ae36ee413c4a7568714d
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Sat Aug 15 12:26:07 2020 +0200

    Move some tests upstream, since we'll need it there

diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index 7fd7eeb..3acdd93 100644
--- a/src/Paragraph.cpp
+++ b/src/Paragraph.cpp
@@ -342,7 +342,10 @@ public:
 				   Change & running_change,
 				   Layout const & style,
 				   pos_type & i,
-				   unsigned int & column);
+				   unsigned int & column,
+				   bool const fontswitch_inset,
+				   bool const closeLanguage,
+				   bool const lang_switched_at_inset);
 
 	///
 	void latexSpecialChar(
@@ -957,7 +960,10 @@ void Paragraph::Private::latexInset(BufferParams const & bparams,
 				    Change & running_change,
 				    Layout const & style,
 				    pos_type & i,
-				    unsigned int & column)
+				    unsigned int & column,
+				    bool const fontswitch_inset,
+				    bool const closeLanguage,
+				    bool const lang_switched_at_inset)
 {
 	Inset * inset = owner_->getInset(i);
 	LBUFERR(inset);
@@ -1028,21 +1034,7 @@ void Paragraph::Private::latexInset(BufferParams const & bparams,
 	}
 
 	if (open_font && (!inset->inheritFont() || inset->allowMultiPar())) {
-		// Some insets cannot be inside a font change command.
-		// However, even such insets *can* be placed in \L or \R
-		// or their equivalents (for RTL language switches),
-		// so we don't close the language in those cases
-		// (= differing isRightToLeft()).
-		// ArabTeX, though, doesn't seem to handle this special behavior.
-		bool const inRLSwitch = 
-				basefont.isRightToLeft() != running_font.isRightToLeft()
-				&& basefont.language()->lang() != "arabic_arabtex"
-				&& running_font.language()->lang() != "arabic_arabtex";
-		// Having said that, PassThru insets must be inside a font change command,
-		// as we do not re-open the font inside. So:
-		bool const closeLanguage = !inset->isPassThru() && !inRLSwitch;
 		bool lang_closed = false;
-		bool lang_switched_at_inset = false;
 		// Close language if needed
 		if (closeLanguage) {
 			// We need prev_font here as language changes directly at inset
@@ -1058,7 +1050,6 @@ void Paragraph::Private::latexInset(BufferParams const & bparams,
 									  needPar, closeLanguage);
 			column += count;
 			lang_closed = count > 0;
-			lang_switched_at_inset = prev_font.language() != running_font.language();
 		}
 		// Update the running_font, making sure, however,
 		// to leave the language as it was.
@@ -2788,10 +2779,32 @@ void Paragraph::latex(BufferParams const & bparams,
 				// We need to restore parts of this after insets with
 				// allowMultiPar() true
 				Font const save_basefont = basefont;
+				Font const save_runningfont = running_font;
+				bool closeLanguage = false;
+				bool lang_switched_at_inset = false;
+				if (fontswitch_inset) {
+					// Some insets cannot be inside a font change command.
+					// However, even such insets *can* be placed in \L or \R
+					// or their equivalents (for RTL language switches),
+					// so we don't close the language in those cases
+					// (= differing isRightToLeft()).
+					// ArabTeX, though, doesn't seem to handle this special behavior.
+					bool const inRLSwitch = 
+							basefont.isRightToLeft() != running_font.isRightToLeft()
+							&& basefont.language()->lang() != "arabic_arabtex"
+							&& running_font.language()->lang() != "arabic_arabtex";
+					// Having said that, PassThru insets must be inside a font change command,
+					// as we do not re-open the font inside. So:
+					closeLanguage = !inset->isPassThru() && !inRLSwitch;;
+					// We need to check prev_font as language changes directly at inset
+					// will only be started inside the inset.
+					lang_switched_at_inset = prev_font.language() != running_font.language();
+				}
 				d->latexInset(bparams, os, rp, running_font,
 						basefont, real_outerfont, open_font,
-						runningChange, style, i, column);
 				if (multipar_inset) {
+						runningChange, style, i, column,
+						fontswitch_inset, closeLanguage, lang_switched_at_inset);
 					if (open_font) {
 						bool needPar = false;
 						column += running_font.latexWriteEndChanges(

commit 6bcdea2b2d6bdd80367c8db2538bd0cb3ec880dc
Author: Kornel Benko <kornel at lyx.org>
Date:   Sat Aug 15 12:22:33 2020 +0200

    Cmake tests: Add a testcase

diff --git a/autotests/export/latex/languages/latinErt.lyx b/autotests/export/latex/languages/latinErt.lyx
new file mode 100644
index 0000000..212d68e
--- /dev/null
+++ b/autotests/export/latex/languages/latinErt.lyx
@@ -0,0 +1,159 @@
+#LyX 2.4 created this file. For more info see https://www.lyx.org/
+\lyxformat 598
+\begin_document
+\begin_header
+\save_transient_properties true
+\origin unavailable
+\textclass apa7
+\begin_preamble
+%%
+%% This is file `./samples/longsample.tex',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% apa7.dtx  (with options: `longsample')
+%% ----------------------------------------------------------------------
+%% 
+%% apa7 - A LaTeX class for formatting documents in compliance with the
+%% American Psychological Association's Publication Manual, 7th edition
+%% 
+%% Copyright (C) 2020 by Daniel A. Weiss <daniel.weiss.led at gmail.com>
+%% 
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License (LPPL), either
+%% version 1.3c of this license or (at your option) any later
+%% version.  The latest version of this license is in the file:
+%% 
+%% http://www.latex-project.org/lppl.txt
+%% 
+%% Users may freely modify these files without permission, as long as the
+%% copyright line and this statement are maintained intact.
+%% 
+%% This work is not endorsed by, affiliated with, or probably even known
+%% by, the American Psychological Association.
+%% 
+%% ----------------------------------------------------------------------
+%% 
+
+
+\usepackage{lipsum}
+
+\usepackage{csquotes}
+\end_preamble
+\options jou
+\use_default_options false
+\maintain_unincluded_children no
+\language american
+\language_package default
+\inputencoding auto-legacy
+\fontencoding default
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
+\font_default_family default
+\use_non_tex_fonts false
+\font_sc false
+\font_roman_osf false
+\font_sans_osf false
+\font_typewriter_osf false
+\font_sf_scale 100 100
+\font_tt_scale 100 100
+\use_microtype false
+\use_dash_ligatures true
+\graphics default
+\default_output_format default
+\output_sync 0
+\bibtex_command default
+\index_command default
+\float_placement class
+\float_alignment class
+\paperfontsize default
+\spacing single
+\use_hyperref false
+\papersize default
+\use_geometry false
+\use_package amsmath 1
+\use_package amssymb 0
+\use_package cancel 0
+\use_package esint 1
+\use_package mathdots 0
+\use_package mathtools 0
+\use_package mhchem 0
+\use_package stackrel 0
+\use_package stmaryrd 0
+\use_package undertilde 0
+\cite_engine biblatex
+\cite_engine_type authoryear
+\biblio_style plainnat
+\biblio_options sortcites=true,sorting=nyt,backend=biber
+\biblatex_bibstyle apa
+\biblatex_citestyle apa
+\use_bibtopic false
+\use_indices false
+\paperorientation portrait
+\suppress_date false
+\justification true
+\use_refstyle 0
+\use_minted 0
+\use_lineno 0
+\index Index
+\shortcut idx
+\color #008000
+\end_index
+\secnumdepth 3
+\tocdepth 3
+\paragraph_separation indent
+\paragraph_indentation default
+\is_math_indent 0
+\math_numbering_side default
+\quotes_style english
+\dynamic_quotes 0
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\tablestyle default
+\tracking_changes false
+\output_changes false
+\change_bars false
+\postpone_fragile_content true
+\html_math_output 0
+\html_css_as_file 0
+\html_be_strict false
+\docbook_table_output 0
+\end_header
+
+\begin_body
+
+\begin_layout Title
+Sample APA-Style Document Using the 
+\family sans
+apa7
+\family default
+ Package
+\end_layout
+
+\begin_layout Standard
+said this, too .
+ Further evidence comes from other sources .
+ 
+\lang latin
+
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+lipsum[3]
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_body
+\end_document

commit 80e9f7f426ae5f66c12251a8c6c6ba8a434ecaae
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Sat Aug 15 09:52:35 2020 +0200

    Fixup Apa7 template

diff --git a/lib/Makefile.am b/lib/Makefile.am
index da5c488..d4794f3 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -2538,6 +2538,7 @@ dist_articletemplates_DATA = \
 	templates/Articles/Copernicus_Publications_Manuscript_Preparation.lyx \
 	templates/Articles/Econometrica.lyx \
 	templates/Articles/Elsevier.lyx \
+	templates/Articles/Figure1.pdf \
 	templates/Articles/Hebrew_Article_%28KOMA-Script%29.lyx \
 	templates/Articles/IEEE_Transactions_Computer_Society.lyx \
 	templates/Articles/IEEE_Transactions_Conference.lyx \
diff --git a/lib/templates/Articles/American_Psychological_Association_%28APA%29,_v._7.lyx b/lib/templates/Articles/American_Psychological_Association_%28APA%29,_v._7.lyx
index bfda807..a6f608b 100644
--- a/lib/templates/Articles/American_Psychological_Association_%28APA%29,_v._7.lyx
+++ b/lib/templates/Articles/American_Psychological_Association_%28APA%29,_v._7.lyx
@@ -1,5 +1,5 @@
 #LyX 2.4 created this file. For more info see https://www.lyx.org/
-\lyxformat 594
+\lyxformat 598
 \begin_document
 \begin_header
 \save_transient_properties true
@@ -37,7 +37,7 @@
 %% 
 
 
-\usepackage{lipsum}
+
 
 \usepackage{csquotes}
 \end_preamble
@@ -121,24 +121,11 @@
 \html_math_output 0
 \html_css_as_file 0
 \html_be_strict false
+\docbook_table_output 0
 \end_header
 
 \begin_body
 
-\begin_layout Quotation
-\begin_inset Note Note
-status open
-
-\begin_layout Quotation
-Content taken from texlive2020/texmf-dist/doc/latex/apa7/samples/longsample.tex
- 
-\end_layout
-
-\end_inset
-
- 
-\end_layout
-
 \begin_layout Title
 Sample APA-Style Document Using the 
 \family sans
@@ -165,21 +152,25 @@ Weiss
 \end_layout
 
 \begin_layout Abstract
-
-\lang latin
-\begin_inset ERT
-status open
-
-\begin_layout Plain Layout
-
-
-\backslash
-lipsum[1]
-\end_layout
-
-\end_inset
-
-
+This is the abstract.
+ This is the abstract.
+ This is the abstract.
+ This is the abstract.
+ This is the abstract.
+ This is the abstract.
+ This is the abstract.
+ This is the abstract.
+ This is the abstract.
+ This is the abstract.
+ This is the abstract.
+ This is the abstract.
+ This is the abstract.
+ This is the abstract.
+ This is the abstract.
+ This is the abstract.
+ This is the abstract.
+ This is the abstract.
+ 
 \end_layout
 
 \begin_layout Keywords
@@ -240,49 +231,35 @@ Correspondence concerning this article should be addressed to Daniel A.
 \end_layout
 
 \begin_layout Standard
-
-\lang latin
-\begin_inset ERT
-status open
-
-\begin_layout Plain Layout
-
-
-\backslash
-lipsum
-\end_layout
-
-\end_inset
-
-
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-[
-\end_layout
-
-\end_inset
-
-2
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-]
-\end_layout
-
-\end_inset
-
-
+Some text.
+ Some text.
+ Some text.
+ Some text.
+ Some text.
+ Some text.
+ Some text.
+ Some text.
+ Some text.
+ Some text.
+ Some text.
+ Some text.
+ Some text.
+ Some text.
+ Some text.
+ Some text.
+ Some text.
+ Some text.
+ Some text.
+ Some text.
+ Some text.
+ Some text.
+ 
 \end_layout
 
 \begin_layout Standard
 \begin_inset CommandInset citation
 LatexCommand Citet
-key "vonDavier2011"
+key "coleridge"
 literal "false"
 
 \end_inset
@@ -290,7 +267,7 @@ literal "false"
  said this, too 
 \begin_inset CommandInset citation
 LatexCommand citep
-key "vonDavier2011,Lassen2006"
+key "coleridge,doody"
 literal "false"
 
 \end_inset
@@ -299,50 +276,25 @@ literal "false"
  Further evidence comes from other sources 
 \begin_inset CommandInset citation
 LatexCommand citep
-key "Shotton1989,Lassen2006"
+key "glashow,itzhaki"
 literal "false"
 
 \end_inset
 
 .
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
  
-\lang latin
-
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-
-\backslash
-lipsum
-\end_layout
-
-\end_inset
-
-
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-[
-\end_layout
-
-\end_inset
-
-3
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-]
-\end_layout
-
-\end_inset
-
-
 \end_layout
 
 \begin_layout Section
@@ -354,43 +306,19 @@ Participants
 \end_layout
 
 \begin_layout Standard
-
-\lang latin
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-
-\backslash
-lipsum
-\end_layout
-
-\end_inset
-
-
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-[
-\end_layout
-
-\end_inset
-
-4
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-]
-\end_layout
-
-\end_inset
-
-
+Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ 
 \end_layout
 
 \begin_layout Subsection
@@ -398,43 +326,19 @@ Materials
 \end_layout
 
 \begin_layout Standard
-
-\lang latin
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-
-\backslash
-lipsum
-\end_layout
-
-\end_inset
-
-
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-[
-\end_layout
-
-\end_inset
-
-5
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-]
-\end_layout
-
-\end_inset
-
-
+Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ 
 \end_layout
 
 \begin_layout Subsection
@@ -442,43 +346,19 @@ Design
 \end_layout
 
 \begin_layout Standard
-
-\lang latin
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-
-\backslash
-lipsum
-\end_layout
-
-\end_inset
-
-
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-[
-\end_layout
-
-\end_inset
-
-6
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-]
-\end_layout
-
-\end_inset
-
-
+Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ 
 \end_layout
 
 \begin_layout Subsection
@@ -486,43 +366,19 @@ Procedure
 \end_layout
 
 \begin_layout Standard
-
-\lang latin
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-
-\backslash
-lipsum
-\end_layout
-
-\end_inset
-
-
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-[
-\end_layout
-
-\end_inset
-
-7
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-]
-\end_layout
-
-\end_inset
-
-
+Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ 
 \end_layout
 
 \begin_layout Subsubsection
@@ -530,43 +386,19 @@ Instrument #1
 \end_layout
 
 \begin_layout Standard
-
-\lang latin
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-
-\backslash
-lipsum
-\end_layout
-
-\end_inset
-
-
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-[
-\end_layout
-
-\end_inset
-
-8
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-]
-\end_layout
-
-\end_inset
-
-
+Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ 
 \end_layout
 
 \begin_layout Paragraph
@@ -574,43 +406,19 @@ Reliability
 \end_layout
 
 \begin_layout Standard
-
-\lang latin
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-
-\backslash
-lipsum
-\end_layout
-
-\end_inset
-
-
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-[
-\end_layout
-
-\end_inset
-
-9
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-]
-\end_layout
-
-\end_inset
-
-
+Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ 
 \end_layout
 
 \begin_layout Subparagraph
@@ -618,43 +426,19 @@ Inter-rater reliability
 \end_layout
 
 \begin_layout Standard
-
-\lang latin
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-
-\backslash
-lipsum
-\end_layout
-
-\end_inset
-
-
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-[
-\end_layout
-
-\end_inset
-
-10
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-]
-\end_layout
-
-\end_inset
-
-
+Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ 
 \end_layout
 
 \begin_layout Subparagraph
@@ -662,43 +446,19 @@ Test-retest reliability
 \end_layout
 
 \begin_layout Standard
-
-\lang latin
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-
-\backslash
-lipsum
-\end_layout
-
-\end_inset
-
-
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-[
-\end_layout
-
-\end_inset
-
-11
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-]
-\end_layout
-
-\end_inset
-
-
+Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ 
 \end_layout
 
 \begin_layout Paragraph
@@ -706,43 +466,19 @@ Validity
 \end_layout
 
 \begin_layout Standard
-
-\lang latin
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-
-\backslash
-lipsum
-\end_layout
-
-\end_inset
-
-
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-[
-\end_layout
-
-\end_inset
-
-12
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-]
-\end_layout
-
-\end_inset
-
-
+Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ 
 \end_layout
 
 \begin_layout Subparagraph
@@ -750,43 +486,19 @@ Face validity
 \end_layout
 
 \begin_layout Standard
-
-\lang latin
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-
-\backslash
-lipsum
-\end_layout
-
-\end_inset
-
-
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-[
-\end_layout
-
-\end_inset
-
-13
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-]
-\end_layout
-
-\end_inset
-
-
+Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ 
 \end_layout
 
 \begin_layout Subparagraph
@@ -794,43 +506,19 @@ Construct validity
 \end_layout
 
 \begin_layout Standard
-
-\lang latin
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-
-\backslash
-lipsum
-\end_layout
-
-\end_inset
-
-
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-[
-\end_layout
-
-\end_inset
-
-14
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-]
-\end_layout
-
-\end_inset
-
-
+Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ 
 \end_layout
 
 \begin_layout Section
@@ -853,44 +541,19 @@ noprefix "false"
 \end_inset
 
  summarizes the data.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
  
-\lang latin
-
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-
-\backslash
-lipsum
-\end_layout
-
-\end_inset
-
-
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-[
-\end_layout
-
-\end_inset
-
-15
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-]
-\end_layout
-
-\end_inset
-
-
 \end_layout
 
 \begin_layout Standard
@@ -1158,7 +821,7 @@ This is my first figure caption.
 
 
 \begin_inset Graphics
-	filename /usr9/local/texlive/2020/texmf-dist/doc/latex/apa7/samples/Figure1.pdf
+	filename Figure1.pdf
 	width 2.5in
 	BoundingBox 0in 0in 2.5in 2.5in
 	special height=2.5in
@@ -1231,42 +894,19 @@ noprefix "false"
 \end_inset
 
  shows this trend.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
  
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-
-\backslash
-lipsum
-\end_layout
-
-\end_inset
-
-
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-[
-\end_layout
-
-\end_inset
-
-16
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-]
-\end_layout
-
-\end_inset
-
-
 \end_layout
 
 \begin_layout Section
@@ -1274,145 +914,59 @@ Discussion
 \end_layout
 
 \begin_layout Standard
-
-\lang latin
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-
-\backslash
-lipsum
-\end_layout
-
-\end_inset
-
-
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-[
-\end_layout
-
-\end_inset
-
-17
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-]
-\end_layout
-
-\end_inset
-
-
+Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ 
 \end_layout
 
 \begin_layout Standard
-
-\lang latin
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-
-\backslash
-lipsum
-\end_layout
-
-\end_inset
-
-
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-[
-\end_layout
-
-\end_inset
-
-18
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-]
-\end_layout
-
-\end_inset
-
-
+Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ 
 \end_layout
 
 \begin_layout Standard
-
-\lang latin
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-
-\backslash
-lipsum
-\end_layout
-
-\end_inset
-
-
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-[
-\end_layout
-
-\end_inset
-
-19
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-]
-\end_layout
-
-\end_inset
-
-
+Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ 
 \end_layout
 
 \begin_layout Standard
 \begin_inset CommandInset bibtex
 LatexCommand bibtex
-bibfiles "/usr9/local/texlive/2020/texmf-dist/doc/latex/apa7/samples/bibliography"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-\start_of_appendix
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-%dummy comment inserted by tex2lyx to ensure that this paragraph is not
- empty
-\end_layout
+btprint "btPrintCited"
+bibfiles "biblatex-examples"
+encoding "default"
 
 \end_inset
 
@@ -1420,6 +974,7 @@ status collapsed
 \end_layout
 
 \begin_layout Section
+\start_of_appendix
 Instrument
 \end_layout
 
@@ -1449,44 +1004,19 @@ noprefix "false"
 \end_inset
 
 , these results are impressive.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
  
-\lang latin
-
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-
-\backslash
-lipsum
-\end_layout
-
-\end_inset
-
-
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-[
-\end_layout
-
-\end_inset
-
-20
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-]
-\end_layout
-
-\end_inset
-
-
 \end_layout
 
 \begin_layout Standard
@@ -1508,7 +1038,7 @@ This is my second figure caption.
 
 
 \begin_inset Graphics
-	filename /usr9/local/texlive/2020/texmf-dist/doc/latex/apa7/samples/Figure1.pdf
+	filename Figure1.pdf
 	width 2.5in
 	BoundingBox 0in 0in 2.5in 2.5in
 	special height=2.5in
@@ -1566,42 +1096,18 @@ name "fig:Figure2"
 \end_layout
 
 \begin_layout Standard
-
-\lang latin
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-
-\backslash
-lipsum
-\end_layout
-
-\end_inset
-
-
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-[
-\end_layout
-
-\end_inset
-
-21
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-]
-\end_layout
-
-\end_inset
-
+Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
  
 \end_layout
 
@@ -1635,44 +1141,19 @@ noprefix "false"
 \end_inset
 
 .
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
  
-\lang latin
-
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-
-\backslash
-lipsum
-\end_layout
-
-\end_inset
-
-
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-[
-\end_layout
-
-\end_inset
-
-22
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-]
-\end_layout
-
-\end_inset
-
-
 \end_layout
 
 \begin_layout Standard
@@ -1685,7 +1166,7 @@ status open
 
 \begin_layout Plain Layout
 \begin_inset ERT
-status collapsed
+status open
 
 \begin_layout Plain Layout
 
@@ -2087,6 +1568,9 @@ tabfnm
 \end_inset
 
 
+\end_layout
+
+\begin_layout Plain Layout
 \begin_inset ERT
 status collapsed
 
@@ -2121,79 +1605,35 @@ status collapsed
 
 \end_inset
 
- 
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
 
-{
 \end_layout
 
-\end_inset
-
-
+\begin_layout Plain Layout
 \begin_inset ERT
-status collapsed
+status open
 
 \begin_layout Plain Layout
 
-
+{
 \backslash
-small
+small 
 \end_layout
 
 \end_inset
 
- 
-\shape italic
 Note.
-
-\shape default
  All data are approximate.
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-
-\backslash
-par 
 \end_layout
 
-\end_inset
-
-
-\begin_inset ERT
-status collapsed
-
 \begin_layout Plain Layout
-
-
-\backslash
-tabfnt
-\end_layout
-
-\end_inset
-
-
 \begin_inset ERT
-status collapsed
+status open
 
 \begin_layout Plain Layout
 
-{
-\end_layout
-
-\end_inset
 
-a
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-}
+\backslash
+tabfnt{a}
 \end_layout
 
 \end_inset
@@ -2201,97 +1641,50 @@ status collapsed
 Categorical may be onset.
  
 \begin_inset ERT
-status collapsed
+status open
 
 \begin_layout Plain Layout
 
 
 \backslash
-tabfnt
-\end_layout
-
-\end_inset
-
-
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-{
-\end_layout
-
-\end_inset
-
-b
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-}
+tabfnt{b}
 \end_layout
 
 \end_inset
 
 Categorical may also be coda.
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-
-\backslash
-par 
 \end_layout
 
-\end_inset
-
-
+\begin_layout Plain Layout
 \begin_inset ERT
-status collapsed
+status open
 
 \begin_layout Plain Layout
 
 
 \backslash
-tabfnt
+tabfnt{*}
 \end_layout
 
 \end_inset
 
-*
-\shape italic
-p
-\shape default
- < .05.
+p < .05.
  
 \begin_inset ERT
-status collapsed
+status open
 
 \begin_layout Plain Layout
 
 
 \backslash
-tabfnt
+tabfnt{**}
 \end_layout
 
 \end_inset
 
-
+p < .01.
 \begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-{
-\end_layout
-
-\end_inset
-
-**
-\begin_inset ERT
-status collapsed
+status open
 
 \begin_layout Plain Layout
 
@@ -2301,35 +1694,9 @@ status collapsed
 \end_inset
 
 
-\shape italic
-p
-\shape default
- < .01.
- 
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-}
 \end_layout
 
-\end_inset
-
- 
-\begin_inset ERT
-status collapsed
-
 \begin_layout Plain Layout
-
-
-\backslash
-end{tablenotes}
-\end_layout
-
-\end_inset
-
- 
 \begin_inset ERT
 status collapsed
 
@@ -2337,12 +1704,7 @@ status collapsed
 
 
 \backslash
-end{threeparttable}
-\end_layout
-
-\end_inset
-
- 
+end{tablenotes}
 \end_layout
 
 \end_inset
@@ -2350,9 +1712,7 @@ end{threeparttable}
 
 \end_layout
 
-\begin_layout Standard
-
-\lang latin
+\begin_layout Plain Layout
 \begin_inset ERT
 status collapsed
 
@@ -2360,34 +1720,33 @@ status collapsed
 
 
 \backslash
-lipsum
+end{threeparttable}
 \end_layout
 
 \end_inset
 
 
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-[
 \end_layout
 
 \end_inset
 
-23
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
 
-]
 \end_layout
 
-\end_inset
-
-
+\begin_layout Standard
+Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ Some more text.
+ 
 \end_layout
 
 \begin_layout Standard
@@ -2397,7 +1756,9 @@ status open
 \begin_layout Plain Layout
 \begin_inset CommandInset bibtex
 LatexCommand bibtex
-bibfiles "/usr9/local/texlive/2020/texmf-dist/doc/latex/apa7/samples/bibliography"
+btprint "btPrintCited"
+bibfiles "biblatex-examples"
+encoding "default"
 
 \end_inset
 
diff --git a/lib/templates/Articles/Figure1.pdf b/lib/templates/Articles/Figure1.pdf
new file mode 100644
index 0000000..e4f6a8d
Binary files /dev/null and b/lib/templates/Articles/Figure1.pdf differ

commit 469bc1bbe4f3cd93de1f147629ee497605ff9376
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Sat Aug 15 09:26:51 2020 +0200

    Revert apparent accident introduced in fed71fa8c2

diff --git a/src/insets/InsetCitation.cpp b/src/insets/InsetCitation.cpp
index 830648d..14a05a0 100644
--- a/src/insets/InsetCitation.cpp
+++ b/src/insets/InsetCitation.cpp
@@ -628,7 +628,7 @@ void InsetCitation::latex(otexstream & os, OutputParams const & runparams) const
 	// check if we have to do a qualified list
 	vector<docstring> keys = getVectorFromString(cleanupWhitespace(key));
 	bool const qualified = cs.hasQualifiedList
-		&& (!getParam("F").empty()
+		&& (!getParam("pretextlist").empty()
 		    || !getParam("posttextlist").empty());
 
 	if (runparams.inulemcmd > 0)

commit ea122aa8fa2381cac9858fc9dfe71062acb7218e
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Sat Aug 15 08:35:26 2020 +0200

    Amend 89d9334e03
    
    This needs to be default layout, not plain layout

diff --git a/src/Text2.cpp b/src/Text2.cpp
index 18fc518..ed4b133 100644
--- a/src/Text2.cpp
+++ b/src/Text2.cpp
@@ -182,10 +182,11 @@ void Text::setLayout(pit_type start, pit_type end,
 
 	for (pit_type pit = start; pit != end; ++pit) {
 		Paragraph & par = pars_[pit];
-		// Is this a separating paragraph?
+		// Is this a separating paragraph? If so,
+		// this needs to be standard layout
 		bool const is_separator = par.size() == 1
 				&& par.isEnvSeparator(0);
-		par.applyLayout(is_separator ? bp.documentClass().plainLayout() : lyxlayout);
+		par.applyLayout(is_separator ? bp.documentClass().defaultLayout() : lyxlayout);
 		if (lyxlayout.margintype == MARGIN_MANUAL)
 			par.setLabelWidthString(par.expandLabel(lyxlayout, bp));
 	}

commit 89d9334e03c311a4a7585f40ad81880304d174d4
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Sat Aug 15 08:14:17 2020 +0200

    Maintain plain layout for separating paragraphs when switching layouts (#11936)

diff --git a/src/Text2.cpp b/src/Text2.cpp
index 2d1ca0e..18fc518 100644
--- a/src/Text2.cpp
+++ b/src/Text2.cpp
@@ -182,7 +182,10 @@ void Text::setLayout(pit_type start, pit_type end,
 
 	for (pit_type pit = start; pit != end; ++pit) {
 		Paragraph & par = pars_[pit];
-		par.applyLayout(lyxlayout);
+		// Is this a separating paragraph?
+		bool const is_separator = par.size() == 1
+				&& par.isEnvSeparator(0);
+		par.applyLayout(is_separator ? bp.documentClass().plainLayout() : lyxlayout);
 		if (lyxlayout.margintype == MARGIN_MANUAL)
 			par.setLabelWidthString(par.expandLabel(lyxlayout, bp));
 	}

commit 1cf86348dd4cd93f8346d2caad53bd61e81e26e3
Author: Yuriy Skalko <yuriy.skalko at gmail.com>
Date:   Fri Aug 14 20:49:39 2020 +0300

    Enable search in "LaTeX Log" dialog by pressing Enter

diff --git a/src/frontends/qt/GuiLog.cpp b/src/frontends/qt/GuiLog.cpp
index 8682806..6d5462f 100644
--- a/src/frontends/qt/GuiLog.cpp
+++ b/src/frontends/qt/GuiLog.cpp
@@ -122,7 +122,6 @@ GuiLog::GuiLog(GuiView & lv)
 		this, SLOT(slotButtonBox(QAbstractButton *)));
 	connect(updatePB, SIGNAL(clicked()), this, SLOT(updateContents()));
 	connect(findPB, SIGNAL(clicked()), this, SLOT(find()));
-	// FIXME: find via returnPressed() does not work!
 	connect(findLE, SIGNAL(returnPressed()), this, SLOT(find()));
 	connect(logTypeCO, SIGNAL(activated(int)),
 		this, SLOT(typeChanged(int)));
@@ -134,6 +133,9 @@ GuiLog::GuiLog(GuiView & lv)
 
 	logTB->setReadOnly(true);
 	logTB->setFont(guiApp->typewriterSystemFont());
+
+	QPushButton * closePB = buttonBox->button(QDialogButtonBox::Close);
+	closePB->setAutoDefault(false);
 }
 
 
diff --git a/src/frontends/qt/ui/LogUi.ui b/src/frontends/qt/ui/LogUi.ui
index 6258268..a425133 100644
--- a/src/frontends/qt/ui/LogUi.ui
+++ b/src/frontends/qt/ui/LogUi.ui
@@ -73,6 +73,9 @@
        <property name="text">
         <string>Next &Error</string>
        </property>
+       <property name="autoDefault">
+        <bool>false</bool>
+       </property>
       </widget>
      </item>
      <item>
@@ -83,6 +86,9 @@
        <property name="text">
         <string>Next &Warning</string>
        </property>
+       <property name="autoDefault">
+        <bool>false</bool>
+       </property>
       </widget>
      </item>
     </layout>
@@ -102,14 +108,17 @@
      <item>
       <widget class="QLineEdit" name="findLE">
        <property name="toolTip">
-        <string>Hit Enter to search, or click Go!</string>
+        <string>Hit Enter or click 'Find Next' to search</string>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QPushButton" name="findPB">
        <property name="text">
-        <string>&Go!</string>
+        <string>Find &Next</string>
+       </property>
+       <property name="autoDefault">
+        <bool>false</bool>
        </property>
       </widget>
      </item>
@@ -120,6 +129,9 @@
      <property name="text">
       <string>&Open Containing Directory</string>
      </property>
+     <property name="autoDefault">
+      <bool>false</bool>
+     </property>
     </widget>
    </item>
    <item row="4" column="1">
@@ -146,8 +158,8 @@
      <property name="text">
       <string>&Update</string>
      </property>
-     <property name="default">
-      <bool>true</bool>
+     <property name="autoDefault">
+      <bool>false</bool>
      </property>
     </widget>
    </item>

commit 04ba887e2c7748c2bd2d244fa2e6aa46780318c7
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Sat Aug 15 07:06:20 2020 +0200

    Correctly re-set font before and after non-multipar inset

diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index 92f6ea1..7fd7eeb 100644
--- a/src/Paragraph.cpp
+++ b/src/Paragraph.cpp
@@ -1060,18 +1060,6 @@ void Paragraph::Private::latexInset(BufferParams const & bparams,
 			lang_closed = count > 0;
 			lang_switched_at_inset = prev_font.language() != running_font.language();
 		}
-		// Now re-do font changes in a way needed here
-		// (using switches with multi-par insets)
-		InsetText const * textinset = inset->asInsetText();
-		bool const cprotect = textinset
-			? textinset->hasCProtectContent(runparams.moving_arg)
-			  && !textinset->text().isMainText()
-			: false;
-		unsigned int count2 = running_font.latexWriteStartChanges(os, bparams,
-						      runparams, basefont,
-						      running_font, true,
-						      cprotect);
-		column += count2;
 		// Update the running_font, making sure, however,
 		// to leave the language as it was.
 		// FIXME: probably a better way to keep track of the old
@@ -1086,6 +1074,18 @@ void Paragraph::Private::latexInset(BufferParams const & bparams,
 		basefont.fontInfo().setSize(copy_font.fontInfo().size());
 		basefont.fontInfo().setFamily(copy_font.fontInfo().family());
 		basefont.fontInfo().setSeries(copy_font.fontInfo().series());
+		// Now re-do font changes in a way needed here
+		// (using switches with multi-par insets)
+		InsetText const * textinset = inset->asInsetText();
+		bool const cprotect = textinset
+			? textinset->hasCProtectContent(runparams.moving_arg)
+			  && !textinset->text().isMainText()
+			: false;
+		unsigned int count2 = basefont.latexWriteStartChanges(os, bparams,
+						      runparams, running_font,
+						      basefont, true,
+						      cprotect);
+		column += count2;
 		if (count2 == 0 && (lang_closed || lang_switched_at_inset))
 			// All fonts closed
 			open_font = false;
@@ -2785,16 +2785,23 @@ void Paragraph::latex(BufferParams const & bparams,
 						incremented = true;
 					}
 				}
-				// We need to restore these after insets with
+				// We need to restore parts of this after insets with
 				// allowMultiPar() true
-				Font const save_running_font = running_font;
 				Font const save_basefont = basefont;
 				d->latexInset(bparams, os, rp, running_font,
 						basefont, real_outerfont, open_font,
 						runningChange, style, i, column);
 				if (multipar_inset) {
-					running_font = save_running_font;
-					basefont = save_basefont;
+					if (open_font) {
+						bool needPar = false;
+						column += running_font.latexWriteEndChanges(
+							os, bparams, runparams,
+							basefont, basefont, needPar);
+						open_font = false;
+					}
+					basefont.fontInfo().setSize(save_basefont.fontInfo().size());
+					basefont.fontInfo().setFamily(save_basefont.fontInfo().family());
+					basefont.fontInfo().setSeries(save_basefont.fontInfo().series());
 				}
 				if (incremented)
 					--parInline;

commit 012c0f6bacfa1aeaa4bf58c23e1ad1802c967267
Author: Stephan Witt <switt at lyx.org>
Date:   Fri Aug 14 21:32:24 2020 +0200

    #6401 avoid unnecessary inset to string conversions in Paragraph::find while skipping invisible letters

diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index 99ab129..92f6ea1 100644
--- a/src/Paragraph.cpp
+++ b/src/Paragraph.cpp
@@ -4307,9 +4307,12 @@ int Paragraph::find(docstring const & str, bool cs, bool mw,
 		// Ignore "invisible" letters such as ligature breaks
 		// and hyphenation chars while searching
 		while (pos < parsize - 1 && isInset(pos)) {
+			Inset const * inset = getInset(pos);
+			if (!inset->isLetter())
+				break;
 			odocstringstream os;
-			getInset(pos)->toString(os);
-			if (!getInset(pos)->isLetter() || !os.str().empty())
+			inset->toString(os);
+			if (!os.str().empty())
 				break;
 			pos++;
 		}

commit 5bce66b1a38be7c7e622d57d896e1106ed3b48e0
Author: Stephan Witt <switt at lyx.org>
Date:   Fri Aug 14 21:28:24 2020 +0200

    #6401 more robust processing on special char code insets when looking for spell checker ranges

diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index 45cc80e..99ab129 100644
--- a/src/Paragraph.cpp
+++ b/src/Paragraph.cpp
@@ -4503,7 +4503,18 @@ Language * Paragraph::Private::locateSpellRange(
 	while (last < to && samelang && sameinset) {
 		// hop to end of word
 		while (last < to && !owner_->isWordSeparator(last)) {
-			if (owner_->getInset(last)) {
+			Inset const * inset = owner_->getInset(last);
+			if (inset && inset->lyxCode() == SPECIALCHAR_CODE) {
+				// check for "invisible" letters such as ligature breaks
+				odocstringstream os;
+				inset->toString(os);
+				if (os.str().length() != 0) {
+					// avoid spell check of visible special char insets
+					// stop the loop in front of the special char inset
+					sameinset = false;
+					break;
+				}
+			} else if (inset) {
 				appendSkipPosition(skips, last);
 			} else if (owner_->isDeleted(last)) {
 				appendSkipPosition(skips, last);

commit 48b1e8a0aca2f3f3faa8f1f800568e47792ba9a0
Author: Pavel Sanda <sanda at lyx.org>
Date:   Fri Aug 14 19:46:13 2020 +0200

    New attempt on #9906: allow following hyperlinks via context menu.
    
    Now safer version with the help of Qt.

diff --git a/lib/ui/stdcontext.inc b/lib/ui/stdcontext.inc
index 0a2cbda..c2beb31 100644
--- a/lib/ui/stdcontext.inc
+++ b/lib/ui/stdcontext.inc
@@ -673,6 +673,8 @@ Menuset
 #
 	Menu "context-hyperlink"
 		Item "Settings...|S" "inset-settings"
+		Separator
+		Item "Open Target...|O" "inset-edit"
 	End
 
 #
diff --git a/src/insets/InsetHyperlink.cpp b/src/insets/InsetHyperlink.cpp
index 26850cd..bfa478d 100644
--- a/src/insets/InsetHyperlink.cpp
+++ b/src/insets/InsetHyperlink.cpp
@@ -12,6 +12,9 @@
 #include <config.h>
 #include "InsetHyperlink.h"
 
+#include <QtGui/QDesktopServices>
+#include <QUrl>
+
 #include "Buffer.h"
 #include "DispatchResult.h"
 #include "Encoding.h"
@@ -30,6 +33,7 @@
 #include "support/filetools.h"
 #include "support/gettext.h"
 #include "support/lstrings.h"
+#include "support/qstring_helpers.h"
 
 #include "frontends/alert.h"
 
@@ -106,9 +110,13 @@ bool InsetHyperlink::getStatus(Cursor & cur, FuncRequest const & cmd,
 		FuncStatus & flag) const
 {
 	switch (cmd.action()) {
-	case LFUN_INSET_EDIT:
-		flag.setEnabled(getParam("type").empty() || getParam("type") == "file:");
+	case LFUN_INSET_EDIT: {
+		QUrl url(toqstr(getParam("target")),QUrl::StrictMode);
+		bool url_valid = getParam("type").empty() && url.isValid();
+
+		flag.setEnabled(url_valid || getParam("type") == "file:");
 		return true;
+		}
 
 	default:
 		return InsetCommand::getStatus(cur, cmd, flag);
@@ -118,7 +126,12 @@ bool InsetHyperlink::getStatus(Cursor & cur, FuncRequest const & cmd,
 
 void InsetHyperlink::viewTarget() const
 {
-	if (getParam("type") == "file:") {
+	if (getParam("type").empty()) { //==Web
+		QUrl url(toqstr(getParam("target")),QUrl::StrictMode);
+		if (!QDesktopServices::openUrl(url))
+			LYXERR0("Unable to open URL!");
+
+	} else if (getParam("type") == "file:") {
 		FileName url = makeAbsPath(to_utf8(getParam("target")), buffer().filePath());
 		string const format = theFormats().getFormatFromFile(url);
 		theFormats().view(buffer(), url, format);

commit 836300cd33cec51c26d715f01529f31e495fb156
Author: Enrico Forestieri <forenr at lyx.org>
Date:   Fri Aug 14 18:01:26 2020 +0200

    Revert "Correctly set font decorations for multipar insets"
    
    This reverts commit 5791b8bff8650be1ce0a3ee142e131fbc8de8587.

diff --git a/src/Font.cpp b/src/Font.cpp
index 1d6d080..327bc18 100644
--- a/src/Font.cpp
+++ b/src/Font.cpp
@@ -112,15 +112,6 @@ void Font::setLanguage(Language const * l)
 }
 
 
-void Font::setProperties(FontInfo const & f)
-{
-	bits_.setFamily(f.family());
-	bits_.setSeries(f.series());
-	bits_.setShape(f.shape());
-	bits_.setSize(f.size());
-}
-
-
 /// Updates font settings according to request
 void Font::update(Font const & newfont,
 		     Language const * document_language,
@@ -237,7 +228,7 @@ int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
 				    OutputParams const & runparams,
 				    Font const & base,
 				    Font const & prev,
-				    bool const & multipar_inset,
+				    bool const & non_inherit_inset,
 				    bool const & needs_cprotection) const
 {
 	int count = 0;
@@ -352,7 +343,7 @@ int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
 		count += strlen(LaTeXSizeSwitchNames[f.size()]) + 1;
 	}
 	if (f.family() != INHERIT_FAMILY) {
-		if (multipar_inset) {
+		if (non_inherit_inset) {
 			os << '{';
 			++count;
 			os << '\\' << LaTeXFamilySwitchNames[f.family()] << termcmd;
@@ -369,7 +360,7 @@ int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
 		}
 	}
 	if (f.series() != INHERIT_SERIES) {
-		if (multipar_inset) {
+		if (non_inherit_inset) {
 			os << '{';
 			++count;
 			os << '\\' << LaTeXSeriesSwitchNames[f.series()] << termcmd;
@@ -386,7 +377,7 @@ int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
 		}
 	}
 	if (f.shape() != INHERIT_SHAPE) {
-		if (multipar_inset) {
+		if (non_inherit_inset) {
 			os << '{';
 			++count;
 			os << '\\' << LaTeXShapeSwitchNames[f.shape()] << termcmd;
@@ -402,7 +393,7 @@ int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
 			count += strlen(LaTeXShapeCommandNames[f.shape()]) + 2;
 		}
 	}
-	if (f.color() != Color_inherit && f.color() != Color_ignore && !multipar_inset) {
+	if (f.color() != Color_inherit && f.color() != Color_ignore) {
 		if (f.color() == Color_none && p.color() != Color_none) {
 			// Color none: Close previous color, if any
 			os << '}';
@@ -448,7 +439,7 @@ int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
 			count += 9;
 		}
 	}
-	if (f.emph() == FONT_ON && !multipar_inset) {
+	if (f.emph() == FONT_ON) {
 		if (needs_cprotection) {
 			os << "\\cprotect";
 			count += 9;
@@ -457,7 +448,7 @@ int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
 		count += 6;
 	}
 	// \noun{} is a LyX special macro
-	if (f.noun() == FONT_ON && !multipar_inset) {
+	if (f.noun() == FONT_ON) {
 		if (needs_cprotection) {
 			os << "\\cprotect";
 			count += 9;
@@ -468,7 +459,7 @@ int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
 	// The ulem commands need to be on the deepest nesting level
 	// because ulem puts every nested group or macro in a box,
 	// which prevents linebreaks (#8424, #8733)
-	if (f.underbar() == FONT_ON && !multipar_inset) {
+	if (f.underbar() == FONT_ON) {
 		if (needs_cprotection) {
 			os << "\\cprotect";
 			count += 9;
@@ -477,7 +468,7 @@ int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
 		count += 7;
 		++runparams.inulemcmd;
 	}
-	if (f.uuline() == FONT_ON && !multipar_inset) {
+	if (f.uuline() == FONT_ON) {
 		if (needs_cprotection) {
 			os << "\\cprotect";
 			count += 9;
@@ -486,7 +477,7 @@ int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
 		count += 8;
 		++runparams.inulemcmd;
 	}
-	if (f.strikeout() == FONT_ON && !multipar_inset) {
+	if (f.strikeout() == FONT_ON) {
 		if (needs_cprotection) {
 			os << "\\cprotect";
 			count += 9;
@@ -495,7 +486,7 @@ int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
 		count += 6;
 		++runparams.inulemcmd;
 	}
-	if (f.xout() == FONT_ON && !multipar_inset) {
+	if (f.xout() == FONT_ON) {
 		if (needs_cprotection) {
 			os << "\\cprotect";
 			count += 9;
@@ -504,7 +495,7 @@ int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
 		count += 6;
 		++runparams.inulemcmd;
 	}
-	if (f.uwave() == FONT_ON && !multipar_inset) {
+	if (f.uwave() == FONT_ON) {
 		if (runparams.inulemcmd) {
 			// needed with nested uwave in xout
 			// see https://tex.stackexchange.com/a/263042
@@ -531,8 +522,7 @@ int Font::latexWriteEndChanges(otexstream & os, BufferParams const & bparams,
 				  Font const & base,
 				  Font const & next,
 				  bool & needPar,
-				  bool const & closeLanguage,
-				  bool const & multipar_inset) const
+				  bool const & closeLanguage) const
 {
 	int count = 0;
 
@@ -542,15 +532,15 @@ int Font::latexWriteEndChanges(otexstream & os, BufferParams const & bparams,
 	FontInfo f = bits_;
 	f.reduce(base.bits_);
 
-	if (f.family() != INHERIT_FAMILY && !multipar_inset) {
+	if (f.family() != INHERIT_FAMILY) {
 		os << '}';
 		++count;
 	}
-	if (f.series() != INHERIT_SERIES && !multipar_inset) {
+	if (f.series() != INHERIT_SERIES) {
 		os << '}';
 		++count;
 	}
-	if (f.shape() != INHERIT_SHAPE && !multipar_inset) {
+	if (f.shape() != INHERIT_SHAPE) {
 		os << '}';
 		++count;
 	}
@@ -568,17 +558,15 @@ int Font::latexWriteEndChanges(otexstream & os, BufferParams const & bparams,
 	}
 	if (f.size() != INHERIT_SIZE) {
 		// We do not close size group in front of
-		// insets with allowMultiPar() true (as opposed
+		// insets with InheritFont() false (as opposed
 		// to all other font properties) (#8384)
-		if (!multipar_inset) {
-			if (needPar && !closeLanguage) {
-				os << "\\par";
-				count += 4;
-				needPar = false;
-			}
-			os << '}';
-			++count;
+		if (needPar && !closeLanguage) {
+			os << "\\par";
+			count += 4;
+			needPar = false;
 		}
+		os << '}';
+		++count;
 	}
 	if (f.underbar() == FONT_ON) {
 		os << '}';
diff --git a/src/Font.h b/src/Font.h
index 8a59428..9b08c83 100644
--- a/src/Font.h
+++ b/src/Font.h
@@ -47,8 +47,6 @@ public:
 	bool isVisibleRightToLeft() const;
 	///
 	void setLanguage(Language const * l);
-	///
-	void setProperties(FontInfo const & f);
 
 	/// Returns size of font in LaTeX text notation
 	std::string const latexSize() const;
@@ -90,8 +88,7 @@ public:
 				 Font const & base,
 				 Font const & next,
 				 bool & needPar,
-				 bool const & closeLanguage = true,
-				 bool const & multipar_inset = false) const;
+				 bool const & closeLanguage = true) const;
 
 
 	/// Build GUI description of font state
diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index 7b5b160..45cc80e 100644
--- a/src/Paragraph.cpp
+++ b/src/Paragraph.cpp
@@ -1067,10 +1067,9 @@ void Paragraph::Private::latexInset(BufferParams const & bparams,
 			? textinset->hasCProtectContent(runparams.moving_arg)
 			  && !textinset->text().isMainText()
 			: false;
-		bool const multipar_inset = inset->allowMultiPar();
 		unsigned int count2 = running_font.latexWriteStartChanges(os, bparams,
 						      runparams, basefont,
-						      running_font, multipar_inset,
+						      running_font, true,
 						      cprotect);
 		column += count2;
 		// Update the running_font, making sure, however,
@@ -2414,11 +2413,10 @@ void Paragraph::latex(BufferParams const & bparams,
 	pos_type body_pos = beginOfBody();
 	unsigned int column = 0;
 
-	Font real_outerfont = outerfont;
-	// If we are inside an non inheritFont() inset, the real main
-	// properties of the outerfont are those of the local_font
-	if (!inInset().inheritFont() && runparams.local_font != nullptr)
-		real_outerfont.setProperties(runparams.local_font->fontInfo());
+	// If we are inside an non inheritFont() inset, the real outerfont is local_font
+	Font const real_outerfont = (!inInset().inheritFont()
+				     && runparams.local_font != nullptr)
+			? Font(runparams.local_font->fontInfo()) : outerfont;
 
 	if (body_pos > 0) {
 		// the optional argument is kept in curly brackets in
@@ -2465,8 +2463,6 @@ void Paragraph::latex(BufferParams const & bparams,
 	// Yes if greater than 0. This has to be static.
 	THREAD_LOCAL_STATIC int parInline = 0;
 
-	bool multipar_inset = false;
-
 	for (pos_type i = 0; i < size(); ++i) {
 		// First char in paragraph or after label?
 		if (i == body_pos) {
@@ -2475,8 +2471,7 @@ void Paragraph::latex(BufferParams const & bparams,
 					bool needPar = false;
 					column += running_font.latexWriteEndChanges(
 						os, bparams, runparams,
-						basefont, basefont, needPar,
-						multipar_inset);
+						basefont, basefont, needPar);
 					open_font = false;
 				}
 				basefont = getLayoutFont(bparams, real_outerfont);
@@ -2543,7 +2538,7 @@ void Paragraph::latex(BufferParams const & bparams,
 					bool needPar = false;
 					column += running_font.latexWriteEndChanges(
 						os, bparams, rp, basefont,
-						basefont, needPar, multipar_inset);
+						basefont, needPar);
 					open_font = false;
 				}
 				basefont = (body_pos > i) ? getLabelFont(bparams, real_outerfont)
@@ -2564,8 +2559,7 @@ void Paragraph::latex(BufferParams const & bparams,
 				bool needPar = false;
 				column += running_font.latexWriteEndChanges(
 						os, bparams, runparams,
-						basefont, basefont, needPar,
-						multipar_inset);
+						basefont, basefont, needPar);
 				open_font = false;
 			}
 			basefont = (body_pos > i) ? getLabelFont(bparams, real_outerfont)
@@ -2596,7 +2590,7 @@ void Paragraph::latex(BufferParams const & bparams,
 					     && runningChange == change
 					     && change.type == Change::DELETED
 					     && !os.afterParbreak());
-		multipar_inset =
+		bool const multipar_inset =
 			(c == META_INSET && getInset(i) && getInset(i)->allowMultiPar());
 
 		// Do we need to close the previous font?
@@ -2623,7 +2617,7 @@ void Paragraph::latex(BufferParams const & bparams,
 			column += running_font.latexWriteEndChanges(
 				    os, bparams, runparams, basefont,
 				    (i == body_pos-1) ? basefont : current_font,
-				    needPar, multipar_inset);
+				    needPar);
 			if (in_ct_deletion) {
 				// We have to close and then reopen \lyxdeleted,
 				// as strikeout needs to be on lowest level.
@@ -2686,7 +2680,7 @@ void Paragraph::latex(BufferParams const & bparams,
 				OutputParams rp = runparams;
 				column += running_font.latexWriteEndChanges(
 					os, bparams, rp, basefont,
-					basefont, needPar, multipar_inset);
+					basefont, needPar);
 				os << '}';
 				column += 1;
 			}
@@ -2791,16 +2785,16 @@ void Paragraph::latex(BufferParams const & bparams,
 						incremented = true;
 					}
 				}
-				// We need to restore the main properties of
-				// these fonts after allowMultiPar() insets
-				FontInfo const running_font_info = running_font.fontInfo();
-				FontInfo const basefont_info = basefont.fontInfo();
+				// We need to restore these after insets with
+				// allowMultiPar() true
+				Font const save_running_font = running_font;
+				Font const save_basefont = basefont;
 				d->latexInset(bparams, os, rp, running_font,
 						basefont, real_outerfont, open_font,
 						runningChange, style, i, column);
 				if (multipar_inset) {
-					running_font.setProperties(running_font_info);
-					basefont.setProperties(basefont_info);
+					running_font = save_running_font;
+					basefont = save_basefont;
 				}
 				if (incremented)
 					--parInline;
@@ -2923,7 +2917,7 @@ void Paragraph::latex(BufferParams const & bparams,
 //FIXME: there as we start another \selectlanguage with the next paragraph if
 //FIXME: we are in need of this. This should be fixed sometime (Jug)
 		running_font.latexWriteEndChanges(os, bparams, runparams,
-				basefont, basefont, needPar, multipar_inset);
+				basefont, basefont, needPar);
 #endif
 		if (needPar) {
 			// The \par could not be inserted at the same nesting

commit 9b7db1190120de5031efd785b4607bd900418cbb
Author: Kornel Benko <kornel at lyx.org>
Date:   Fri Aug 14 12:31:25 2020 +0200

    docbook exports: Omit crashing export on some files
    
    Committed since Thibaut apparently has no time to react, and the crash is
    really distracting.

diff --git a/src/insets/InsetNewline.cpp b/src/insets/InsetNewline.cpp
index 05c6ee4..45d52b2 100644
--- a/src/insets/InsetNewline.cpp
+++ b/src/insets/InsetNewline.cpp
@@ -176,8 +176,16 @@ void InsetNewline::docbook(XMLStream & xs, OutputParams const & runparams) const
 {
 	if (runparams.docbook_in_par) {
 		xs.closeFontTags();
-		xs << xml::EndTag("para");
-		xs << xml::StartTag("para");
+		if (!xs.pending_tags_empty()) {
+			xs << xml::EndTag("para");
+			xs << xml::StartTag("para");
+		}
+		else {
+			xs << xml::CR() << xml::CompTag("br") << xml::CR();
+		}
+	}
+	else {
+		xs << xml::CR() << xml::CompTag("br") << xml::CR();
 	}
 }
 
diff --git a/src/xml.h b/src/xml.h
index 12e7f25..b585a48 100644
--- a/src/xml.h
+++ b/src/xml.h
@@ -126,6 +126,8 @@ private:
 	TagDeque pending_tags_;
 	///
 	TagDeque tag_stack_;
+public:
+	bool pending_tags_empty() { return pending_tags_.empty();};
 };
 
 namespace xml {

commit 5791b8bff8650be1ce0a3ee142e131fbc8de8587
Author: Enrico Forestieri <forenr at lyx.org>
Date:   Fri Aug 14 12:04:23 2020 +0200

    Correctly set font decorations for multipar insets
    
    Font decorations such as underline cannot be set for a whole inset
    that allows paragraph breaks. This commit allows to still set the
    font main properties for the whole inset but decorations are applied
    to each paragraph inside the inset.

diff --git a/src/Font.cpp b/src/Font.cpp
index 327bc18..1d6d080 100644
--- a/src/Font.cpp
+++ b/src/Font.cpp
@@ -112,6 +112,15 @@ void Font::setLanguage(Language const * l)
 }
 
 
+void Font::setProperties(FontInfo const & f)
+{
+	bits_.setFamily(f.family());
+	bits_.setSeries(f.series());
+	bits_.setShape(f.shape());
+	bits_.setSize(f.size());
+}
+
+
 /// Updates font settings according to request
 void Font::update(Font const & newfont,
 		     Language const * document_language,
@@ -228,7 +237,7 @@ int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
 				    OutputParams const & runparams,
 				    Font const & base,
 				    Font const & prev,
-				    bool const & non_inherit_inset,
+				    bool const & multipar_inset,
 				    bool const & needs_cprotection) const
 {
 	int count = 0;
@@ -343,7 +352,7 @@ int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
 		count += strlen(LaTeXSizeSwitchNames[f.size()]) + 1;
 	}
 	if (f.family() != INHERIT_FAMILY) {
-		if (non_inherit_inset) {
+		if (multipar_inset) {
 			os << '{';
 			++count;
 			os << '\\' << LaTeXFamilySwitchNames[f.family()] << termcmd;
@@ -360,7 +369,7 @@ int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
 		}
 	}
 	if (f.series() != INHERIT_SERIES) {
-		if (non_inherit_inset) {
+		if (multipar_inset) {
 			os << '{';
 			++count;
 			os << '\\' << LaTeXSeriesSwitchNames[f.series()] << termcmd;
@@ -377,7 +386,7 @@ int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
 		}
 	}
 	if (f.shape() != INHERIT_SHAPE) {
-		if (non_inherit_inset) {
+		if (multipar_inset) {
 			os << '{';
 			++count;
 			os << '\\' << LaTeXShapeSwitchNames[f.shape()] << termcmd;
@@ -393,7 +402,7 @@ int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
 			count += strlen(LaTeXShapeCommandNames[f.shape()]) + 2;
 		}
 	}
-	if (f.color() != Color_inherit && f.color() != Color_ignore) {
+	if (f.color() != Color_inherit && f.color() != Color_ignore && !multipar_inset) {
 		if (f.color() == Color_none && p.color() != Color_none) {
 			// Color none: Close previous color, if any
 			os << '}';
@@ -439,7 +448,7 @@ int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
 			count += 9;
 		}
 	}
-	if (f.emph() == FONT_ON) {
+	if (f.emph() == FONT_ON && !multipar_inset) {
 		if (needs_cprotection) {
 			os << "\\cprotect";
 			count += 9;
@@ -448,7 +457,7 @@ int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
 		count += 6;
 	}
 	// \noun{} is a LyX special macro
-	if (f.noun() == FONT_ON) {
+	if (f.noun() == FONT_ON && !multipar_inset) {
 		if (needs_cprotection) {
 			os << "\\cprotect";
 			count += 9;
@@ -459,7 +468,7 @@ int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
 	// The ulem commands need to be on the deepest nesting level
 	// because ulem puts every nested group or macro in a box,
 	// which prevents linebreaks (#8424, #8733)
-	if (f.underbar() == FONT_ON) {
+	if (f.underbar() == FONT_ON && !multipar_inset) {
 		if (needs_cprotection) {
 			os << "\\cprotect";
 			count += 9;
@@ -468,7 +477,7 @@ int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
 		count += 7;
 		++runparams.inulemcmd;
 	}
-	if (f.uuline() == FONT_ON) {
+	if (f.uuline() == FONT_ON && !multipar_inset) {
 		if (needs_cprotection) {
 			os << "\\cprotect";
 			count += 9;
@@ -477,7 +486,7 @@ int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
 		count += 8;
 		++runparams.inulemcmd;
 	}
-	if (f.strikeout() == FONT_ON) {
+	if (f.strikeout() == FONT_ON && !multipar_inset) {
 		if (needs_cprotection) {
 			os << "\\cprotect";
 			count += 9;
@@ -486,7 +495,7 @@ int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
 		count += 6;
 		++runparams.inulemcmd;
 	}
-	if (f.xout() == FONT_ON) {
+	if (f.xout() == FONT_ON && !multipar_inset) {
 		if (needs_cprotection) {
 			os << "\\cprotect";
 			count += 9;
@@ -495,7 +504,7 @@ int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
 		count += 6;
 		++runparams.inulemcmd;
 	}
-	if (f.uwave() == FONT_ON) {
+	if (f.uwave() == FONT_ON && !multipar_inset) {
 		if (runparams.inulemcmd) {
 			// needed with nested uwave in xout
 			// see https://tex.stackexchange.com/a/263042
@@ -522,7 +531,8 @@ int Font::latexWriteEndChanges(otexstream & os, BufferParams const & bparams,
 				  Font const & base,
 				  Font const & next,
 				  bool & needPar,
-				  bool const & closeLanguage) const
+				  bool const & closeLanguage,
+				  bool const & multipar_inset) const
 {
 	int count = 0;
 
@@ -532,15 +542,15 @@ int Font::latexWriteEndChanges(otexstream & os, BufferParams const & bparams,
 	FontInfo f = bits_;
 	f.reduce(base.bits_);
 
-	if (f.family() != INHERIT_FAMILY) {
+	if (f.family() != INHERIT_FAMILY && !multipar_inset) {
 		os << '}';
 		++count;
 	}
-	if (f.series() != INHERIT_SERIES) {
+	if (f.series() != INHERIT_SERIES && !multipar_inset) {
 		os << '}';
 		++count;
 	}
-	if (f.shape() != INHERIT_SHAPE) {
+	if (f.shape() != INHERIT_SHAPE && !multipar_inset) {
 		os << '}';
 		++count;
 	}
@@ -558,15 +568,17 @@ int Font::latexWriteEndChanges(otexstream & os, BufferParams const & bparams,
 	}
 	if (f.size() != INHERIT_SIZE) {
 		// We do not close size group in front of
-		// insets with InheritFont() false (as opposed
+		// insets with allowMultiPar() true (as opposed
 		// to all other font properties) (#8384)
-		if (needPar && !closeLanguage) {
-			os << "\\par";
-			count += 4;
-			needPar = false;
+		if (!multipar_inset) {
+			if (needPar && !closeLanguage) {
+				os << "\\par";
+				count += 4;
+				needPar = false;
+			}
+			os << '}';
+			++count;
 		}
-		os << '}';
-		++count;
 	}
 	if (f.underbar() == FONT_ON) {
 		os << '}';
diff --git a/src/Font.h b/src/Font.h
index 9b08c83..8a59428 100644
--- a/src/Font.h
+++ b/src/Font.h
@@ -47,6 +47,8 @@ public:
 	bool isVisibleRightToLeft() const;
 	///
 	void setLanguage(Language const * l);
+	///
+	void setProperties(FontInfo const & f);
 
 	/// Returns size of font in LaTeX text notation
 	std::string const latexSize() const;
@@ -88,7 +90,8 @@ public:
 				 Font const & base,
 				 Font const & next,
 				 bool & needPar,
-				 bool const & closeLanguage = true) const;
+				 bool const & closeLanguage = true,
+				 bool const & multipar_inset = false) const;
 
 
 	/// Build GUI description of font state
diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index 45cc80e..7b5b160 100644
--- a/src/Paragraph.cpp
+++ b/src/Paragraph.cpp
@@ -1067,9 +1067,10 @@ void Paragraph::Private::latexInset(BufferParams const & bparams,
 			? textinset->hasCProtectContent(runparams.moving_arg)
 			  && !textinset->text().isMainText()
 			: false;
+		bool const multipar_inset = inset->allowMultiPar();
 		unsigned int count2 = running_font.latexWriteStartChanges(os, bparams,
 						      runparams, basefont,
-						      running_font, true,
+						      running_font, multipar_inset,
 						      cprotect);
 		column += count2;
 		// Update the running_font, making sure, however,
@@ -2413,10 +2414,11 @@ void Paragraph::latex(BufferParams const & bparams,
 	pos_type body_pos = beginOfBody();
 	unsigned int column = 0;
 
-	// If we are inside an non inheritFont() inset, the real outerfont is local_font
-	Font const real_outerfont = (!inInset().inheritFont()
-				     && runparams.local_font != nullptr)
-			? Font(runparams.local_font->fontInfo()) : outerfont;
+	Font real_outerfont = outerfont;
+	// If we are inside an non inheritFont() inset, the real main
+	// properties of the outerfont are those of the local_font
+	if (!inInset().inheritFont() && runparams.local_font != nullptr)
+		real_outerfont.setProperties(runparams.local_font->fontInfo());
 
 	if (body_pos > 0) {
 		// the optional argument is kept in curly brackets in
@@ -2463,6 +2465,8 @@ void Paragraph::latex(BufferParams const & bparams,
 	// Yes if greater than 0. This has to be static.
 	THREAD_LOCAL_STATIC int parInline = 0;
 
+	bool multipar_inset = false;
+
 	for (pos_type i = 0; i < size(); ++i) {
 		// First char in paragraph or after label?
 		if (i == body_pos) {
@@ -2471,7 +2475,8 @@ void Paragraph::latex(BufferParams const & bparams,
 					bool needPar = false;
 					column += running_font.latexWriteEndChanges(
 						os, bparams, runparams,
-						basefont, basefont, needPar);
+						basefont, basefont, needPar,
+						multipar_inset);
 					open_font = false;
 				}
 				basefont = getLayoutFont(bparams, real_outerfont);
@@ -2538,7 +2543,7 @@ void Paragraph::latex(BufferParams const & bparams,
 					bool needPar = false;
 					column += running_font.latexWriteEndChanges(
 						os, bparams, rp, basefont,
-						basefont, needPar);
+						basefont, needPar, multipar_inset);
 					open_font = false;
 				}
 				basefont = (body_pos > i) ? getLabelFont(bparams, real_outerfont)
@@ -2559,7 +2564,8 @@ void Paragraph::latex(BufferParams const & bparams,
 				bool needPar = false;
 				column += running_font.latexWriteEndChanges(
 						os, bparams, runparams,
-						basefont, basefont, needPar);
+						basefont, basefont, needPar,
+						multipar_inset);
 				open_font = false;
 			}
 			basefont = (body_pos > i) ? getLabelFont(bparams, real_outerfont)
@@ -2590,7 +2596,7 @@ void Paragraph::latex(BufferParams const & bparams,
 					     && runningChange == change
 					     && change.type == Change::DELETED
 					     && !os.afterParbreak());
-		bool const multipar_inset =
+		multipar_inset =
 			(c == META_INSET && getInset(i) && getInset(i)->allowMultiPar());
 
 		// Do we need to close the previous font?
@@ -2617,7 +2623,7 @@ void Paragraph::latex(BufferParams const & bparams,
 			column += running_font.latexWriteEndChanges(
 				    os, bparams, runparams, basefont,
 				    (i == body_pos-1) ? basefont : current_font,
-				    needPar);
+				    needPar, multipar_inset);
 			if (in_ct_deletion) {
 				// We have to close and then reopen \lyxdeleted,
 				// as strikeout needs to be on lowest level.
@@ -2680,7 +2686,7 @@ void Paragraph::latex(BufferParams const & bparams,
 				OutputParams rp = runparams;
 				column += running_font.latexWriteEndChanges(
 					os, bparams, rp, basefont,
-					basefont, needPar);
+					basefont, needPar, multipar_inset);
 				os << '}';
 				column += 1;
 			}
@@ -2785,16 +2791,16 @@ void Paragraph::latex(BufferParams const & bparams,
 						incremented = true;
 					}
 				}
-				// We need to restore these after insets with
-				// allowMultiPar() true
-				Font const save_running_font = running_font;
-				Font const save_basefont = basefont;
+				// We need to restore the main properties of
+				// these fonts after allowMultiPar() insets
+				FontInfo const running_font_info = running_font.fontInfo();
+				FontInfo const basefont_info = basefont.fontInfo();
 				d->latexInset(bparams, os, rp, running_font,
 						basefont, real_outerfont, open_font,
 						runningChange, style, i, column);
 				if (multipar_inset) {
-					running_font = save_running_font;
-					basefont = save_basefont;
+					running_font.setProperties(running_font_info);
+					basefont.setProperties(basefont_info);
 				}
 				if (incremented)
 					--parInline;
@@ -2917,7 +2923,7 @@ void Paragraph::latex(BufferParams const & bparams,
 //FIXME: there as we start another \selectlanguage with the next paragraph if
 //FIXME: we are in need of this. This should be fixed sometime (Jug)
 		running_font.latexWriteEndChanges(os, bparams, runparams,
-				basefont, basefont, needPar);
+				basefont, basefont, needPar, multipar_inset);
 #endif
 		if (needPar) {
 			// The \par could not be inserted at the same nesting

commit 4c3139314b2738f04928ff1c9cb3ec49fe45ece6
Author: Yuriy Skalko <yuriy.skalko at gmail.com>
Date:   Thu Aug 13 23:43:03 2020 +0300

    Correct Right Arrow key processing in Modules list

diff --git a/src/frontends/qt/GuiSelectionManager.cpp b/src/frontends/qt/GuiSelectionManager.cpp
index df43d0c..5732d1e 100644
--- a/src/frontends/qt/GuiSelectionManager.cpp
+++ b/src/frontends/qt/GuiSelectionManager.cpp
@@ -418,6 +418,10 @@ bool GuiSelectionManager::eventFilter(QObject * obj, QEvent * event)
 				return true;
 			}
 			else if (keyPressed == Qt::Key_Right) {
+				QModelIndex const idx = availableLV->currentIndex();
+				if (availableLV->model()->hasChildren(idx)) { // skip for headers
+					return false;
+				}
 				focusAndHighlight(selectedLV);
 				event->accept();
 				return true;

commit e1dd91e10e3f76b4bd47c8d7133ad7318edf04f1
Author: Yuriy Skalko <yuriy.skalko at gmail.com>
Date:   Tue Aug 11 11:48:24 2020 +0300

    Disable editing of math package names in Document Settings

diff --git a/src/frontends/qt/ui/MathsUi.ui b/src/frontends/qt/ui/MathsUi.ui
index 4258819..e30f970 100644
--- a/src/frontends/qt/ui/MathsUi.ui
+++ b/src/frontends/qt/ui/MathsUi.ui
@@ -22,6 +22,9 @@
        <verstretch>0</verstretch>
       </sizepolicy>
      </property>
+     <property name="editTriggers">
+      <set>QAbstractItemView::NoEditTriggers</set>
+     </property>
      <property name="alternatingRowColors">
       <bool>true</bool>
      </property>

commit 70eb8c37cb2f002991913ebe7a19cd50f4a9d922
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Fri Aug 14 09:50:40 2020 +0200

    Do not close language before PassThru insets

diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index e066d2b..45cc80e 100644
--- a/src/Paragraph.cpp
+++ b/src/Paragraph.cpp
@@ -1030,13 +1030,17 @@ void Paragraph::Private::latexInset(BufferParams const & bparams,
 	if (open_font && (!inset->inheritFont() || inset->allowMultiPar())) {
 		// Some insets cannot be inside a font change command.
 		// However, even such insets *can* be placed in \L or \R
-		// or their equivalents (for RTL language switches), so we don't
-		// close the language in those cases.
-		// ArabTeX, though, cannot handle this special behavior, it seems.
-		bool arabtex = basefont.language()->lang() == "arabic_arabtex"
-			|| running_font.language()->lang() == "arabic_arabtex";
-		bool closeLanguage = arabtex
-			|| basefont.isRightToLeft() == running_font.isRightToLeft();
+		// or their equivalents (for RTL language switches),
+		// so we don't close the language in those cases
+		// (= differing isRightToLeft()).
+		// ArabTeX, though, doesn't seem to handle this special behavior.
+		bool const inRLSwitch = 
+				basefont.isRightToLeft() != running_font.isRightToLeft()
+				&& basefont.language()->lang() != "arabic_arabtex"
+				&& running_font.language()->lang() != "arabic_arabtex";
+		// Having said that, PassThru insets must be inside a font change command,
+		// as we do not re-open the font inside. So:
+		bool const closeLanguage = !inset->isPassThru() && !inRLSwitch;
 		bool lang_closed = false;
 		bool lang_switched_at_inset = false;
 		// Close language if needed

commit ef11fdc77dc617ec8059216f745fd51ad4c527f2
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Fri Aug 14 09:08:46 2020 +0200

    Assure language is properly closed before non-inheriting inset.

diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index 62265bb..e066d2b 100644
--- a/src/Paragraph.cpp
+++ b/src/Paragraph.cpp
@@ -1027,43 +1027,66 @@ void Paragraph::Private::latexInset(BufferParams const & bparams,
 		close = true;
 	}
 
-	// Some insets cannot be inside a font change command.
-	// However, even such insets *can* be placed in \L or \R
-	// or their equivalents (for RTL language switches), so we don't
-	// close the language in those cases.
-	// ArabTeX, though, cannot handle this special behavior, it seems.
-	bool arabtex = basefont.language()->lang() == "arabic_arabtex"
-		|| running_font.language()->lang() == "arabic_arabtex";
 	if (open_font && (!inset->inheritFont() || inset->allowMultiPar())) {
+		// Some insets cannot be inside a font change command.
+		// However, even such insets *can* be placed in \L or \R
+		// or their equivalents (for RTL language switches), so we don't
+		// close the language in those cases.
+		// ArabTeX, though, cannot handle this special behavior, it seems.
+		bool arabtex = basefont.language()->lang() == "arabic_arabtex"
+			|| running_font.language()->lang() == "arabic_arabtex";
 		bool closeLanguage = arabtex
 			|| basefont.isRightToLeft() == running_font.isRightToLeft();
+		bool lang_closed = false;
+		bool lang_switched_at_inset = false;
+		// Close language if needed
+		if (closeLanguage) {
+			// We need prev_font here as language changes directly at inset
+			// will only be started inside the inset.
+			Font const prev_font = (i > 0) ?
+						owner_->getFont(bparams, i - 1, outerfont)
+					      : running_font;
+			Font tmpfont(basefont);
+			tmpfont.setLanguage(prev_font.language());
+			bool needPar = false;
+			unsigned int count = tmpfont.latexWriteEndChanges(os, bparams, runparams,
+									  basefont, basefont,
+									  needPar, closeLanguage);
+			column += count;
+			lang_closed = count > 0;
+			lang_switched_at_inset = prev_font.language() != running_font.language();
+		}
+		// Now re-do font changes in a way needed here
+		// (using switches with multi-par insets)
 		InsetText const * textinset = inset->asInsetText();
 		bool const cprotect = textinset
 			? textinset->hasCProtectContent(runparams.moving_arg)
 			  && !textinset->text().isMainText()
 			: false;
-		unsigned int count = running_font.latexWriteStartChanges(os, bparams,
+		unsigned int count2 = running_font.latexWriteStartChanges(os, bparams,
 						      runparams, basefont,
 						      running_font, true,
 						      cprotect);
-		column += count;
-		// if any font properties were closed, update the running_font,
-		// making sure, however, to leave the language as it was
-		if (count > 0) {
-			// FIXME: probably a better way to keep track of the old
-			// language, than copying the entire font?
-			Font const copy_font(running_font);
-			basefont = owner_->getLayoutFont(bparams, outerfont);
-			running_font = basefont;
-			if (!closeLanguage)
-				running_font.setLanguage(copy_font.language());
-			// For these, we use switches, so no need to close
-			basefont.fontInfo().setSize(copy_font.fontInfo().size());
-			basefont.fontInfo().setFamily(copy_font.fontInfo().family());
-			basefont.fontInfo().setSeries(copy_font.fontInfo().series());
-			if (closeLanguage)
-				runparams.local_font = &basefont;
-		}
+		column += count2;
+		// Update the running_font, making sure, however,
+		// to leave the language as it was.
+		// FIXME: probably a better way to keep track of the old
+		// language, than copying the entire font?
+		Font const copy_font(running_font);
+		basefont = owner_->getLayoutFont(bparams, outerfont);
+		running_font = basefont;
+		if (!closeLanguage)
+			running_font.setLanguage(copy_font.language());
+		// For these, we use switches, so they should be taken as
+		// base inside the inset.
+		basefont.fontInfo().setSize(copy_font.fontInfo().size());
+		basefont.fontInfo().setFamily(copy_font.fontInfo().family());
+		basefont.fontInfo().setSeries(copy_font.fontInfo().series());
+		if (count2 == 0 && (lang_closed || lang_switched_at_inset))
+			// All fonts closed
+			open_font = false;
+		if (closeLanguage)
+			runparams.local_font = &basefont;
 	}
 
 	size_t const previous_row_count = os.texrow().rows();

commit 8bc76ad9bbdef6aada4843aafae0d6a6ed834ed8
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Fri Aug 14 09:00:48 2020 +0200

    \foreignlanguage does not play with \cprotect.

diff --git a/src/Font.cpp b/src/Font.cpp
index a8c8275..327bc18 100644
--- a/src/Font.cpp
+++ b/src/Font.cpp
@@ -310,10 +310,6 @@ int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
 			string const tmp =
 				subst(lyxrc.language_command_local,
 				      "$$lang", language()->babel());
-			if (needs_cprotection && !prefixIs(tmp, "\\begin{")) {
-				os << "\\cprotect";
-				count += 9;
-			}
 			os << from_ascii(tmp);
 			count += tmp.length();
 			if (!lyxrc.language_command_end.empty())

commit c9bf17901606cccb43d1b73d53059137324994f6
Author: Daniel Ramoeller <d.lyx at web.de>
Date:   Thu Aug 13 20:33:02 2020 +0200

    #10346 Amend change 01b2893f8b switch directory buttons

diff --git a/src/frontends/qt/ui/AboutUi.ui b/src/frontends/qt/ui/AboutUi.ui
index 7f38644..fd07468 100644
--- a/src/frontends/qt/ui/AboutUi.ui
+++ b/src/frontends/qt/ui/AboutUi.ui
@@ -95,22 +95,6 @@
           <string>Library directory</string>
          </property>
          <layout class="QGridLayout" name="gridLayout_3">
-          <item row="0" column="1">
-           <widget class="QPushButton" name="showDirUserPB">
-            <property name="sizePolicy">
-             <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
-              <horstretch>0</horstretch>
-              <verstretch>0</verstretch>
-             </sizepolicy>
-            </property>
-            <property name="text">
-             <string>Open</string>
-            </property>
-            <property name="flat">
-             <bool>false</bool>
-            </property>
-           </widget>
-          </item>
           <item row="0" column="0">
            <widget class="QLabel" name="dirLibraryLA">
             <property name="sizePolicy">
@@ -136,15 +120,6 @@
             </property>
            </widget>
           </item>
-         </layout>
-        </widget>
-       </item>
-       <item>
-        <widget class="QGroupBox" name="gridGroupBox1">
-         <property name="title">
-          <string>User directory</string>
-         </property>
-         <layout class="QGridLayout" name="gridLayout_4">
           <item row="0" column="1">
            <widget class="QPushButton" name="showDirLibraryPB">
             <property name="sizePolicy">
@@ -158,6 +133,15 @@
             </property>
            </widget>
           </item>
+         </layout>
+        </widget>
+       </item>
+       <item>
+        <widget class="QGroupBox" name="gridGroupBox1">
+         <property name="title">
+          <string>User directory</string>
+         </property>
+         <layout class="QGridLayout" name="gridLayout_4">
           <item row="0" column="0">
            <widget class="QLabel" name="dirUserLA">
             <property name="cursor">
@@ -177,6 +161,22 @@
             </property>
            </widget>
           </item>
+          <item row="0" column="1">
+           <widget class="QPushButton" name="showDirUserPB">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="text">
+             <string>Open</string>
+            </property>
+            <property name="flat">
+             <bool>false</bool>
+            </property>
+           </widget>
+          </item>
          </layout>
         </widget>
        </item>

commit 63fcb7b8e19432973e10ad4e253fbe9d59d8e3af
Author: Stephan Witt <switt at lyx.org>
Date:   Thu Aug 13 10:26:44 2020 +0200

    #10346 Amend change 01b2893f8b to make Qt4 compilable - again

diff --git a/src/frontends/qt/qt_helpers.cpp b/src/frontends/qt/qt_helpers.cpp
index 8225b91..9d44c3f 100644
--- a/src/frontends/qt/qt_helpers.cpp
+++ b/src/frontends/qt/qt_helpers.cpp
@@ -47,6 +47,7 @@
 #include <QTextLayout>
 #include <QTextDocument>
 #include <QToolTip>
+#include <QUrl>
 
 #include <algorithm>
 #include <fstream>

commit 4ddff8fe284ea12a085445da15ea99899664fd86
Author: Stephan Witt <switt at lyx.org>
Date:   Thu Aug 13 08:12:56 2020 +0200

    #10346 Amend change 01b2893f8b to make Qt4 compilable

diff --git a/src/frontends/qt/GuiAbout.cpp b/src/frontends/qt/GuiAbout.cpp
index 25c3a68..3c874df 100644
--- a/src/frontends/qt/GuiAbout.cpp
+++ b/src/frontends/qt/GuiAbout.cpp
@@ -274,8 +274,7 @@ void GuiAbout::on_showDirUserPB_clicked()
 
 void GuiAbout::on_versionCopyPB_clicked()
 {
-	QClipboard *clipboard = QGuiApplication::clipboard();
-	clipboard->setText(version());
+	qApp->clipboard()->setText(version());
 }
 
 

commit 01b2893f8beef6a9716195ee5e7b42c75e135fae
Author: Daniel Ramoeller <d.lyx at web.de>
Date:   Wed Aug 12 14:24:40 2020 -0400

    Fix bug #10346.
    
    Allow to open user and library directories from About LyX.

diff --git a/src/frontends/qt/GuiAbout.cpp b/src/frontends/qt/GuiAbout.cpp
index a641e9a..25c3a68 100644
--- a/src/frontends/qt/GuiAbout.cpp
+++ b/src/frontends/qt/GuiAbout.cpp
@@ -11,6 +11,7 @@
 #include <config.h>
 
 #include "GuiAbout.h"
+#include "GuiApplication.h"
 
 #include "ui_AboutUi.h"
 
@@ -22,6 +23,7 @@
 #include "support/lstrings.h"
 #include "support/Package.h"
 
+#include <QClipboard>
 #include <QDate>
 #include <QFile>
 #include <QTextStream>
@@ -196,6 +198,33 @@ static QString disclaimer()
 }
 
 
+static QString buildinfo()
+{
+	QString res;
+	QTextStream out(&res);
+	out << "LyX " << lyx_version
+		<< " (" << lyx_release_date << ")" << endl;
+	if (std::string(lyx_git_commit_hash) != "none")
+		out << qt_("  Git commit hash ")
+		    << QString(lyx_git_commit_hash).left(8) << endl;
+
+	out << lyx_version_info << endl;
+	return res;
+}
+
+
+static QString dirLibrary()
+{
+	return toqstr(makeDisplayPath(package().system_support().absFileName()));
+}
+
+
+static QString dirUser()
+{
+	return toqstr(makeDisplayPath(package().user_support().absFileName()));
+}
+
+
 static QString version()
 {
 	QString loc_release_date;
@@ -216,41 +245,38 @@ static QString version()
 	if (std::string(lyx_git_commit_hash) != "none")
 		version_date += _("Built from git commit hash ")
 			+ from_utf8(lyx_git_commit_hash).substr(0,8);
-	version_date += "\n";
 
 	QString res;
 	QTextStream out(&res);
-	out << toqstr(version_date);
-	out << qt_("Library directory: ");
-	out << toqstr(makeDisplayPath(package().system_support().absFileName()));
-	out << "\n";
-	out << qt_("User directory: ");
-	out << toqstr(makeDisplayPath(package().user_support().absFileName()));
-	out << "\n";
+	out << toqstr(version_date) << "\n";
 	out << toqstr(bformat(_("Qt Version (run-time): %1$s"), from_ascii(qVersion()))) << "\n";
-	out << toqstr(bformat(_("Qt Version (compile-time): %1$s"), from_ascii(QT_VERSION_STR))) << "\n";
+	out << toqstr(bformat(_("Qt Version (compile-time): %1$s"), from_ascii(QT_VERSION_STR)));
 	return res;
 }
 
-static QString buildinfo()
+
+struct GuiAbout::Private
 {
-	QString res;
-	QTextStream out(&res);
-	out << "LyX " << lyx_version
-		<< " (" << lyx_release_date << ")" << endl;
-	if (std::string(lyx_git_commit_hash) != "none")
-		out << qt_("  Git commit hash ")
-		    << QString(lyx_git_commit_hash).left(8) << endl;
+	Ui::AboutUi ui;
+};
 
-	out << lyx_version_info << endl;
-	return res;
+void GuiAbout::on_showDirLibraryPB_clicked()
+{
+	showDirectory(package().system_support());
 }
 
 
-struct GuiAbout::Private
+void GuiAbout::on_showDirUserPB_clicked()
 {
-	Ui::AboutUi ui;
-};
+	showDirectory(package().user_support());
+}
+
+
+void GuiAbout::on_versionCopyPB_clicked()
+{
+	QClipboard *clipboard = QGuiApplication::clipboard();
+	clipboard->setText(version());
+}
 
 
 GuiAbout::GuiAbout(GuiView & lv)
@@ -259,6 +285,9 @@ GuiAbout::GuiAbout(GuiView & lv)
 {
 	d->ui.setupUi(this);
 
+	// fix height to minimum
+	setFixedHeight(sizeHint().height());
+
 	d->ui.copyrightTB->setPlainText(copyright());
 	d->ui.copyrightTB->append(QString());
 	d->ui.copyrightTB->append(license());
@@ -266,6 +295,8 @@ GuiAbout::GuiAbout(GuiView & lv)
 	d->ui.copyrightTB->append(disclaimer());
 
 	d->ui.versionLA->setText(version());
+	d->ui.dirLibraryLA->setText(dirLibrary());
+	d->ui.dirUserLA->setText(dirUser());
 	d->ui.buildinfoTB->setText(buildinfo());
 	d->ui.releasenotesTB->setHtml(release_notes());
 	d->ui.releasenotesTB->setOpenExternalLinks(true);
diff --git a/src/frontends/qt/GuiAbout.h b/src/frontends/qt/GuiAbout.h
index 200f0b7..acd485f 100644
--- a/src/frontends/qt/GuiAbout.h
+++ b/src/frontends/qt/GuiAbout.h
@@ -27,6 +27,9 @@ public:
 
 private Q_SLOTS:
 	void on_buttonBox_rejected();
+	void on_showDirLibraryPB_clicked();
+	void on_showDirUserPB_clicked();
+	void on_versionCopyPB_clicked();
 
 private:
 	/// Controller stuff
diff --git a/src/frontends/qt/GuiLog.cpp b/src/frontends/qt/GuiLog.cpp
index 341f06c..8682806 100644
--- a/src/frontends/qt/GuiLog.cpp
+++ b/src/frontends/qt/GuiLog.cpp
@@ -25,10 +25,8 @@
 #include "support/gettext.h"
 #include "support/lstrings.h"
 
-#include <QDesktopServices>
 #include <QTextBrowser>
 #include <QSyntaxHighlighter>
-#include <QUrl>
 #include <QClipboard>
 
 #include <fstream>
@@ -191,18 +189,8 @@ void GuiLog::on_nextWarningPB_clicked()
 
 
 void GuiLog::on_openDirPB_clicked()
-{
-	support::FileName dir = logfile_.onlyPath();
-	if (!dir.exists())
-		return;
-	QUrl qdir(QUrl::fromLocalFile(toqstr(from_utf8(dir.absFileName()))));
-	// Give hints in case of bugs
-	if (!qdir.isValid()) {
-		LYXERR0("QUrl is invalid!");
-		return;
-	}
-	if (!QDesktopServices::openUrl(qdir))
-		LYXERR0("Unable to open QUrl even though dir exists!");
+{	
+	showDirectory(logfile_.onlyPath());
 }
 
 
diff --git a/src/frontends/qt/qt_helpers.cpp b/src/frontends/qt/qt_helpers.cpp
index d3da0ee..8225b91 100644
--- a/src/frontends/qt/qt_helpers.cpp
+++ b/src/frontends/qt/qt_helpers.cpp
@@ -38,6 +38,8 @@
 #include <QApplication>
 #include <QCheckBox>
 #include <QComboBox>
+#include <QDesktopServices>
+#include <QDir>
 #include <QLineEdit>
 #include <QLocale>
 #include <QPalette>
@@ -275,6 +277,21 @@ void setSectionResizeMode(QHeaderView * view, QHeaderView::ResizeMode mode) {
 	view->setResizeMode(mode);
 #endif
 }
+
+void showDirectory(FileName const & directory)
+{
+	if (!directory.exists())
+		return;
+	QUrl qurl(QUrl::fromLocalFile(QDir::toNativeSeparators(toqstr(directory.absFileName()))));
+	// Give hints in case of bugs
+	if (!qurl.isValid()) {
+		LYXERR0("QUrl is invalid!");
+		return;
+
+	}
+	if (!QDesktopServices::openUrl(qurl))
+		LYXERR0("Unable to open QUrl even though dir exists!");
+}
 } // namespace frontend
 
 QString const qt_(char const * str, const char *)
diff --git a/src/frontends/qt/qt_helpers.h b/src/frontends/qt/qt_helpers.h
index 92872e0..970a027 100644
--- a/src/frontends/qt/qt_helpers.h
+++ b/src/frontends/qt/qt_helpers.h
@@ -99,6 +99,8 @@ void setSectionResizeMode(QHeaderView * view,
     int logicalIndex, QHeaderView::ResizeMode mode);
 void setSectionResizeMode(QHeaderView * view,
 	QHeaderView::ResizeMode mode);
+/// Shows a directory in OSs file browser
+void showDirectory(support::FileName const & directory);
 
 } // namespace frontend
 
diff --git a/src/frontends/qt/ui/AboutUi.ui b/src/frontends/qt/ui/AboutUi.ui
index a7eecc0..7f38644 100644
--- a/src/frontends/qt/ui/AboutUi.ui
+++ b/src/frontends/qt/ui/AboutUi.ui
@@ -7,7 +7,7 @@
     <x>0</x>
     <y>0</y>
     <width>424</width>
-    <height>258</height>
+    <height>370</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -46,37 +46,138 @@
         <number>6</number>
        </property>
        <property name="leftMargin">
-        <number>11</number>
+        <number>9</number>
        </property>
        <property name="topMargin">
-        <number>11</number>
+        <number>9</number>
        </property>
        <property name="rightMargin">
-        <number>11</number>
+        <number>9</number>
        </property>
        <property name="bottomMargin">
-        <number>11</number>
+        <number>9</number>
        </property>
        <item>
         <widget class="QLabel" name="versionLA">
-         <property name="frameShape">
-          <enum>QFrame::Box</enum>
-         </property>
-         <property name="frameShadow">
-          <enum>QFrame::Sunken</enum>
+         <property name="cursor">
+          <cursorShape>IBeamCursor</cursorShape>
          </property>
          <property name="text">
-          <string>Version goes here</string>
+          <string><html><head/><body><p>LyX version info goes here.</p><p>Qt version (run-time) goes here.</p><p>Qt version (compile-time) goes here.</p></body></html></string>
          </property>
          <property name="alignment">
           <set>Qt::AlignCenter</set>
          </property>
-         <property name="margin">
-          <number>6</number>
+         <property name="wordWrap">
+          <bool>true</bool>
          </property>
          <property name="textInteractionFlags">
-          <set>Qt::TextSelectableByMouse</set>
+          <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <spacer name="verticalSpacer">
+         <property name="orientation">
+          <enum>Qt::Vertical</enum>
          </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>20</width>
+           <height>40</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+       <item>
+        <widget class="QGroupBox" name="gridGroupBox">
+         <property name="title">
+          <string>Library directory</string>
+         </property>
+         <layout class="QGridLayout" name="gridLayout_3">
+          <item row="0" column="1">
+           <widget class="QPushButton" name="showDirUserPB">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="text">
+             <string>Open</string>
+            </property>
+            <property name="flat">
+             <bool>false</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="0" column="0">
+           <widget class="QLabel" name="dirLibraryLA">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="cursor">
+             <cursorShape>IBeamCursor</cursorShape>
+            </property>
+            <property name="text">
+             <string>Library directory goes here.</string>
+            </property>
+            <property name="textFormat">
+             <enum>Qt::PlainText</enum>
+            </property>
+            <property name="wordWrap">
+             <bool>true</bool>
+            </property>
+            <property name="textInteractionFlags">
+             <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
+            </property>
+           </widget>
+          </item>
+         </layout>
+        </widget>
+       </item>
+       <item>
+        <widget class="QGroupBox" name="gridGroupBox1">
+         <property name="title">
+          <string>User directory</string>
+         </property>
+         <layout class="QGridLayout" name="gridLayout_4">
+          <item row="0" column="1">
+           <widget class="QPushButton" name="showDirLibraryPB">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="text">
+             <string>Open</string>
+            </property>
+           </widget>
+          </item>
+          <item row="0" column="0">
+           <widget class="QLabel" name="dirUserLA">
+            <property name="cursor">
+             <cursorShape>IBeamCursor</cursorShape>
+            </property>
+            <property name="text">
+             <string>User directory goes here.</string>
+            </property>
+            <property name="textFormat">
+             <enum>Qt::PlainText</enum>
+            </property>
+            <property name="wordWrap">
+             <bool>true</bool>
+            </property>
+            <property name="textInteractionFlags">
+             <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
+            </property>
+           </widget>
+          </item>
+         </layout>
         </widget>
        </item>
       </layout>
@@ -161,6 +262,21 @@
        <string>Release Notes</string>
       </attribute>
       <layout class="QGridLayout">
+       <property name="leftMargin">
+        <number>9</number>
+       </property>
+       <property name="topMargin">
+        <number>9</number>
+       </property>
+       <property name="rightMargin">
+        <number>9</number>
+       </property>
+       <property name="bottomMargin">
+        <number>9</number>
+       </property>
+       <property name="spacing">
+        <number>6</number>
+       </property>
        <item row="0" column="0">
         <widget class="QTextBrowser" name="releasenotesTB"/>
        </item>
@@ -186,6 +302,13 @@
       <number>0</number>
      </property>
      <item>
+      <widget class="QPushButton" name="versionCopyPB">
+       <property name="text">
+        <string>Copy Version Info</string>
+       </property>
+      </widget>
+     </item>
+     <item>
       <widget class="QDialogButtonBox" name="buttonBox">
        <property name="standardButtons">
         <set>QDialogButtonBox::Close</set>

commit 13b928d53472d6f7171177e1315e3f65659bde6a
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Wed Aug 12 18:08:49 2020 +0200

    No need for catcode change here

diff --git a/src/Font.cpp b/src/Font.cpp
index 112b51c..a8c8275 100644
--- a/src/Font.cpp
+++ b/src/Font.cpp
@@ -239,12 +239,8 @@ int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
 	    && language() != prev.language()) {
 		if (!language()->polyglossia().empty()) {
 			string tmp;
-			if (needs_cprotection) {
-				if (contains(runparams.active_chars, '^'))
-					// cprotect relies on ^ being on catcode 7
-					tmp += "\\begingroup\\catcode`\\^=7";
+			if (needs_cprotection)
 				tmp += "\\cprotect";
-			}
 			tmp += "\\text" + language()->polyglossia();
 			if (!language()->polyglossiaOpts().empty()) {
 				tmp += "[" + language()->polyglossiaOpts() + "]";
@@ -252,12 +248,8 @@ int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
 					// We need to strip the command for
 					// the pdf string, see #11813
 					string tmpp;
-					if (needs_cprotection) {
-						if (contains(runparams.active_chars, '^'))
-							// cprotect relies on ^ being on catcode 7
-							os << "\\begingroup\\catcode`\\^=7";
+					if (needs_cprotection)
 						tmpp = "\\cprotect";
-					}
 					tmp = tmpp + "\\texorpdfstring{" + tmp + "}{}";
 				}
 			}
@@ -273,9 +265,6 @@ int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
 	    language() != prev.language()) {
 		if (language()->lang() == "farsi") {
 			if (needs_cprotection) {
-				if (contains(runparams.active_chars, '^'))
-					// cprotect relies on ^ being on catcode 7
-					os << "\\begingroup\\catcode`\\^=7";
 				os << "\\cprotect";
 				count += 9;
 			}
@@ -284,9 +273,6 @@ int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
 		} else if (!isRightToLeft() &&
 			    base.language()->lang() == "farsi") {
 			if (needs_cprotection) {
-				if (contains(runparams.active_chars, '^'))
-					// cprotect relies on ^ being on catcode 7
-					os << "\\begingroup\\catcode`\\^=7";
 				os << "\\cprotect";
 				count += 9;
 			}
@@ -294,9 +280,6 @@ int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
 			count += 8;
 		} else if (language()->lang() == "arabic_arabi") {
 			if (needs_cprotection) {
-				if (contains(runparams.active_chars, '^'))
-					// cprotect relies on ^ being on catcode 7
-					os << "\\begingroup\\catcode`\\^=7";
 				os << "\\cprotect";
 				count += 9;
 			}
@@ -305,9 +288,6 @@ int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
  		} else if (!isRightToLeft() &&
 				base.language()->lang() == "arabic_arabi") {
 			if (needs_cprotection) {
-				if (contains(runparams.active_chars, '^'))
-					// cprotect relies on ^ being on catcode 7
-					os << "\\begingroup\\catcode`\\^=7";
 				os << "\\cprotect";
 				count += 9;
 			}
@@ -316,9 +296,6 @@ int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
 		// currently the remaining RTL languages are arabic_arabtex and hebrew
 		} else if (isRightToLeft() != prev.isRightToLeft()) {
 			if (needs_cprotection) {
-				if (contains(runparams.active_chars, '^'))
-					// cprotect relies on ^ being on catcode 7
-					os << "\\begingroup\\catcode`\\^=7";
 				os << "\\cprotect";
 				count += 9;
 			}
@@ -334,9 +311,6 @@ int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
 				subst(lyxrc.language_command_local,
 				      "$$lang", language()->babel());
 			if (needs_cprotection && !prefixIs(tmp, "\\begin{")) {
-				if (contains(runparams.active_chars, '^'))
-					// cprotect relies on ^ being on catcode 7
-					os << "\\begingroup\\catcode`\\^=7";
 				os << "\\cprotect";
 				count += 9;
 			}
@@ -380,9 +354,6 @@ int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
 			count += strlen(LaTeXFamilySwitchNames[f.family()]) + 1;
 		} else {
 			if (needs_cprotection) {
-				if (contains(runparams.active_chars, '^'))
-					// cprotect relies on ^ being on catcode 7
-					os << "\\begingroup\\catcode`\\^=7";
 				os << "\\cprotect";
 				count += 9;
 			}
@@ -400,9 +371,6 @@ int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
 			count += strlen(LaTeXSeriesSwitchNames[f.series()]) + 1;
 		} else {
 			if (needs_cprotection) {
-				if (contains(runparams.active_chars, '^'))
-					// cprotect relies on ^ being on catcode 7
-					os << "\\begingroup\\catcode`\\^=7";
 				os << "\\cprotect";
 				count += 9;
 			}
@@ -420,9 +388,6 @@ int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
 			count += strlen(LaTeXShapeSwitchNames[f.shape()]) + 1;
 		} else {
 			if (needs_cprotection) {
-				if (contains(runparams.active_chars, '^'))
-					// cprotect relies on ^ being on catcode 7
-					os << "\\begingroup\\catcode`\\^=7";
 				os << "\\cprotect";
 				count += 9;
 			}
@@ -439,9 +404,6 @@ int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
 			++count;
 		} else if (f.color() != Color_none) {
 			if (needs_cprotection) {
-				if (contains(runparams.active_chars, '^'))
-					// cprotect relies on ^ being on catcode 7
-					os << "\\begingroup\\catcode`\\^=7";
 				os << "\\cprotect";
 				count += 9;
 			}
@@ -483,9 +445,6 @@ int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
 	}
 	if (f.emph() == FONT_ON) {
 		if (needs_cprotection) {
-			if (contains(runparams.active_chars, '^'))
-				// cprotect relies on ^ being on catcode 7
-				os << "\\begingroup\\catcode`\\^=7";
 			os << "\\cprotect";
 			count += 9;
 		}
@@ -495,9 +454,6 @@ int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
 	// \noun{} is a LyX special macro
 	if (f.noun() == FONT_ON) {
 		if (needs_cprotection) {
-			if (contains(runparams.active_chars, '^'))
-				// cprotect relies on ^ being on catcode 7
-				os << "\\begingroup\\catcode`\\^=7";
 			os << "\\cprotect";
 			count += 9;
 		}
@@ -509,9 +465,6 @@ int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
 	// which prevents linebreaks (#8424, #8733)
 	if (f.underbar() == FONT_ON) {
 		if (needs_cprotection) {
-			if (contains(runparams.active_chars, '^'))
-				// cprotect relies on ^ being on catcode 7
-				os << "\\begingroup\\catcode`\\^=7";
 			os << "\\cprotect";
 			count += 9;
 		}
@@ -521,9 +474,6 @@ int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
 	}
 	if (f.uuline() == FONT_ON) {
 		if (needs_cprotection) {
-			if (contains(runparams.active_chars, '^'))
-				// cprotect relies on ^ being on catcode 7
-				os << "\\begingroup\\catcode`\\^=7";
 			os << "\\cprotect";
 			count += 9;
 		}
@@ -533,9 +483,6 @@ int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
 	}
 	if (f.strikeout() == FONT_ON) {
 		if (needs_cprotection) {
-			if (contains(runparams.active_chars, '^'))
-				// cprotect relies on ^ being on catcode 7
-				os << "\\begingroup\\catcode`\\^=7";
 			os << "\\cprotect";
 			count += 9;
 		}
@@ -545,9 +492,6 @@ int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
 	}
 	if (f.xout() == FONT_ON) {
 		if (needs_cprotection) {
-			if (contains(runparams.active_chars, '^'))
-				// cprotect relies on ^ being on catcode 7
-				os << "\\begingroup\\catcode`\\^=7";
 			os << "\\cprotect";
 			count += 9;
 		}
@@ -563,9 +507,6 @@ int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
 			count += 15;
 		}
 		if (needs_cprotection) {
-			if (contains(runparams.active_chars, '^'))
-				// cprotect relies on ^ being on catcode 7
-				os << "\\begingroup\\catcode`\\^=7";
 			os << "\\cprotect";
 			count += 9;
 		}

commit 24c46cbd1955326b5160cfcf7abdf2c9a540b6d9
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Wed Aug 12 17:38:57 2020 +0200

    Remove obsolete FIXME

diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index 8edf2ea..62265bb 100644
--- a/src/Paragraph.cpp
+++ b/src/Paragraph.cpp
@@ -1027,11 +1027,6 @@ void Paragraph::Private::latexInset(BufferParams const & bparams,
 		close = true;
 	}
 
-	// FIXME: Bug: we can have an empty font change here!
-	// if there has just been a font change, we are going to close it
-	// right now, which means stupid latex code like \textsf{}. AFAIK,
-	// this does not harm dvi output. A minor bug, thus (JMarc)
-
 	// Some insets cannot be inside a font change command.
 	// However, even such insets *can* be placed in \L or \R
 	// or their equivalents (for RTL language switches), so we don't

commit e3a72156f9eb670006e1e7fb64172d586dfedf32
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Wed Aug 12 17:38:20 2020 +0200

    Fix too general application of \cprotect

diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index 3a9b034..8edf2ea 100644
--- a/src/Paragraph.cpp
+++ b/src/Paragraph.cpp
@@ -1042,10 +1042,15 @@ void Paragraph::Private::latexInset(BufferParams const & bparams,
 	if (open_font && (!inset->inheritFont() || inset->allowMultiPar())) {
 		bool closeLanguage = arabtex
 			|| basefont.isRightToLeft() == running_font.isRightToLeft();
+		InsetText const * textinset = inset->asInsetText();
+		bool const cprotect = textinset
+			? textinset->hasCProtectContent(runparams.moving_arg)
+			  && !textinset->text().isMainText()
+			: false;
 		unsigned int count = running_font.latexWriteStartChanges(os, bparams,
 						      runparams, basefont,
 						      running_font, true,
-						      owner_->needsCProtection(runparams.moving_arg));
+						      cprotect);
 		column += count;
 		// if any font properties were closed, update the running_font,
 		// making sure, however, to leave the language as it was
@@ -2659,9 +2664,14 @@ void Paragraph::latex(BufferParams const & bparams,
 			}
 			otexstringstream ots;
 			if (!multipar_inset) {
+				InsetText const * textinset = inInset().asInsetText();
+				bool const cprotect = textinset
+					? textinset->hasCProtectContent(runparams.moving_arg)
+					  && !textinset->text().isMainText()
+					: false;
 				column += current_font.latexWriteStartChanges(ots, bparams,
 									      runparams, basefont, last_font, false,
-									      needsCProtection(runparams.moving_arg));
+									      cprotect);
 			}
 			// Check again for display math in ulem commands as a
 			// font change may also occur just before a math inset.

commit 001f5a47861f04c985323677dfd17ef15b8c33a7
Author: Enrico Forestieri <forenr at lyx.org>
Date:   Wed Aug 12 16:35:12 2020 +0200

    Fix bug #10263

diff --git a/src/insets/InsetFoot.h b/src/insets/InsetFoot.h
index e938927..bbc8a69 100644
--- a/src/insets/InsetFoot.h
+++ b/src/insets/InsetFoot.h
@@ -45,6 +45,10 @@ private:
 	///
 	Inset * clone() const { return new InsetFoot(*this); }
 	///
+	bool inheritFont() const { return true; }
+	///
+	bool allowMultiPar() const { return true; }
+	///
 	docstring custom_label_;
 	///
 	bool intitle_;

commit f5672a4843eb6b85e61167d0ebd338234346c246
Author: Enrico Forestieri <forenr at lyx.org>
Date:   Wed Aug 12 16:25:35 2020 +0200

    Switch font for multipar insets
    
    Use font switches for insets that allow paragraph breaks rather
    than insets that do not inherit outer font settings. No change of
    behavior is intended with respect to the current status, but this
    will allow a simple and effective fix for #10263.

diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index 58feaf4..3a9b034 100644
--- a/src/Paragraph.cpp
+++ b/src/Paragraph.cpp
@@ -1039,7 +1039,7 @@ void Paragraph::Private::latexInset(BufferParams const & bparams,
 	// ArabTeX, though, cannot handle this special behavior, it seems.
 	bool arabtex = basefont.language()->lang() == "arabic_arabtex"
 		|| running_font.language()->lang() == "arabic_arabtex";
-	if (open_font && !inset->inheritFont()) {
+	if (open_font && (!inset->inheritFont() || inset->allowMultiPar())) {
 		bool closeLanguage = arabtex
 			|| basefont.isRightToLeft() == running_font.isRightToLeft();
 		unsigned int count = running_font.latexWriteStartChanges(os, bparams,
@@ -2563,14 +2563,14 @@ void Paragraph::latex(BufferParams const & bparams,
 					     && runningChange == change
 					     && change.type == Change::DELETED
 					     && !os.afterParbreak());
-		bool const non_inherit_inset =
-				(c == META_INSET && getInset(i) && !getInset(i)->inheritFont());
+		bool const multipar_inset =
+			(c == META_INSET && getInset(i) && getInset(i)->allowMultiPar());
 
 		// Do we need to close the previous font?
 		if (open_font &&
 		    ((current_font != running_font
 		      || current_font.language() != running_font.language())
-		     || (non_inherit_inset
+		     || (multipar_inset
 			 && (current_font == prev_font
 			     || current_font.language() == prev_font.language()))))
 		{
@@ -2658,7 +2658,7 @@ void Paragraph::latex(BufferParams const & bparams,
 				column += 1;
 			}
 			otexstringstream ots;
-			if (!non_inherit_inset) {
+			if (!multipar_inset) {
 				column += current_font.latexWriteStartChanges(ots, bparams,
 									      runparams, basefont, last_font, false,
 									      needsCProtection(runparams.moving_arg));
@@ -2754,13 +2754,13 @@ void Paragraph::latex(BufferParams const & bparams,
 					}
 				}
 				// We need to restore these after insets with
-				// inheritFont() false
+				// allowMultiPar() true
 				Font const save_running_font = running_font;
 				Font const save_basefont = basefont;
 				d->latexInset(bparams, os, rp, running_font,
 						basefont, real_outerfont, open_font,
 						runningChange, style, i, column);
-				if (non_inherit_inset) {
+				if (multipar_inset) {
 					running_font = save_running_font;
 					basefont = save_basefont;
 				}
diff --git a/src/insets/Inset.h b/src/insets/Inset.h
index 4ef73db..922d1cd 100644
--- a/src/insets/Inset.h
+++ b/src/insets/Inset.h
@@ -592,6 +592,8 @@ public:
 	virtual bool asciiOnly() const { return false; }
 	/// returns whether this inset is allowed in other insets of given mode
 	virtual bool allowedIn(mode_type) const { return true; }
+	/// returns whether paragraph breaks can occur inside this inset
+	virtual bool allowMultiPar() const  { return false; }
 	/**
 	 * The font is inherited from the parent for LaTeX export if this
 	 * method returns true. No open font changes are closed in front of
diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp
index b449ab3..8458ce4 100644
--- a/src/insets/InsetTabular.cpp
+++ b/src/insets/InsetTabular.cpp
@@ -4366,6 +4366,18 @@ bool InsetTabular::insetAllowed(InsetCode code) const
 }
 
 
+bool InsetTabular::allowMultiPar() const
+{
+	for (Tabular::col_type c = 0; c < tabular.ncols(); ++c) {
+		for (Tabular::row_type r = 0; r < tabular.nrows(); ++r) {
+			if (tabular.cellInset(r,c)->allowMultiPar())
+				return true;
+		}
+	}
+	return false;
+}
+
+
 bool InsetTabular::allowsCaptionVariation(std::string const & newtype) const
 {
 	return tabular.is_long_tabular &&
diff --git a/src/insets/InsetTabular.h b/src/insets/InsetTabular.h
index 028da97..fd94204 100644
--- a/src/insets/InsetTabular.h
+++ b/src/insets/InsetTabular.h
@@ -83,6 +83,8 @@ public:
 	void metrics(MetricsInfo &, Dimension &) const;
 	/// Needs to be same as InsetTabular
 	bool inheritFont() const { return false; }
+	/// Can the cell contain several paragraphs?
+	bool allowMultiPar() const { return !isMultiRow && (!isMultiColumn || isFixedWidth); }
 private:
 	/// unimplemented
 	InsetTableCell();
@@ -135,8 +137,6 @@ private:
 	virtual bool forceLocalFontSwitch() const;
 	/// Is the width forced to some value?
 	bool hasFixedWidth() const { return isFixedWidth; }
-	/// Can the cell contain several paragraphs?
-	bool allowMultiPar() const { return !isMultiRow && (!isMultiColumn || isFixedWidth); }
 };
 
 
@@ -979,6 +979,8 @@ public:
 	    insets that may contain several paragraphs */
 	bool inheritFont() const { return false; }
 	///
+	bool allowMultiPar() const;
+	///
 	bool allowsCaptionVariation(std::string const &) const;
 	//
 	bool isTable() const { return true; }
diff --git a/src/insets/InsetText.h b/src/insets/InsetText.h
index d86bfb7..ca09a68 100644
--- a/src/insets/InsetText.h
+++ b/src/insets/InsetText.h
@@ -161,7 +161,7 @@ public:
 	///
 	virtual bool isMacroScope() const { return false; }
 	///
-	virtual bool allowMultiPar() const { return getLayout().isMultiPar(); }
+	bool allowMultiPar() const { return getLayout().isMultiPar(); }
 	///
 	bool isInTitle() const { return intitle_context_; }
 	///

commit f348e0edc5583fb0366d220de8d0525158858139
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Wed Aug 12 15:27:21 2020 +0200

    Fix emphasizing

diff --git a/lib/doc/de/Customization.lyx b/lib/doc/de/Customization.lyx
index 09778ed..e0aa3ec 100644
--- a/lib/doc/de/Customization.lyx
+++ b/lib/doc/de/Customization.lyx
@@ -1,5 +1,5 @@
 #LyX 2.4 created this file. For more info see https://www.lyx.org/
-\lyxformat 587
+\lyxformat 598
 \begin_document
 \begin_header
 \save_transient_properties true
@@ -49,7 +49,7 @@
 \begin_modules
 logicalmkup
 \end_modules
-\maintain_unincluded_children false
+\maintain_unincluded_children no
 \language ngerman
 \language_package default
 \inputencoding utf8
@@ -138,9 +138,12 @@ logicalmkup
 \tablestyle default
 \tracking_changes false
 \output_changes false
+\change_bars false
+\postpone_fragile_content false
 \html_math_output 0
 \html_css_as_file 0
 \html_be_strict false
+\docbook_table_output 0
 \end_header
 
 \begin_body
@@ -2421,23 +2424,21 @@ Bearbeiten Sie
 xx.po
 \family default
 .
-\family typewriter
-
 \begin_inset Foot
-status collapsed
+status open
 
 \begin_layout Plain Layout
 Für diese Aufgabe gibt es spezielle Programme, wie 
-\family typewriter
+\family sans
 Poedit
 \family default
  (für alle Plattformen) oder 
-\family typewriter
+\family sans
 KBabel
 \family default
  (für KDE).
  
-\family typewriter
+\family sans
 Emacs
 \family default
  hat ebenfalls einen Modus, der Sie bei dieser Arbeit unterstützt, siehe
@@ -2457,8 +2458,6 @@ https://www.gnu.org/software/gettext/manual/html_node/PO-Mode.html#PO-Mode
 
 \end_inset
 
-
-\family default
  Für einige Menüeinträge und Dialogelemente gibt es Tastenkürzel, die ebenfalls
  angepasst werden sollten.
  Diese Kürzel werden mit '

commit 49e8e3567c72b86b02a89f025fb492790e50dd97
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Wed Aug 12 15:26:23 2020 +0200

    Font switches in \cprotect'ed context need to be \cprotect'ed themselves

diff --git a/src/Font.cpp b/src/Font.cpp
index 74ff2de..112b51c 100644
--- a/src/Font.cpp
+++ b/src/Font.cpp
@@ -228,7 +228,8 @@ int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
 				    OutputParams const & runparams,
 				    Font const & base,
 				    Font const & prev,
-				    bool const & non_inherit_inset) const
+				    bool const & non_inherit_inset,
+				    bool const & needs_cprotection) const
 {
 	int count = 0;
 
@@ -237,13 +238,28 @@ int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
 	    && language()->lang() != base.language()->lang()
 	    && language() != prev.language()) {
 		if (!language()->polyglossia().empty()) {
-			string tmp = "\\text" + language()->polyglossia();
+			string tmp;
+			if (needs_cprotection) {
+				if (contains(runparams.active_chars, '^'))
+					// cprotect relies on ^ being on catcode 7
+					tmp += "\\begingroup\\catcode`\\^=7";
+				tmp += "\\cprotect";
+			}
+			tmp += "\\text" + language()->polyglossia();
 			if (!language()->polyglossiaOpts().empty()) {
 				tmp += "[" + language()->polyglossiaOpts() + "]";
-				if (runparams.use_hyperref && runparams.moving_arg)
+				if (runparams.use_hyperref && runparams.moving_arg) {
 					// We need to strip the command for
 					// the pdf string, see #11813
-					tmp = "\\texorpdfstring{" + tmp + "}{}";
+					string tmpp;
+					if (needs_cprotection) {
+						if (contains(runparams.active_chars, '^'))
+							// cprotect relies on ^ being on catcode 7
+							os << "\\begingroup\\catcode`\\^=7";
+						tmpp = "\\cprotect";
+					}
+					tmp = tmpp + "\\texorpdfstring{" + tmp + "}{}";
+				}
 			}
 			tmp += "{";
 			os << from_ascii(tmp);
@@ -256,21 +272,56 @@ int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
 	} else if (language()->babel() != base.language()->babel() &&
 	    language() != prev.language()) {
 		if (language()->lang() == "farsi") {
+			if (needs_cprotection) {
+				if (contains(runparams.active_chars, '^'))
+					// cprotect relies on ^ being on catcode 7
+					os << "\\begingroup\\catcode`\\^=7";
+				os << "\\cprotect";
+				count += 9;
+			}
 			os << "\\textFR{";
 			count += 8;
 		} else if (!isRightToLeft() &&
 			    base.language()->lang() == "farsi") {
+			if (needs_cprotection) {
+				if (contains(runparams.active_chars, '^'))
+					// cprotect relies on ^ being on catcode 7
+					os << "\\begingroup\\catcode`\\^=7";
+				os << "\\cprotect";
+				count += 9;
+			}
 			os << "\\textLR{";
 			count += 8;
 		} else if (language()->lang() == "arabic_arabi") {
+			if (needs_cprotection) {
+				if (contains(runparams.active_chars, '^'))
+					// cprotect relies on ^ being on catcode 7
+					os << "\\begingroup\\catcode`\\^=7";
+				os << "\\cprotect";
+				count += 9;
+			}
 			os << "\\textAR{";
 			count += 8;
  		} else if (!isRightToLeft() &&
 				base.language()->lang() == "arabic_arabi") {
+			if (needs_cprotection) {
+				if (contains(runparams.active_chars, '^'))
+					// cprotect relies on ^ being on catcode 7
+					os << "\\begingroup\\catcode`\\^=7";
+				os << "\\cprotect";
+				count += 9;
+			}
 			os << "\\textLR{";
 			count += 8;
 		// currently the remaining RTL languages are arabic_arabtex and hebrew
 		} else if (isRightToLeft() != prev.isRightToLeft()) {
+			if (needs_cprotection) {
+				if (contains(runparams.active_chars, '^'))
+					// cprotect relies on ^ being on catcode 7
+					os << "\\begingroup\\catcode`\\^=7";
+				os << "\\cprotect";
+				count += 9;
+			}
 			if (isRightToLeft()) {
 				os << "\\R{";
 				count += 3;
@@ -282,6 +333,13 @@ int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
 			string const tmp =
 				subst(lyxrc.language_command_local,
 				      "$$lang", language()->babel());
+			if (needs_cprotection && !prefixIs(tmp, "\\begin{")) {
+				if (contains(runparams.active_chars, '^'))
+					// cprotect relies on ^ being on catcode 7
+					os << "\\begingroup\\catcode`\\^=7";
+				os << "\\cprotect";
+				count += 9;
+			}
 			os << from_ascii(tmp);
 			count += tmp.length();
 			if (!lyxrc.language_command_end.empty())
@@ -321,6 +379,13 @@ int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
 			os << '\\' << LaTeXFamilySwitchNames[f.family()] << termcmd;
 			count += strlen(LaTeXFamilySwitchNames[f.family()]) + 1;
 		} else {
+			if (needs_cprotection) {
+				if (contains(runparams.active_chars, '^'))
+					// cprotect relies on ^ being on catcode 7
+					os << "\\begingroup\\catcode`\\^=7";
+				os << "\\cprotect";
+				count += 9;
+			}
 			os << '\\'
 			   << LaTeXFamilyCommandNames[f.family()]
 			   << '{';
@@ -334,6 +399,13 @@ int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
 			os << '\\' << LaTeXSeriesSwitchNames[f.series()] << termcmd;
 			count += strlen(LaTeXSeriesSwitchNames[f.series()]) + 1;
 		} else {
+			if (needs_cprotection) {
+				if (contains(runparams.active_chars, '^'))
+					// cprotect relies on ^ being on catcode 7
+					os << "\\begingroup\\catcode`\\^=7";
+				os << "\\cprotect";
+				count += 9;
+			}
 			os << '\\'
 			   << LaTeXSeriesCommandNames[f.series()]
 			   << '{';
@@ -347,6 +419,13 @@ int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
 			os << '\\' << LaTeXShapeSwitchNames[f.shape()] << termcmd;
 			count += strlen(LaTeXShapeSwitchNames[f.shape()]) + 1;
 		} else {
+			if (needs_cprotection) {
+				if (contains(runparams.active_chars, '^'))
+					// cprotect relies on ^ being on catcode 7
+					os << "\\begingroup\\catcode`\\^=7";
+				os << "\\cprotect";
+				count += 9;
+			}
 			os << '\\'
 			   << LaTeXShapeCommandNames[f.shape()]
 			   << '{';
@@ -359,6 +438,13 @@ int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
 			os << '}';
 			++count;
 		} else if (f.color() != Color_none) {
+			if (needs_cprotection) {
+				if (contains(runparams.active_chars, '^'))
+					// cprotect relies on ^ being on catcode 7
+					os << "\\begingroup\\catcode`\\^=7";
+				os << "\\cprotect";
+				count += 9;
+			}
 			os << "\\textcolor{"
 			   << from_ascii(lcolor.getLaTeXName(f.color()))
 			   << "}{";
@@ -396,11 +482,25 @@ int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
 		}
 	}
 	if (f.emph() == FONT_ON) {
+		if (needs_cprotection) {
+			if (contains(runparams.active_chars, '^'))
+				// cprotect relies on ^ being on catcode 7
+				os << "\\begingroup\\catcode`\\^=7";
+			os << "\\cprotect";
+			count += 9;
+		}
 		os << "\\emph{";
 		count += 6;
 	}
 	// \noun{} is a LyX special macro
 	if (f.noun() == FONT_ON) {
+		if (needs_cprotection) {
+			if (contains(runparams.active_chars, '^'))
+				// cprotect relies on ^ being on catcode 7
+				os << "\\begingroup\\catcode`\\^=7";
+			os << "\\cprotect";
+			count += 9;
+		}
 		os << "\\noun{";
 		count += 6;
 	}
@@ -408,23 +508,51 @@ int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
 	// because ulem puts every nested group or macro in a box,
 	// which prevents linebreaks (#8424, #8733)
 	if (f.underbar() == FONT_ON) {
+		if (needs_cprotection) {
+			if (contains(runparams.active_chars, '^'))
+				// cprotect relies on ^ being on catcode 7
+				os << "\\begingroup\\catcode`\\^=7";
+			os << "\\cprotect";
+			count += 9;
+		}
 		os << "\\uline{";
-		count += 10;
+		count += 7;
 		++runparams.inulemcmd;
 	}
 	if (f.uuline() == FONT_ON) {
+		if (needs_cprotection) {
+			if (contains(runparams.active_chars, '^'))
+				// cprotect relies on ^ being on catcode 7
+				os << "\\begingroup\\catcode`\\^=7";
+			os << "\\cprotect";
+			count += 9;
+		}
 		os << "\\uuline{";
-		count += 11;
+		count += 8;
 		++runparams.inulemcmd;
 	}
 	if (f.strikeout() == FONT_ON) {
+		if (needs_cprotection) {
+			if (contains(runparams.active_chars, '^'))
+				// cprotect relies on ^ being on catcode 7
+				os << "\\begingroup\\catcode`\\^=7";
+			os << "\\cprotect";
+			count += 9;
+		}
 		os << "\\sout{";
-		count += 9;
+		count += 6;
 		++runparams.inulemcmd;
 	}
 	if (f.xout() == FONT_ON) {
+		if (needs_cprotection) {
+			if (contains(runparams.active_chars, '^'))
+				// cprotect relies on ^ being on catcode 7
+				os << "\\begingroup\\catcode`\\^=7";
+			os << "\\cprotect";
+			count += 9;
+		}
 		os << "\\xout{";
-		count += 9;
+		count += 6;
 		++runparams.inulemcmd;
 	}
 	if (f.uwave() == FONT_ON) {
@@ -434,8 +562,15 @@ int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
 			os << "\\ULdepth=1000pt";
 			count += 15;
 		}
+		if (needs_cprotection) {
+			if (contains(runparams.active_chars, '^'))
+				// cprotect relies on ^ being on catcode 7
+				os << "\\begingroup\\catcode`\\^=7";
+			os << "\\cprotect";
+			count += 9;
+		}
 		os << "\\uwave{";
-		count += 10;
+		count += 7;
 		++runparams.inulemcmd;
 	}
 	return count;
diff --git a/src/Font.h b/src/Font.h
index 5d8998a..9b08c83 100644
--- a/src/Font.h
+++ b/src/Font.h
@@ -76,7 +76,8 @@ public:
 				   OutputParams const & runparams,
 				   Font const & base,
 				   Font const & prev,
-				   bool const & non_inherit_inset = false) const;
+				   bool const & non_inherit_inset = false,
+				   bool const & needs_cprotection = false) const;
 
 	/** Writes the tail of the LaTeX needed to change to this font.
 	    Returns number of chars written. Base is the font state we want
diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index 8da3d13..58feaf4 100644
--- a/src/Paragraph.cpp
+++ b/src/Paragraph.cpp
@@ -1044,7 +1044,8 @@ void Paragraph::Private::latexInset(BufferParams const & bparams,
 			|| basefont.isRightToLeft() == running_font.isRightToLeft();
 		unsigned int count = running_font.latexWriteStartChanges(os, bparams,
 						      runparams, basefont,
-						      running_font, true);
+						      running_font, true,
+						      owner_->needsCProtection(runparams.moving_arg));
 		column += count;
 		// if any font properties were closed, update the running_font,
 		// making sure, however, to leave the language as it was
@@ -2659,7 +2660,8 @@ void Paragraph::latex(BufferParams const & bparams,
 			otexstringstream ots;
 			if (!non_inherit_inset) {
 				column += current_font.latexWriteStartChanges(ots, bparams,
-									      runparams, basefont, last_font);
+									      runparams, basefont, last_font, false,
+									      needsCProtection(runparams.moving_arg));
 			}
 			// Check again for display math in ulem commands as a
 			// font change may also occur just before a math inset.

commit e515e7165d8cdc452aac13ea1bff6864335b340b
Author: Kornel Benko <kornel at lyx.org>
Date:   Wed Aug 12 14:50:07 2020 +0200

    Update sk.po

diff --git a/po/sk.po b/po/sk.po
index 9bf1cc7..3421890 100644
--- a/po/sk.po
+++ b/po/sk.po
@@ -8,8 +8,8 @@ msgid ""
 msgstr ""
 "Project-Id-Version: LyX-2.4\n"
 "Report-Msgid-Bugs-To: lyx-devel at lists.lyx.org\n"
-"POT-Creation-Date: 2020-08-10 10:20+0200\n"
-"PO-Revision-Date: 2020-08-10 08:24+0000\n"
+"POT-Creation-Date: 2020-08-12 14:44+0200\n"
+"PO-Revision-Date: 2020-08-12 12:48+0000\n"
 "Last-Translator: Kornel Benko <kornel at lyx.org>\n"
 "Language-Team: Slovak <kornel at lyx.org>\n"
 "Language: sk\n"
@@ -3422,6 +3422,16 @@ msgstr "Na šírk&u"
 msgid "Page Layout"
 msgstr "Formát stránky"
 
+#: lib/layouts/customHeadersFooters.module:8
+msgid ""
+"Adds environments to define header and footer lines. NOTE: To use this "
+"module you must set the 'Page style' in the menu Document Settings -> Page "
+"Layout to 'fancy'!"
+msgstr ""
+"Pridáva prostredia na definície riadkov hlavičiek a pätičiek. POZOR: Na "
+"použitie tohto modulu treba nastaviť 'Štýl stránky' v menu Dokument -> "
+"Nastavenia… -> Formát stránky na 'pestrý' (fancy)!"
+
 #: src/frontends/qt/ui/PageLayoutUi.ui:171
 msgid "Page &style:"
 msgstr "Štýl &stránky:"
@@ -10858,16 +10868,6 @@ msgstr "Čínsky referát (CTeX)"
 msgid "Custom Header/Footer Text"
 msgstr "Vlastný text pre hlavičku/pätu"
 
-#: lib/layouts/customHeadersFooters.module:8
-msgid ""
-"Adds environments to define header and footer lines. NOTE: To use this "
-"module you must set the 'Headings style' in the menu Document Settings -> "
-"Page Layout to 'fancy'!"
-msgstr ""
-"Pridáva prostredia na definície riadkov hlavičiek a pätičiek. POZOR: Na "
-"použitie tohto modulu treba nastaviť štýl hlavičky v menu Dokument -> "
-"Nastavenia… -> Formát stránky na 'pestrý' (fancy)!"
-
 #: lib/layouts/customHeadersFooters.module:13
 msgid "Header/Footer"
 msgstr "Hlavička/Päta"

commit 91170accdec9cf9a2349832da263c1c5f6a95fae
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Wed Aug 12 14:30:25 2020 +0200

    Fix string

diff --git a/lib/doc/UserGuide.lyx b/lib/doc/UserGuide.lyx
index 20bbae2..0884521 100644
--- a/lib/doc/UserGuide.lyx
+++ b/lib/doc/UserGuide.lyx
@@ -4145,8 +4145,14 @@ Class
 
 \begin_layout Standard
 The drop box 
+\change_deleted -712698321 1597235163
+
 \family sans
 Headings
+\change_inserted -712698321 1597235164
+Page
+\change_unchanged
+
 \begin_inset space ~
 \end_inset
 
diff --git a/lib/layouts/customHeadersFooters.module b/lib/layouts/customHeadersFooters.module
index c75d5a8..ba909a9 100644
--- a/lib/layouts/customHeadersFooters.module
+++ b/lib/layouts/customHeadersFooters.module
@@ -2,7 +2,7 @@
 #\DeclareCategory{Page Layout}
 #DescriptionBegin
 #Adds environments to define header and footer lines.
-#NOTE: To use this module you must set the 'Headings style' in 
+#NOTE: To use this module you must set the 'Page style' in 
 #      the menu Document Settings -> Page Layout to 'fancy'!
 #DescriptionEnd
 #Author: Uwe Stöhr

commit 008766fe4e4f6dc4b10ea90f7c9d4a2142e8da3b
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Wed Aug 12 14:05:22 2020 +0200

    Pass proper font

diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index e4b774d..8da3d13 100644
--- a/src/Paragraph.cpp
+++ b/src/Paragraph.cpp
@@ -1044,7 +1044,7 @@ void Paragraph::Private::latexInset(BufferParams const & bparams,
 			|| basefont.isRightToLeft() == running_font.isRightToLeft();
 		unsigned int count = running_font.latexWriteStartChanges(os, bparams,
 						      runparams, basefont,
-						      basefont, true);
+						      running_font, true);
 		column += count;
 		// if any font properties were closed, update the running_font,
 		// making sure, however, to leave the language as it was

commit 88506f886b3eb7ecaf1afdb0cee7efae505376db
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Wed Aug 12 13:13:56 2020 +0200

    update tex2lyx tests

diff --git a/src/tex2lyx/test/CJK.lyx.lyx b/src/tex2lyx/test/CJK.lyx.lyx
index d31388d..4ddbb66 100644
--- a/src/tex2lyx/test/CJK.lyx.lyx
+++ b/src/tex2lyx/test/CJK.lyx.lyx
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.4
-\lyxformat 597
+\lyxformat 598
 \begin_document
 \begin_header
 \save_transient_properties true
@@ -88,6 +88,7 @@
 \html_math_output 0
 \html_css_as_file 0
 \html_be_strict false
+\docbook_table_output 0
 \end_header
 
 \begin_body
diff --git a/src/tex2lyx/test/CJKutf8.lyx.lyx b/src/tex2lyx/test/CJKutf8.lyx.lyx
index fb41501..cfab7bb 100644
--- a/src/tex2lyx/test/CJKutf8.lyx.lyx
+++ b/src/tex2lyx/test/CJKutf8.lyx.lyx
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.4
-\lyxformat 597
+\lyxformat 598
 \begin_document
 \begin_header
 \save_transient_properties true
@@ -88,6 +88,7 @@
 \html_math_output 0
 \html_css_as_file 0
 \html_be_strict false
+\docbook_table_output 0
 \end_header
 
 \begin_body
diff --git a/src/tex2lyx/test/DummyDocument.lyx.lyx b/src/tex2lyx/test/DummyDocument.lyx.lyx
index f97eae9..556f05e 100644
--- a/src/tex2lyx/test/DummyDocument.lyx.lyx
+++ b/src/tex2lyx/test/DummyDocument.lyx.lyx
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.4
-\lyxformat 597
+\lyxformat 598
 \begin_document
 \begin_header
 \save_transient_properties true
@@ -94,6 +94,7 @@
 \html_math_output 0
 \html_css_as_file 0
 \html_be_strict false
+\docbook_table_output 0
 \end_header
 
 \begin_body
diff --git a/src/tex2lyx/test/Dummy~Document.lyx.lyx b/src/tex2lyx/test/Dummy~Document.lyx.lyx
index 9baeaed..8046f53 100644
--- a/src/tex2lyx/test/Dummy~Document.lyx.lyx
+++ b/src/tex2lyx/test/Dummy~Document.lyx.lyx
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.4
-\lyxformat 597
+\lyxformat 598
 \begin_document
 \begin_header
 \save_transient_properties true
@@ -94,6 +94,7 @@
 \html_math_output 0
 \html_css_as_file 0
 \html_be_strict false
+\docbook_table_output 0
 \end_header
 
 \begin_body
diff --git a/src/tex2lyx/test/XeTeX-polyglossia.lyx.lyx b/src/tex2lyx/test/XeTeX-polyglossia.lyx.lyx
index d738c27..66f4918 100644
--- a/src/tex2lyx/test/XeTeX-polyglossia.lyx.lyx
+++ b/src/tex2lyx/test/XeTeX-polyglossia.lyx.lyx
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.4
-\lyxformat 597
+\lyxformat 598
 \begin_document
 \begin_header
 \save_transient_properties true
@@ -87,6 +87,7 @@
 \html_math_output 0
 \html_css_as_file 0
 \html_be_strict false
+\docbook_table_output 0
 \end_header
 
 \begin_body
diff --git a/src/tex2lyx/test/algo2e.lyx.lyx b/src/tex2lyx/test/algo2e.lyx.lyx
index 454a0e1..ef72541 100644
--- a/src/tex2lyx/test/algo2e.lyx.lyx
+++ b/src/tex2lyx/test/algo2e.lyx.lyx
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.4
-\lyxformat 597
+\lyxformat 598
 \begin_document
 \begin_header
 \save_transient_properties true
@@ -86,6 +86,7 @@ algorithm2e
 \html_math_output 0
 \html_css_as_file 0
 \html_be_strict false
+\docbook_table_output 0
 \end_header
 
 \begin_body
diff --git a/src/tex2lyx/test/beamer.lyx.lyx b/src/tex2lyx/test/beamer.lyx.lyx
index a524971..aeb8a20 100644
--- a/src/tex2lyx/test/beamer.lyx.lyx
+++ b/src/tex2lyx/test/beamer.lyx.lyx
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.4
-\lyxformat 597
+\lyxformat 598
 \begin_document
 \begin_header
 \save_transient_properties true
@@ -87,6 +87,7 @@
 \html_math_output 0
 \html_css_as_file 0
 \html_be_strict false
+\docbook_table_output 0
 \end_header
 
 \begin_body
diff --git a/src/tex2lyx/test/box-color-size-space-align.lyx.lyx b/src/tex2lyx/test/box-color-size-space-align.lyx.lyx
index 3859b44..7632f6c 100644
--- a/src/tex2lyx/test/box-color-size-space-align.lyx.lyx
+++ b/src/tex2lyx/test/box-color-size-space-align.lyx.lyx
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.4
-\lyxformat 597
+\lyxformat 598
 \begin_document
 \begin_header
 \save_transient_properties true
@@ -123,6 +123,7 @@
 \html_math_output 0
 \html_css_as_file 0
 \html_be_strict false
+\docbook_table_output 0
 \end_header
 
 \begin_body
diff --git a/src/tex2lyx/test/listpreamble.lyx.lyx b/src/tex2lyx/test/listpreamble.lyx.lyx
index 0884ca1..7545566 100644
--- a/src/tex2lyx/test/listpreamble.lyx.lyx
+++ b/src/tex2lyx/test/listpreamble.lyx.lyx
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.4
-\lyxformat 597
+\lyxformat 598
 \begin_document
 \begin_header
 \save_transient_properties true
@@ -91,6 +91,7 @@
 \html_math_output 0
 \html_css_as_file 0
 \html_be_strict false
+\docbook_table_output 0
 \end_header
 
 \begin_body
diff --git a/src/tex2lyx/test/tabular-x-test.lyx.lyx b/src/tex2lyx/test/tabular-x-test.lyx.lyx
index 1042983..78e7025 100644
--- a/src/tex2lyx/test/tabular-x-test.lyx.lyx
+++ b/src/tex2lyx/test/tabular-x-test.lyx.lyx
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.4
-\lyxformat 597
+\lyxformat 598
 \begin_document
 \begin_header
 \save_transient_properties true
@@ -90,6 +90,7 @@
 \html_math_output 0
 \html_css_as_file 0
 \html_be_strict false
+\docbook_table_output 0
 \end_header
 
 \begin_body
diff --git a/src/tex2lyx/test/test-insets-basic.lyx.lyx b/src/tex2lyx/test/test-insets-basic.lyx.lyx
index 967df1a..7a922bd 100644
--- a/src/tex2lyx/test/test-insets-basic.lyx.lyx
+++ b/src/tex2lyx/test/test-insets-basic.lyx.lyx
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.4
-\lyxformat 597
+\lyxformat 598
 \begin_document
 \begin_header
 \save_transient_properties true
@@ -130,6 +130,7 @@
 \html_math_output 0
 \html_css_as_file 0
 \html_be_strict false
+\docbook_table_output 0
 \end_header
 
 \begin_body
diff --git a/src/tex2lyx/test/test-insets.lyx.lyx b/src/tex2lyx/test/test-insets.lyx.lyx
index 815e173..ea43039 100644
--- a/src/tex2lyx/test/test-insets.lyx.lyx
+++ b/src/tex2lyx/test/test-insets.lyx.lyx
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.4
-\lyxformat 597
+\lyxformat 598
 \begin_document
 \begin_header
 \save_transient_properties true
@@ -106,6 +106,7 @@
 \html_math_output 0
 \html_css_as_file 0
 \html_be_strict false
+\docbook_table_output 0
 \end_header
 
 \begin_body
diff --git a/src/tex2lyx/test/test-memoir.lyx.lyx b/src/tex2lyx/test/test-memoir.lyx.lyx
index 3b0e29e..0938090 100644
--- a/src/tex2lyx/test/test-memoir.lyx.lyx
+++ b/src/tex2lyx/test/test-memoir.lyx.lyx
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.4
-\lyxformat 597
+\lyxformat 598
 \begin_document
 \begin_header
 \save_transient_properties true
@@ -84,6 +84,7 @@
 \html_math_output 0
 \html_css_as_file 0
 \html_be_strict false
+\docbook_table_output 0
 \end_header
 
 \begin_body
diff --git a/src/tex2lyx/test/test-minted.lyx.lyx b/src/tex2lyx/test/test-minted.lyx.lyx
index 94a7ec7..cc252ac 100644
--- a/src/tex2lyx/test/test-minted.lyx.lyx
+++ b/src/tex2lyx/test/test-minted.lyx.lyx
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.4
-\lyxformat 597
+\lyxformat 598
 \begin_document
 \begin_header
 \save_transient_properties true
@@ -83,6 +83,7 @@
 \html_math_output 0
 \html_css_as_file 0
 \html_be_strict false
+\docbook_table_output 0
 \end_header
 
 \begin_body
diff --git a/src/tex2lyx/test/test-modules.lyx.lyx b/src/tex2lyx/test/test-modules.lyx.lyx
index 05dd24a..8dc6af6 100644
--- a/src/tex2lyx/test/test-modules.lyx.lyx
+++ b/src/tex2lyx/test/test-modules.lyx.lyx
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.4
-\lyxformat 597
+\lyxformat 598
 \begin_document
 \begin_header
 \save_transient_properties true
@@ -84,6 +84,7 @@ theorems-ams
 \html_math_output 0
 \html_css_as_file 0
 \html_be_strict false
+\docbook_table_output 0
 \end_header
 
 \begin_body
diff --git a/src/tex2lyx/test/test-refstyle-theorems.lyx.lyx b/src/tex2lyx/test/test-refstyle-theorems.lyx.lyx
index 685d693..902658b 100644
--- a/src/tex2lyx/test/test-refstyle-theorems.lyx.lyx
+++ b/src/tex2lyx/test/test-refstyle-theorems.lyx.lyx
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.4
-\lyxformat 597
+\lyxformat 598
 \begin_document
 \begin_header
 \save_transient_properties true
@@ -84,6 +84,7 @@ theorems-ams
 \html_math_output 0
 \html_css_as_file 0
 \html_be_strict false
+\docbook_table_output 0
 \end_header
 
 \begin_body
diff --git a/src/tex2lyx/test/test-scr.lyx.lyx b/src/tex2lyx/test/test-scr.lyx.lyx
index 49805e7..560ba27 100644
--- a/src/tex2lyx/test/test-scr.lyx.lyx
+++ b/src/tex2lyx/test/test-scr.lyx.lyx
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.4
-\lyxformat 597
+\lyxformat 598
 \begin_document
 \begin_header
 \save_transient_properties true
@@ -81,6 +81,7 @@
 \html_math_output 0
 \html_css_as_file 0
 \html_be_strict false
+\docbook_table_output 0
 \end_header
 
 \begin_body
diff --git a/src/tex2lyx/test/test-structure.lyx.lyx b/src/tex2lyx/test/test-structure.lyx.lyx
index 35265e9..ab23fe1 100644
--- a/src/tex2lyx/test/test-structure.lyx.lyx
+++ b/src/tex2lyx/test/test-structure.lyx.lyx
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.4
-\lyxformat 597
+\lyxformat 598
 \begin_document
 \begin_header
 \save_transient_properties true
@@ -118,6 +118,7 @@ logicalmkup
 \html_math_output 0
 \html_css_as_file 0
 \html_be_strict false
+\docbook_table_output 0
 \author -443692588 "Hans Wurst"
 \end_header
 
diff --git a/src/tex2lyx/test/test.lyx.lyx b/src/tex2lyx/test/test.lyx.lyx
index bf8d16d..8a5b5ed 100644
--- a/src/tex2lyx/test/test.lyx.lyx
+++ b/src/tex2lyx/test/test.lyx.lyx
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.4
-\lyxformat 597
+\lyxformat 598
 \begin_document
 \begin_header
 \save_transient_properties true
@@ -88,6 +88,7 @@
 \html_math_output 0
 \html_css_as_file 0
 \html_be_strict false
+\docbook_table_output 0
 \end_header
 
 \begin_body
diff --git a/src/tex2lyx/test/verbatim.lyx.lyx b/src/tex2lyx/test/verbatim.lyx.lyx
index 192d0cf..7407b17 100644
--- a/src/tex2lyx/test/verbatim.lyx.lyx
+++ b/src/tex2lyx/test/verbatim.lyx.lyx
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.4
-\lyxformat 597
+\lyxformat 598
 \begin_document
 \begin_header
 \save_transient_properties true
@@ -77,6 +77,7 @@
 \html_math_output 0
 \html_css_as_file 0
 \html_be_strict false
+\docbook_table_output 0
 \end_header
 
 \begin_body

commit 1af67974ff170f875d1f0c9e8befe749b1dc9309
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Wed Aug 12 11:04:17 2020 +0200

    Properly close and reopen font before insets with inheritFont() false

diff --git a/src/Font.cpp b/src/Font.cpp
index 7ec589d..74ff2de 100644
--- a/src/Font.cpp
+++ b/src/Font.cpp
@@ -450,8 +450,7 @@ int Font::latexWriteEndChanges(otexstream & os, BufferParams const & bparams,
 				  Font const & base,
 				  Font const & next,
 				  bool & needPar,
-				  bool const & closeLanguage,
-				  bool const & non_inherit_inset) const
+				  bool const & closeLanguage) const
 {
 	int count = 0;
 
@@ -461,15 +460,15 @@ int Font::latexWriteEndChanges(otexstream & os, BufferParams const & bparams,
 	FontInfo f = bits_;
 	f.reduce(base.bits_);
 
-	if (f.family() != INHERIT_FAMILY && !non_inherit_inset) {
+	if (f.family() != INHERIT_FAMILY) {
 		os << '}';
 		++count;
 	}
-	if (f.series() != INHERIT_SERIES && !non_inherit_inset) {
+	if (f.series() != INHERIT_SERIES) {
 		os << '}';
 		++count;
 	}
-	if (f.shape() != INHERIT_SHAPE && !non_inherit_inset) {
+	if (f.shape() != INHERIT_SHAPE) {
 		os << '}';
 		++count;
 	}
@@ -489,15 +488,13 @@ int Font::latexWriteEndChanges(otexstream & os, BufferParams const & bparams,
 		// We do not close size group in front of
 		// insets with InheritFont() false (as opposed
 		// to all other font properties) (#8384)
-		if (!non_inherit_inset) {
-			if (needPar && !closeLanguage) {
-				os << "\\par";
-				count += 4;
-				needPar = false;
-			}
-			os << '}';
-			++count;
+		if (needPar && !closeLanguage) {
+			os << "\\par";
+			count += 4;
+			needPar = false;
 		}
+		os << '}';
+		++count;
 	}
 	if (f.underbar() == FONT_ON) {
 		os << '}';
diff --git a/src/Font.h b/src/Font.h
index f623a48..5d8998a 100644
--- a/src/Font.h
+++ b/src/Font.h
@@ -87,8 +87,7 @@ public:
 				 Font const & base,
 				 Font const & next,
 				 bool & needPar,
-				 bool const & closeLanguage = true,
-				 bool const & non_inherit_inset = false) const;
+				 bool const & closeLanguage = true) const;
 
 
 	/// Build GUI description of font state
diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index 133ddd1..e4b774d 100644
--- a/src/Paragraph.cpp
+++ b/src/Paragraph.cpp
@@ -1040,14 +1040,11 @@ void Paragraph::Private::latexInset(BufferParams const & bparams,
 	bool arabtex = basefont.language()->lang() == "arabic_arabtex"
 		|| running_font.language()->lang() == "arabic_arabtex";
 	if (open_font && !inset->inheritFont()) {
-		bool needPar = false;
 		bool closeLanguage = arabtex
 			|| basefont.isRightToLeft() == running_font.isRightToLeft();
-		// We pass non_inherit_inset = true here since size switches
-		// ought not to be terminated here (#8384).
-		unsigned int count = running_font.latexWriteEndChanges(os,
-					bparams, runparams, basefont, basefont,
-					needPar, closeLanguage, true);
+		unsigned int count = running_font.latexWriteStartChanges(os, bparams,
+						      runparams, basefont,
+						      basefont, true);
 		column += count;
 		// if any font properties were closed, update the running_font,
 		// making sure, however, to leave the language as it was
@@ -1063,11 +1060,6 @@ void Paragraph::Private::latexInset(BufferParams const & bparams,
 			basefont.fontInfo().setSize(copy_font.fontInfo().size());
 			basefont.fontInfo().setFamily(copy_font.fontInfo().family());
 			basefont.fontInfo().setSeries(copy_font.fontInfo().series());
-			// leave font open if language or any of the switches is still open
-			open_font = (running_font.language() == basefont.language()
-				     || running_font.fontInfo().size() == basefont.fontInfo().size()
-				     || running_font.fontInfo().family() == basefont.fontInfo().family()
-				     || running_font.fontInfo().series() == basefont.fontInfo().series());
 			if (closeLanguage)
 				runparams.local_font = &basefont;
 		}
@@ -2560,17 +2552,26 @@ void Paragraph::latex(BufferParams const & bparams,
 
 		// Fully instantiated font
 		Font const current_font = getFont(bparams, i, outerfont);
+		// Previous font
+		Font const prev_font = (i > 0) ?
+					getFont(bparams, i - 1, outerfont)
+				      : current_font;
 
 		Font const last_font = running_font;
 		bool const in_ct_deletion = (bparams.output_changes
 					     && runningChange == change
 					     && change.type == Change::DELETED
 					     && !os.afterParbreak());
+		bool const non_inherit_inset =
+				(c == META_INSET && getInset(i) && !getInset(i)->inheritFont());
 
 		// Do we need to close the previous font?
 		if (open_font &&
-		    (current_font != running_font ||
-		     current_font.language() != running_font.language()))
+		    ((current_font != running_font
+		      || current_font.language() != running_font.language())
+		     || (non_inherit_inset
+			 && (current_font == prev_font
+			     || current_font.language() == prev_font.language()))))
 		{
 			// ensure there is no open script-wrapper
 			if (!alien_script.empty()) {
@@ -2656,10 +2657,10 @@ void Paragraph::latex(BufferParams const & bparams,
 				column += 1;
 			}
 			otexstringstream ots;
-			bool const non_inherit_inset = (c == META_INSET && getInset(i) && !getInset(i)->inheritFont());
-			column += current_font.latexWriteStartChanges(ots, bparams,
-							      runparams, basefont,
-							      last_font, non_inherit_inset);
+			if (!non_inherit_inset) {
+				column += current_font.latexWriteStartChanges(ots, bparams,
+									      runparams, basefont, last_font);
+			}
 			// Check again for display math in ulem commands as a
 			// font change may also occur just before a math inset.
 			if (runparams.inDisplayMath && !deleted_display_math
@@ -2750,9 +2751,17 @@ void Paragraph::latex(BufferParams const & bparams,
 						incremented = true;
 					}
 				}
+				// We need to restore these after insets with
+				// inheritFont() false
+				Font const save_running_font = running_font;
+				Font const save_basefont = basefont;
 				d->latexInset(bparams, os, rp, running_font,
 						basefont, real_outerfont, open_font,
 						runningChange, style, i, column);
+				if (non_inherit_inset) {
+					running_font = save_running_font;
+					basefont = save_basefont;
+				}
 				if (incremented)
 					--parInline;
 

commit 075d220d6e927458c3e38d50fbecd6a7f30ece99
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Tue Aug 11 19:26:23 2020 +0200

    GuiLyXFiles: Fix crash and disabling with header selection
    
    Fixes #11929

diff --git a/src/frontends/qt/GuiLyXFiles.cpp b/src/frontends/qt/GuiLyXFiles.cpp
index 25b6fa4..c9dbf90 100644
--- a/src/frontends/qt/GuiLyXFiles.cpp
+++ b/src/frontends/qt/GuiLyXFiles.cpp
@@ -210,9 +210,9 @@ GuiLyXFiles::GuiLyXFiles(GuiView & lv)
 		this, SLOT(slotButtonBox(QAbstractButton *)));
 
 	connect(filesLW, SIGNAL(itemClicked(QTreeWidgetItem *, int)),
-		this, SLOT(changed_adaptor()));
+		this, SLOT(fileSelectionChanged()));
 	connect(filesLW, SIGNAL(itemSelectionChanged()),
-		this, SLOT(changed_adaptor()));
+		this, SLOT(fileSelectionChanged()));
 	connect(filter_, SIGNAL(textEdited(QString)),
 		this, SLOT(filterLabels()));
 	connect(filter_, SIGNAL(rightButtonClicked()),
@@ -252,8 +252,14 @@ bool GuiLyXFiles::translateName() const
 }
 
 
-void GuiLyXFiles::changed_adaptor()
+void GuiLyXFiles::fileSelectionChanged()
 {
+	if (!filesLW->currentItem()
+	    || !filesLW->currentItem()->data(0, Qt::UserRole).toString().endsWith(getSuffix())) {
+		// not a file (probably a header)
+		bc().setValid(false);
+		return;
+	}
 	changed();
 }
 
@@ -277,9 +283,11 @@ void GuiLyXFiles::on_languageCO_activated(int i)
 
 void GuiLyXFiles::on_filesLW_itemDoubleClicked(QTreeWidgetItem * item, int)
 {
-	if (!item->data(0, Qt::UserRole).toString().endsWith(getSuffix()))
+	if (!item || !item->data(0, Qt::UserRole).toString().endsWith(getSuffix())) {
 		// not a file (probably a header)
+		bc().setValid(false);
 		return;
+	}
 
 	applyView();
 	dispatchParams();
@@ -288,10 +296,17 @@ void GuiLyXFiles::on_filesLW_itemDoubleClicked(QTreeWidgetItem * item, int)
 
 void GuiLyXFiles::on_filesLW_itemClicked(QTreeWidgetItem * item, int)
 {
+	if (!item) {
+		bc().setValid(false);
+		return;
+	}
+
 	QString const data = item->data(0, Qt::UserRole).toString();
-	if (!data.endsWith(getSuffix()))
+	if (!data.endsWith(getSuffix())) {
 		// not a file (probably a header)
+		bc().setValid(false);
 		return;
+	}
 
 	languageCO->clear();
 	QMap<QString, QString>::const_iterator i =available_languages_.constBegin();
@@ -512,7 +527,7 @@ void GuiLyXFiles::resetFilter()
 
 QString const GuiLyXFiles::getRealPath(QString relpath)
 {
-	if (relpath.isEmpty())
+	if (relpath.isEmpty() && filesLW->currentItem() != nullptr)
 		relpath = filesLW->currentItem()->data(0, Qt::UserRole).toString();
 	QString const language = languageCO->itemData(languageCO->currentIndex()).toString();
 	if (localizations_.contains(relpath)) {
diff --git a/src/frontends/qt/GuiLyXFiles.h b/src/frontends/qt/GuiLyXFiles.h
index bc12913..62be392 100644
--- a/src/frontends/qt/GuiLyXFiles.h
+++ b/src/frontends/qt/GuiLyXFiles.h
@@ -40,7 +40,7 @@ Q_SIGNALS:
 	void fileSelected(QString const file);
 
 private Q_SLOTS:
-	void changed_adaptor();
+	void fileSelectionChanged();
 	void on_fileTypeCO_activated(int);
 	void on_languageCO_activated(int);
 	void on_filesLW_itemDoubleClicked(QTreeWidgetItem *, int);

commit bafd74c46ee290240162139ccdee56880ceda976
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Tue Aug 11 08:23:27 2020 +0200

    zh_CN/Tutotrial: Fix emphases

diff --git a/lib/doc/zh_CN/Tutorial.lyx b/lib/doc/zh_CN/Tutorial.lyx
index b169a8a..1f0f194 100644
--- a/lib/doc/zh_CN/Tutorial.lyx
+++ b/lib/doc/zh_CN/Tutorial.lyx
@@ -1,5 +1,5 @@
 #LyX 2.4 created this file. For more info see https://www.lyx.org/
-\lyxformat 566
+\lyxformat 598
 \begin_document
 \begin_header
 \save_transient_properties true
@@ -14,7 +14,7 @@
 \end_preamble
 \options cjk
 \use_default_options true
-\maintain_unincluded_children false
+\maintain_unincluded_children no
 \language chinese-simplified
 \language_package default
 \inputencoding utf8-cjk
@@ -26,7 +26,9 @@
 \font_default_family default
 \use_non_tex_fonts false
 \font_sc false
-\font_osf false
+\font_roman_osf false
+\font_sans_osf false
+\font_typewriter_osf false
 \font_sf_scale 100 100
 \font_tt_scale 100 100
 \font_cjk gbsn
@@ -56,7 +58,7 @@
 \pdf_backref section
 \pdf_pdfusetitle false
 \pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue,pdfpagelayout=OneColumn, pdfnewwindow=true,pdfstartview=XYZ, plainpages=false"
-\papersize a4paper
+\papersize a4
 \use_geometry false
 \use_package amsmath 1
 \use_package amssymb 1
@@ -78,6 +80,7 @@
 \justification true
 \use_refstyle 0
 \use_minted 0
+\use_lineno 0
 \index 索引
 \shortcut idx
 \color #008000
@@ -93,11 +96,15 @@
 \papercolumns 1
 \papersides 2
 \paperpagestyle default
+\tablestyle default
 \tracking_changes false
 \output_changes false
+\change_bars false
+\postpone_fragile_content false
 \html_math_output 0
 \html_css_as_file 0
 \html_be_strict false
+\docbook_table_output 0
 \end_header
 
 \begin_body
@@ -575,17 +582,14 @@ Introduction。
  的确也有不少精细调整文档格式的方法。毕竟 \SpecialChar LyX
  可能不会 100% 精确的按照你想的去排版。
 \emph on
-User's Guide 
-\shape italic
-包含了调整文档格式的详细方法,包括水平填充(HFills)和垂直距离(它们比空格、回车更加强大灵活);设置字体大小 、样式的方法;调整段落对齐方式的手段。你只需
-要专心写你的文档,在最后细调一下文档格式就好了。使用普通的字处理软件,你会在写文档的整个过程中都被格式排版所困扰。
+User's Guide
+\emph default
+ 包含了调整文档格式的详细方法,包括水平填充(HFills)和垂直距离(它们比空格、回车更加强大灵活);设置字体大小 、样式的方法;调整段落对齐方式的手段。你只
+需要专心写你的文档,在最后细调一下文档格式就好了。使用普通的字处理软件,你会在写文档的整个过程中都被格式排版所困扰。
 \begin_inset Foot
 status open
 
 \begin_layout Plain Layout
-
-\shape italic
-\emph on
 译注:连 AbiWord 这样轻量级的字处理软件都有样式了,就不要说 MS Word、OOo 了。
 \end_layout
 
@@ -1582,16 +1586,10 @@ Label
 
 \begin_layout Standard
 
-\shape italic
 \emph on
-还可以从 
-\shape default
-User's Guide
+还可以从 User's Guide
 \emph default
- 
-\shape italic
-\emph on
-那里,复制些文字过来
+ 那里,复制些文字过来
 \begin_inset Foot
 status collapsed
 

commit 8218225f6e71dea543646f13c932b5051f8a474a
Author: Richard Kimberly Heck <rikiheck at lyx.org>
Date:   Mon Aug 10 18:33:50 2020 -0400

    Distinguish size of Part from that of Chapter, in articles.

diff --git a/lib/layouts/article.layout b/lib/layouts/article.layout
index 56c4101..aac9ad5 100644
--- a/lib/layouts/article.layout
+++ b/lib/layouts/article.layout
@@ -23,9 +23,6 @@ Style Part
 	AlignPossible         Left
 	TopSep                2
 	BottomSep             1.5
-	Font
-	  Size                Larger
-	EndFont
 End
 
 
@@ -34,7 +31,4 @@ Style Part*
 	AlignPossible         Left
 	TopSep                2
 	BottomSep             1.5
-	Font
-	  Size                Larger
-	EndFont
 End

commit 2e4949c8a62ef3348a09c8a1045d5e5a1cfacfc6
Author: Kornel Benko <kornel at lyx.org>
Date:   Mon Aug 10 10:33:04 2020 +0200

    Update sk.po

diff --git a/po/sk.po b/po/sk.po
index 553f9f7..9bf1cc7 100644
--- a/po/sk.po
+++ b/po/sk.po
@@ -8,8 +8,8 @@ msgid ""
 msgstr ""
 "Project-Id-Version: LyX-2.4\n"
 "Report-Msgid-Bugs-To: lyx-devel at lists.lyx.org\n"
-"POT-Creation-Date: 2020-08-08 16:52+0200\n"
-"PO-Revision-Date: 2020-08-08 15:18+0000\n"
+"POT-Creation-Date: 2020-08-10 10:20+0200\n"
+"PO-Revision-Date: 2020-08-10 08:24+0000\n"
 "Last-Translator: Kornel Benko <kornel at lyx.org>\n"
 "Language-Team: Slovak <kornel at lyx.org>\n"
 "Language: sk\n"
@@ -5757,8 +5757,8 @@ msgid "Only non-output items"
 msgstr "Len prvky bez výstupu"
 
 #: src/frontends/qt/ui/ToggleWarningUi.ui:14
-msgid "LyX: Enter text"
-msgstr "LyX: Vložiť text"
+msgid "Enter text"
+msgstr "Vložiť text"
 
 #: src/frontends/qt/ui/ToggleWarningUi.ui:62
 #: src/frontends/qt/GuiProgress.cpp:194
@@ -17222,58 +17222,6 @@ msgstr ""
 "štruktúru dokumentu. To sa dá zmeniť voľbou jedného z 'Teorémy (Číslované "
 "podľa …)' modulu."
 
-#: lib/layouts/theorems-ams-chap-bytype.inc:95
-msgid "Theorem \\thechapter.\\thetheorem."
-msgstr "Teoréma \\thechapter.\\thetheorem."
-
-#: lib/layouts/theorems-ams-chap-bytype.inc:125
-msgid "Corollary \\thechapter.\\thecorollary."
-msgstr "Korolár \\thechapter.\\thecorollary."
-
-#: lib/layouts/theorems-ams-chap-bytype.inc:147
-msgid "Lemma \\thechapter.\\thelemma."
-msgstr "Lemma \\thechapter.\\thelemma."
-
-#: lib/layouts/theorems-ams-chap-bytype.inc:169
-msgid "Proposition \\thechapter.\\theproposition."
-msgstr "Tvrdenie \\thechapter.\\theproposition."
-
-#: lib/layouts/theorems-ams-chap-bytype.inc:191
-msgid "Conjecture \\thechapter.\\theconjecture."
-msgstr "Hypotéza \\thechapter.\\theconjecture."
-
-#: lib/layouts/theorems-ams-chap-bytype.inc:213
-msgid "Fact \\thechapter.\\thefact."
-msgstr "Fakt \\thechapter.\\thefact."
-
-#: lib/layouts/theorems-ams-chap-bytype.inc:235
-msgid "Definition \\thechapter.\\thedefinition."
-msgstr "Definícia \\thechapter.\\thedefinition."
-
-#: lib/layouts/theorems-ams-chap-bytype.inc:264
-msgid "Example \\thechapter.\\theexample."
-msgstr "Príklad \\thechapter.\\theexample."
-
-#: lib/layouts/theorems-ams-chap-bytype.inc:287
-msgid "Problem \\thechapter.\\theproblem."
-msgstr "Problém \\thechapter.\\theproblem."
-
-#: lib/layouts/theorems-ams-chap-bytype.inc:310
-msgid "Exercise \\thechapter.\\theexercise."
-msgstr "Úloha \\thechapter.\\theexercise."
-
-#: lib/layouts/theorems-ams-chap-bytype.inc:333
-msgid "Solution \\thechapter.\\thesolution."
-msgstr "Riešenie \\thechapter.\\thesolution."
-
-#: lib/layouts/theorems-ams-chap-bytype.inc:356
-msgid "Remark \\thechapter.\\theremark."
-msgstr "Pripomienka \\thechapter.\\theremark."
-
-#: lib/layouts/theorems-ams-chap-bytype.inc:388
-msgid "Claim \\thechapter.\\theclaim."
-msgstr "Nárok \\thechapter.\\theclaim."
-
 #: lib/layouts/theorems-ams-chap-bytype.module:2
 msgid "AMS Theorems (Numbered by Type within Chapters)"
 msgstr "AMS teorémy (Číslované podľa typu vnútri kapitol)"
@@ -17522,50 +17470,6 @@ msgstr ""
 "predpoklad 1.1, kritérium 2.1, axióma 2.1, …, oproti kritérium 1.1, "
 "kritérium 1.2, axióma 1.3, predpoklad 1.4, …)"
 
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:81
-msgid "Criterion \\thechapter.\\thecriterion."
-msgstr "Kritérium \\thechapter.\\thecriterion."
-
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:120
-msgid "Algorithm \\thechapter.\\thealgorithm."
-msgstr "Algoritmus \\thechapter.\\thealgorithm."
-
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:159
-msgid "Axiom \\thechapter.\\theaxiom."
-msgstr "Axióma \\thechapter.\\theaxiom."
-
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:198
-msgid "Condition \\thechapter.\\thecondition."
-msgstr "Podmienka \\thechapter.\\thecondition."
-
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:237
-msgid "Note \\thechapter.\\thenote."
-msgstr "Poznámka \\thechapter.\\thenote."
-
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:276
-msgid "Notation \\thechapter.\\thenotation."
-msgstr "Notácia \\thechapter.\\thenotation."
-
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:315
-msgid "Summary \\thechapter.\\thesummary."
-msgstr "Súhrn \\thechapter.\\thesummary."
-
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:355
-msgid "Acknowledgement \\thechapter.\\theacknowledgement."
-msgstr "Poďakovanie \\thechapter.\\theacknowledgement."
-
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:394
-msgid "Conclusion \\thechapter.\\theconclusion."
-msgstr "Záver \\thechapter.\\theconclusion."
-
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:433
-msgid "Assumption \\thechapter.\\theassumption."
-msgstr "Predpoklad \\thechapter.\\theassumption."
-
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:472
-msgid "Question \\thechapter.\\thequestion."
-msgstr "Otázka \\thechapter.\\thequestion."
-
 #: lib/layouts/theorems-ams-extended.module:2
 msgid "AMS Theorems (Extended)"
 msgstr "AMS teorémy (rozšírenie)"
@@ -30722,13 +30626,6 @@ msgstr "Qt verzia (čas prekladu): %1$s"
 msgid "About LyX"
 msgstr "O programe LyX"
 
-#: src/frontends/qt/GuiAlert.cpp:100 src/frontends/qt/GuiAlert.cpp:164
-#: src/frontends/qt/GuiAlert.cpp:220 src/frontends/qt/GuiAlert.cpp:266
-#: src/frontends/qt/GuiAlert.cpp:315
-#, c-format
-msgid "LyX: %1$s"
-msgstr "LyX: %1$s"
-
 #: src/frontends/qt/GuiApplication.cpp:650
 msgid "About %1"
 msgstr "O %1"

commit 3fc219db28e3d409e7447693c4c08b2bd9a139bd
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Mon Aug 10 10:04:25 2020 +0200

    de.po

diff --git a/po/de.po b/po/de.po
index 647ea37..8dab422 100644
--- a/po/de.po
+++ b/po/de.po
@@ -94,8 +94,8 @@ msgid ""
 msgstr ""
 "Project-Id-Version: LyX 2.4git\n"
 "Report-Msgid-Bugs-To: lyx-devel at lists.lyx.org\n"
-"POT-Creation-Date: 2020-07-30 15:34+0200\n"
-"PO-Revision-Date: 2020-07-11 11:17+0200\n"
+"POT-Creation-Date: 2020-08-10 10:00+0200\n"
+"PO-Revision-Date: 2020-08-10 10:02+0200\n"
 "Last-Translator: Jürgen Spitzmüller <spitz at lyx.org>\n"
 "Language-Team: Deutsch <lyx-docs at lists.lyx.org>\n"
 "Language: de\n"
@@ -374,18 +374,18 @@ msgstr "Die ausgewählte Datenbank entfernen"
 msgid "&Delete"
 msgstr "&Löschen"
 
-#: src/frontends/qt/ui/BibtexUi.ui:107 src/frontends/qt/ui/CitationUi.ui:188
-msgid "Move the selected citation up (Ctrl-Up)"
-msgstr "Ausgewählten Verweis nach vorne verschieben (Strg+Hoch)"
+#: src/frontends/qt/ui/BibtexUi.ui:107
+msgid "Move the selected database up (Ctrl-Up)"
+msgstr "Ausgewählte Datenbank nach oben verschieben (Strg+Hoch)"
 
 #: src/frontends/qt/ui/BibtexUi.ui:110 src/frontends/qt/ui/CitationUi.ui:191
 #: src/frontends/qt/ui/ModulesUi.ui:140
 msgid "&Up"
 msgstr "Rau&f"
 
-#: src/frontends/qt/ui/BibtexUi.ui:130 src/frontends/qt/ui/CitationUi.ui:211
-msgid "Move the selected citation down (Ctrl-Down)"
-msgstr "Ausgewählten Verweis nach hinten verschieben (Strg+Runter)"
+#: src/frontends/qt/ui/BibtexUi.ui:130
+msgid "Move the selected database down (Ctrl-Down)"
+msgstr "Ausgewählte Datenbank nach unten verschieben (Strg+Runter)"
 
 #: src/frontends/qt/ui/BibtexUi.ui:133 src/frontends/qt/ui/CitationUi.ui:214
 #: src/frontends/qt/ui/ModulesUi.ui:147
@@ -808,13 +808,13 @@ msgstr "A&lle hinzufügen"
 #: src/buffer_funcs.cpp:78 src/frontends/qt/GuiBranches.cpp:219
 #: src/frontends/qt/GuiClipboard.cpp:247 src/frontends/qt/GuiDocument.cpp:2786
 #: src/frontends/qt/GuiParagraph.cpp:164 src/frontends/qt/GuiPrefs.cpp:3341
-#: src/frontends/qt/GuiView.cpp:2602 src/frontends/qt/GuiView.cpp:2833
-#: src/frontends/qt/GuiView.cpp:2857 src/frontends/qt/GuiView.cpp:2871
-#: src/frontends/qt/GuiView.cpp:2973 src/frontends/qt/GuiView.cpp:3018
-#: src/frontends/qt/GuiView.cpp:3073 src/frontends/qt/GuiView.cpp:3310
-#: src/frontends/qt/GuiView.cpp:3324 src/frontends/qt/GuiView.cpp:3426
-#: src/frontends/qt/GuiView.cpp:3454 src/frontends/qt/GuiView.cpp:4158
-#: src/frontends/qt/GuiView.cpp:4165 src/insets/InsetBibtex.cpp:154
+#: src/frontends/qt/GuiView.cpp:2646 src/frontends/qt/GuiView.cpp:2877
+#: src/frontends/qt/GuiView.cpp:2901 src/frontends/qt/GuiView.cpp:2915
+#: src/frontends/qt/GuiView.cpp:3017 src/frontends/qt/GuiView.cpp:3062
+#: src/frontends/qt/GuiView.cpp:3117 src/frontends/qt/GuiView.cpp:3354
+#: src/frontends/qt/GuiView.cpp:3368 src/frontends/qt/GuiView.cpp:3470
+#: src/frontends/qt/GuiView.cpp:3498 src/frontends/qt/GuiView.cpp:4202
+#: src/frontends/qt/GuiView.cpp:4209 src/insets/InsetBibtex.cpp:154
 msgid "&Cancel"
 msgstr "&Abbrechen"
 
@@ -1146,6 +1146,14 @@ msgid "Click or press Delete to delete the selected citation from the list"
 msgstr ""
 "Mit Mausklick oder Entf entfernen Sie den ausgewählten Literaturverweis"
 
+#: src/frontends/qt/ui/CitationUi.ui:188
+msgid "Move the selected citation up (Ctrl-Up)"
+msgstr "Ausgewählten Verweis nach vorne verschieben (Strg+Hoch)"
+
+#: src/frontends/qt/ui/CitationUi.ui:211
+msgid "Move the selected citation down (Ctrl-Down)"
+msgstr "Ausgewählten Verweis nach hinten verschieben (Strg+Runter)"
+
 #: src/frontends/qt/ui/CitationUi.ui:232
 msgid "Selected &Citations:"
 msgstr "Ausge&wählte Verweise:"
@@ -1471,7 +1479,7 @@ msgid "F&ile"
 msgstr "Date&i"
 
 #: src/frontends/qt/ui/ExternalUi.ui:66 src/frontends/qt/ui/ExternalUi.ui:73
-#: lib/layouts/aastex.layout:557 lib/layouts/db_stdcharstyles.inc:7
+#: lib/layouts/aastex.layout:560 lib/layouts/db_stdcharstyles.inc:7
 #: lib/layouts/db_stdcharstyles.inc:8
 msgid "Filename"
 msgstr "Dateiname"
@@ -2329,8 +2337,8 @@ msgstr "Input"
 msgid "Verbatim"
 msgstr "Unformatiert"
 
-#: src/frontends/qt/ui/IncludeUi.ui:61 src/insets/InsetInclude.cpp:1410
-#: src/insets/InsetInclude.cpp:1416
+#: src/frontends/qt/ui/IncludeUi.ui:61 src/insets/InsetInclude.cpp:1420
+#: src/insets/InsetInclude.cpp:1426
 msgid "Program Listing"
 msgstr "Programmlisting"
 
@@ -2614,27 +2622,32 @@ msgstr "D&ynamische Anführungszeichen verwenden"
 msgid "&Encoding:"
 msgstr "&Kodierung:"
 
-#: src/frontends/qt/ui/LanguageUi.ui:116
+#: src/frontends/qt/ui/LanguageUi.ui:102
+msgid "Select encoding of the generated LaTeX source (LaTeX input encoding)."
+msgstr ""
+"Wählen Sie die Kodierung des generierten LaTeX-Codes (LaTeX-Eingabekodierung)"
+
+#: src/frontends/qt/ui/LanguageUi.ui:115
 msgid "Select Unicode encoding variant."
 msgstr "Wählen Sie die passende Unicode-Kodierung"
 
-#: src/frontends/qt/ui/LanguageUi.ui:126
+#: src/frontends/qt/ui/LanguageUi.ui:125
 msgid "Specify whether to load the 'inputenc' package."
 msgstr "Wählen Sie hier, ob das Paket 'inputenc' geladen werden soll."
 
-#: src/frontends/qt/ui/LanguageUi.ui:136
+#: src/frontends/qt/ui/LanguageUi.ui:135
 msgid "Select custom encoding."
 msgstr "Benutzerdefinierte Kodierung wählen"
 
-#: src/frontends/qt/ui/LanguageUi.ui:143
+#: src/frontends/qt/ui/LanguageUi.ui:142
 msgid "Language pa&ckage:"
 msgstr "Sprach&paket:"
 
-#: src/frontends/qt/ui/LanguageUi.ui:153
+#: src/frontends/qt/ui/LanguageUi.ui:152
 msgid "Select which language package LyX should use"
 msgstr "Wählen Sie, welches Sprachpaket LyX verwenden soll"
 
-#: src/frontends/qt/ui/LanguageUi.ui:160
+#: src/frontends/qt/ui/LanguageUi.ui:159
 msgid ""
 "Enter the command to load the language package (default: \\usepackage{babel})"
 msgstr ""
@@ -3265,14 +3278,12 @@ msgid "&Numbering"
 msgstr "&Nummerierung"
 
 #: src/frontends/qt/ui/OutputUi.ui:20
-#, fuzzy
 msgid "DocBook Output Options"
-msgstr "XHTML-Ausgabe-Optionen"
+msgstr "DocBook-Ausgabe-Optionen"
 
 #: src/frontends/qt/ui/OutputUi.ui:35
-#, fuzzy
 msgid "&Table output:"
-msgstr "&Mathe-Ausgabe:"
+msgstr "&Tabellen-Ausgabe:"
 
 #: src/frontends/qt/ui/OutputUi.ui:51 src/frontends/qt/ui/OutputUi.ui:203
 msgid "Format to use for math output."
@@ -3284,7 +3295,7 @@ msgstr "HTML"
 
 #: src/frontends/qt/ui/OutputUi.ui:60
 msgid "CALS"
-msgstr ""
+msgstr "CALS"
 
 #: src/frontends/qt/ui/OutputUi.ui:84
 msgid "LyX Format"
@@ -3567,7 +3578,7 @@ msgstr "&Doppelseitiges Dokument"
 msgid "Line &spacing"
 msgstr "Zeilen&abstand"
 
-#: src/frontends/qt/ui/ParagraphUi.ui:60 src/Text.cpp:2000
+#: src/frontends/qt/ui/ParagraphUi.ui:60 src/Text.cpp:1990
 #: src/frontends/qt/GuiDocument.cpp:870
 msgid "Single"
 msgstr "Einfach"
@@ -3576,7 +3587,7 @@ msgstr "Einfach"
 msgid "1.5"
 msgstr "1,5"
 
-#: src/frontends/qt/ui/ParagraphUi.ui:70 src/Text.cpp:2006
+#: src/frontends/qt/ui/ParagraphUi.ui:70 src/Text.cpp:1996
 #: src/frontends/qt/GuiDocument.cpp:874
 msgid "Double"
 msgstr "Doppelt"
@@ -5616,8 +5627,8 @@ msgstr ""
 
 #: src/frontends/qt/ui/TabularUi.ui:1368 src/frontends/qt/ui/TabularUi.ui:1405
 #: src/frontends/qt/ui/TabularUi.ui:1446 src/frontends/qt/ui/TabularUi.ui:1477
-#: src/frontends/qt/ui/TabularUi.ui:1515 src/frontends/qt/GuiToolbar.cpp:613
-#: src/frontends/qt/GuiToolbar.cpp:622 src/insets/InsetBranch.cpp:79
+#: src/frontends/qt/ui/TabularUi.ui:1515 src/frontends/qt/GuiToolbar.cpp:629
+#: src/frontends/qt/GuiToolbar.cpp:638 src/insets/InsetBranch.cpp:79
 #: src/insets/InsetBranch.cpp:82
 msgid "on"
 msgstr "an"
@@ -5933,8 +5944,8 @@ msgid "Only non-output items"
 msgstr "Nur nicht ausgegebene Elemente"
 
 #: src/frontends/qt/ui/ToggleWarningUi.ui:14
-msgid "LyX: Enter text"
-msgstr "LyX: Text eingeben"
+msgid "Enter text"
+msgstr "Text eingeben"
 
 #: src/frontends/qt/ui/ToggleWarningUi.ui:62
 #: src/frontends/qt/GuiProgress.cpp:194
@@ -6018,8 +6029,8 @@ msgstr "Nur Vorspann"
 msgid "Body Only"
 msgstr "Nur Haupttext"
 
-#: src/frontends/qt/ui/WorkAreaUi.ui:82 src/frontends/qt/GuiView.cpp:3454
-#: src/frontends/qt/GuiView.cpp:4158
+#: src/frontends/qt/ui/WorkAreaUi.ui:82 src/frontends/qt/GuiView.cpp:3498
+#: src/frontends/qt/GuiView.cpp:4202
 msgid "&Reload"
 msgstr "Ne&u laden"
 
@@ -6310,10 +6321,10 @@ msgstr "Kurztitel"
 #: lib/layouts/RJournal.layout:64 lib/layouts/aa.layout:73
 #: lib/layouts/aa.layout:96 lib/layouts/aa.layout:111 lib/layouts/aa.layout:135
 #: lib/layouts/aa.layout:265 lib/layouts/aa.layout:325
-#: lib/layouts/aastex.layout:164 lib/layouts/aastex.layout:181
-#: lib/layouts/aastex.layout:204 lib/layouts/aastex.layout:223
-#: lib/layouts/aastex.layout:297 lib/layouts/aastex62.layout:127
-#: lib/layouts/aastex62.layout:178 lib/layouts/aastex62.layout:194
+#: lib/layouts/aastex.layout:165 lib/layouts/aastex.layout:182
+#: lib/layouts/aastex.layout:205 lib/layouts/aastex.layout:224
+#: lib/layouts/aastex.layout:298 lib/layouts/aastex62.layout:128
+#: lib/layouts/aastex62.layout:179 lib/layouts/aastex62.layout:195
 #: lib/layouts/achemso.layout:56 lib/layouts/achemso.layout:83
 #: lib/layouts/acm-sigs.inc:11 lib/layouts/acm-sigs.inc:32
 #: lib/layouts/acmart.layout:87 lib/layouts/acmart.layout:157
@@ -6433,8 +6444,8 @@ msgstr "JEL:"
 
 #: lib/layouts/AEA.layout:95 lib/layouts/IEEEtran-CompSoc.layout:55
 #: lib/layouts/IEEEtran-TransMag.layout:33 lib/layouts/IEEEtran.layout:281
-#: lib/layouts/aa.layout:321 lib/layouts/aastex.layout:291
-#: lib/layouts/aastex62.layout:136 lib/layouts/achemso.layout:155
+#: lib/layouts/aa.layout:321 lib/layouts/aastex.layout:292
+#: lib/layouts/aastex62.layout:137 lib/layouts/achemso.layout:155
 #: lib/layouts/acm-sigs.inc:51 lib/layouts/acmart.layout:398
 #: lib/layouts/acmsiggraph-0-92.layout:187 lib/layouts/acmsiggraph.layout:163
 #: lib/layouts/amsdefs.inc:168 lib/layouts/apax.inc:249
@@ -6454,7 +6465,7 @@ msgstr "JEL:"
 msgid "Keywords"
 msgstr "Schlagwörter"
 
-#: lib/layouts/AEA.layout:98 lib/layouts/aastex62.layout:137
+#: lib/layouts/AEA.layout:98 lib/layouts/aastex62.layout:138
 #: lib/layouts/achemso.layout:158 lib/layouts/acm-sigs.inc:54
 #: lib/layouts/acmsiggraph-0-92.layout:191 lib/layouts/acmsiggraph.layout:167
 #: lib/layouts/apax.inc:265 lib/layouts/ectaart.layout:127
@@ -6471,7 +6482,7 @@ msgstr "Schlagwörter:"
 #: lib/layouts/IEEEtran-TransMag.layout:27 lib/layouts/IEEEtran.layout:259
 #: lib/layouts/RJournal.layout:39 lib/layouts/aa.layout:291
 #: lib/layouts/aapaper.layout:102 lib/layouts/aapaper.layout:205
-#: lib/layouts/aastex.layout:249 lib/layouts/acmart.layout:475
+#: lib/layouts/aastex.layout:250 lib/layouts/acmart.layout:475
 #: lib/layouts/acmsiggraph-0-92.layout:238
 #: lib/layouts/acmsiggraph-0-92.layout:254 lib/layouts/acmsiggraph.layout:194
 #: lib/layouts/acmsiggraph.layout:210 lib/layouts/agutex.layout:138
@@ -6515,12 +6526,12 @@ msgstr "Abstract"
 #: lib/layouts/theorems-ams-extended-bytype.module:331
 #: lib/layouts/theorems-ams-extended-bytype.module:346
 #: lib/layouts/theorems-ams-extended-bytype.module:349
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:63
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:352
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:365
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:368
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:383
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:386
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:70
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:363
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:376
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:379
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:394
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:397
 #: lib/layouts/theorems-ams-extended.module:276
 #: lib/layouts/theorems-ams-extended.module:285
 #: lib/layouts/theorems-ams-extended.module:288
@@ -6531,7 +6542,7 @@ msgstr "Danksagung"
 
 #: lib/layouts/AEA.layout:107 lib/layouts/egs.layout:617
 #: lib/layouts/theorems-ams-extended-bytype.module:340
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:377
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:388
 #: lib/layouts/theorems-ams-extended.module:296
 msgid "Acknowledgement."
 msgstr "Danksagung."
@@ -6618,16 +6629,14 @@ msgstr "Text einer Tabellenanmerkung"
 #: lib/layouts/theorems-ams-bytype.inc:68
 #: lib/layouts/theorems-ams-bytype.inc:107
 #: lib/layouts/theorems-ams-bytype.inc:110
-#: lib/layouts/theorems-ams-bytype.module:27
 #: lib/layouts/theorems-ams-chap-bytype.inc:29
-#: lib/layouts/theorems-ams-chap-bytype.inc:70
-#: lib/layouts/theorems-ams-chap-bytype.inc:113
-#: lib/layouts/theorems-ams-chap-bytype.inc:116
-#: lib/layouts/theorems-ams-chap-bytype.module:43
-#: lib/layouts/theorems-ams.inc:27 lib/layouts/theorems-ams.inc:66
-#: lib/layouts/theorems-ams.inc:69 lib/layouts/theorems-ams.module:22
-#: lib/layouts/theorems-bytype.inc:27 lib/layouts/theorems-bytype.inc:63
-#: lib/layouts/theorems-bytype.inc:66 lib/layouts/theorems-bytype.module:19
+#: lib/layouts/theorems-ams-chap-bytype.inc:83
+#: lib/layouts/theorems-ams-chap-bytype.inc:126
+#: lib/layouts/theorems-ams-chap-bytype.inc:129 lib/layouts/theorems-ams.inc:27
+#: lib/layouts/theorems-ams.inc:66 lib/layouts/theorems-ams.inc:69
+#: lib/layouts/theorems-ams.module:22 lib/layouts/theorems-bytype.inc:27
+#: lib/layouts/theorems-bytype.inc:63 lib/layouts/theorems-bytype.inc:66
+#: lib/layouts/theorems-bytype.module:19
 #: lib/layouts/theorems-chap-bytype.module:19
 #: lib/layouts/theorems-chap-bytype.module:67
 #: lib/layouts/theorems-chap.module:16 lib/layouts/theorems-chap.module:20
@@ -6657,12 +6666,12 @@ msgstr "Theorem"
 #: lib/layouts/theorems-ams-extended-bytype.module:121
 #: lib/layouts/theorems-ams-extended-bytype.module:136
 #: lib/layouts/theorems-ams-extended-bytype.module:139
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:45
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:117
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:130
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:133
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:148
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:151
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:46
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:128
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:141
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:144
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:159
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:162
 #: lib/layouts/theorems-ams-extended.module:70
 #: lib/layouts/theorems-ams-extended.module:80
 #: lib/layouts/theorems-ams-extended.module:83
@@ -6678,12 +6687,12 @@ msgstr "Algorithmus"
 #: lib/layouts/theorems-ams-extended-bytype.module:156
 #: lib/layouts/theorems-ams-extended-bytype.module:171
 #: lib/layouts/theorems-ams-extended-bytype.module:174
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:48
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:156
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:169
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:172
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:187
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:190
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:50
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:167
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:180
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:183
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:198
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:201
 #: lib/layouts/theorems-ams-extended.module:105
 #: lib/layouts/theorems-ams-extended.module:115
 #: lib/layouts/theorems-ams-extended.module:118
@@ -6717,12 +6726,10 @@ msgstr "Fall \\thecase."
 #: lib/layouts/theorems-ams-bytype.inc:335
 #: lib/layouts/theorems-ams-bytype.inc:345
 #: lib/layouts/theorems-ams-bytype.inc:348
-#: lib/layouts/theorems-ams-bytype.module:63
-#: lib/layouts/theorems-ams-chap-bytype.inc:65
-#: lib/layouts/theorems-ams-chap-bytype.inc:385
-#: lib/layouts/theorems-ams-chap-bytype.inc:399
-#: lib/layouts/theorems-ams-chap-bytype.inc:402
-#: lib/layouts/theorems-ams-chap-bytype.module:79
+#: lib/layouts/theorems-ams-chap-bytype.inc:77
+#: lib/layouts/theorems-ams-chap-bytype.inc:398
+#: lib/layouts/theorems-ams-chap-bytype.inc:412
+#: lib/layouts/theorems-ams-chap-bytype.inc:415
 #: lib/layouts/theorems-ams.inc:286 lib/layouts/theorems-ams.inc:295
 #: lib/layouts/theorems-ams.inc:298 lib/layouts/theorems-bytype.inc:291
 #: lib/layouts/theorems-bytype.inc:301 lib/layouts/theorems-bytype.inc:304
@@ -6748,12 +6755,12 @@ msgstr "Behauptung"
 #: lib/layouts/theorems-ams-extended-bytype.module:366
 #: lib/layouts/theorems-ams-extended-bytype.module:381
 #: lib/layouts/theorems-ams-extended-bytype.module:384
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:66
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:391
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:404
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:407
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:422
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:425
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:74
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:402
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:415
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:418
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:433
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:436
 #: lib/layouts/theorems-ams-extended.module:310
 #: lib/layouts/theorems-ams-extended.module:319
 #: lib/layouts/theorems-ams-extended.module:322
@@ -6769,12 +6776,12 @@ msgstr "Schlussfolgerung"
 #: lib/layouts/theorems-ams-extended-bytype.module:191
 #: lib/layouts/theorems-ams-extended-bytype.module:206
 #: lib/layouts/theorems-ams-extended-bytype.module:209
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:51
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:195
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:208
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:211
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:226
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:229
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:54
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:206
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:219
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:222
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:237
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:240
 #: lib/layouts/theorems-ams-extended.module:140
 #: lib/layouts/theorems-ams-extended.module:149
 #: lib/layouts/theorems-ams-extended.module:152
@@ -6791,12 +6798,10 @@ msgstr "Bedingung"
 #: lib/layouts/theorems-ams-bytype.inc:170
 #: lib/layouts/theorems-ams-bytype.inc:179
 #: lib/layouts/theorems-ams-bytype.inc:182
-#: lib/layouts/theorems-ams-bytype.module:39
-#: lib/layouts/theorems-ams-chap-bytype.inc:41
-#: lib/layouts/theorems-ams-chap-bytype.inc:188
+#: lib/layouts/theorems-ams-chap-bytype.inc:45
 #: lib/layouts/theorems-ams-chap-bytype.inc:201
-#: lib/layouts/theorems-ams-chap-bytype.inc:204
-#: lib/layouts/theorems-ams-chap-bytype.module:55
+#: lib/layouts/theorems-ams-chap-bytype.inc:214
+#: lib/layouts/theorems-ams-chap-bytype.inc:217
 #: lib/layouts/theorems-ams.inc:129 lib/layouts/theorems-ams.inc:139
 #: lib/layouts/theorems-ams.inc:142 lib/layouts/theorems-bytype.inc:126
 #: lib/layouts/theorems-bytype.inc:135 lib/layouts/theorems-bytype.inc:138
@@ -6825,16 +6830,13 @@ msgstr "Vermutung"
 #: lib/layouts/theorems-ams-bytype.inc:116
 #: lib/layouts/theorems-ams-bytype.inc:126
 #: lib/layouts/theorems-ams-bytype.inc:129
-#: lib/layouts/theorems-ams-bytype.module:30
-#: lib/layouts/theorems-ams-chap-bytype.inc:32
-#: lib/layouts/theorems-ams-chap-bytype.inc:122
-#: lib/layouts/theorems-ams-chap-bytype.inc:136
-#: lib/layouts/theorems-ams-chap-bytype.inc:139
-#: lib/layouts/theorems-ams-chap-bytype.module:46
-#: lib/layouts/theorems-ams.inc:75 lib/layouts/theorems-ams.inc:85
-#: lib/layouts/theorems-ams.inc:88 lib/layouts/theorems-bytype.inc:72
-#: lib/layouts/theorems-bytype.inc:81 lib/layouts/theorems-bytype.inc:84
-#: lib/layouts/theorems-bytype.module:22
+#: lib/layouts/theorems-ams-chap-bytype.inc:33
+#: lib/layouts/theorems-ams-chap-bytype.inc:135
+#: lib/layouts/theorems-ams-chap-bytype.inc:149
+#: lib/layouts/theorems-ams-chap-bytype.inc:152 lib/layouts/theorems-ams.inc:75
+#: lib/layouts/theorems-ams.inc:85 lib/layouts/theorems-ams.inc:88
+#: lib/layouts/theorems-bytype.inc:72 lib/layouts/theorems-bytype.inc:81
+#: lib/layouts/theorems-bytype.inc:84 lib/layouts/theorems-bytype.module:22
 #: lib/layouts/theorems-chap-bytype.module:23
 #: lib/layouts/theorems-chap-bytype.module:79 lib/layouts/theorems-order.inc:13
 #: lib/layouts/theorems-sec-bytype.module:23
@@ -6857,11 +6859,11 @@ msgstr "Korollar"
 #: lib/layouts/theorems-ams-extended-bytype.module:101
 #: lib/layouts/theorems-ams-extended-bytype.module:104
 #: lib/layouts/theorems-ams-extended-chap-bytype.module:42
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:78
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:91
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:94
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:109
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:112
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:89
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:102
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:105
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:120
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:123
 #: lib/layouts/theorems-ams-extended.module:36
 #: lib/layouts/theorems-ams-extended.module:46
 #: lib/layouts/theorems-ams-extended.module:49
@@ -6878,12 +6880,10 @@ msgstr "Kriterium"
 #: lib/layouts/theorems-ams-bytype.inc:206
 #: lib/layouts/theorems-ams-bytype.inc:222
 #: lib/layouts/theorems-ams-bytype.inc:225
-#: lib/layouts/theorems-ams-bytype.module:45
-#: lib/layouts/theorems-ams-chap-bytype.inc:47
-#: lib/layouts/theorems-ams-chap-bytype.inc:232
-#: lib/layouts/theorems-ams-chap-bytype.inc:252
-#: lib/layouts/theorems-ams-chap-bytype.inc:255
-#: lib/layouts/theorems-ams-chap-bytype.module:61
+#: lib/layouts/theorems-ams-chap-bytype.inc:53
+#: lib/layouts/theorems-ams-chap-bytype.inc:245
+#: lib/layouts/theorems-ams-chap-bytype.inc:265
+#: lib/layouts/theorems-ams-chap-bytype.inc:268
 #: lib/layouts/theorems-ams.inc:165 lib/layouts/theorems-ams.inc:182
 #: lib/layouts/theorems-ams.inc:185 lib/layouts/theorems-bytype.inc:162
 #: lib/layouts/theorems-bytype.inc:178 lib/layouts/theorems-bytype.inc:181
@@ -6909,12 +6909,10 @@ msgstr "Definition"
 #: lib/layouts/theorems-ams-bytype.inc:231
 #: lib/layouts/theorems-ams-bytype.inc:241
 #: lib/layouts/theorems-ams-bytype.inc:244
-#: lib/layouts/theorems-ams-bytype.module:48
-#: lib/layouts/theorems-ams-chap-bytype.inc:50
-#: lib/layouts/theorems-ams-chap-bytype.inc:261
-#: lib/layouts/theorems-ams-chap-bytype.inc:275
-#: lib/layouts/theorems-ams-chap-bytype.inc:278
-#: lib/layouts/theorems-ams-chap-bytype.module:64
+#: lib/layouts/theorems-ams-chap-bytype.inc:57
+#: lib/layouts/theorems-ams-chap-bytype.inc:274
+#: lib/layouts/theorems-ams-chap-bytype.inc:288
+#: lib/layouts/theorems-ams-chap-bytype.inc:291
 #: lib/layouts/theorems-ams.inc:190 lib/layouts/theorems-ams.inc:199
 #: lib/layouts/theorems-ams.inc:202 lib/layouts/theorems-bytype.inc:187
 #: lib/layouts/theorems-bytype.inc:197 lib/layouts/theorems-bytype.inc:200
@@ -6939,12 +6937,10 @@ msgstr "Beispiel"
 #: lib/layouts/theorems-ams-bytype.inc:269
 #: lib/layouts/theorems-ams-bytype.inc:279
 #: lib/layouts/theorems-ams-bytype.inc:282
-#: lib/layouts/theorems-ams-bytype.module:57
-#: lib/layouts/theorems-ams-chap-bytype.inc:56
-#: lib/layouts/theorems-ams-chap-bytype.inc:307
-#: lib/layouts/theorems-ams-chap-bytype.inc:321
-#: lib/layouts/theorems-ams-chap-bytype.inc:324
-#: lib/layouts/theorems-ams-chap-bytype.module:73
+#: lib/layouts/theorems-ams-chap-bytype.inc:65
+#: lib/layouts/theorems-ams-chap-bytype.inc:320
+#: lib/layouts/theorems-ams-chap-bytype.inc:334
+#: lib/layouts/theorems-ams-chap-bytype.inc:337
 #: lib/layouts/theorems-ams.inc:224 lib/layouts/theorems-ams.inc:233
 #: lib/layouts/theorems-ams.inc:236 lib/layouts/theorems-bytype.inc:225
 #: lib/layouts/theorems-bytype.inc:235 lib/layouts/theorems-bytype.inc:238
@@ -6975,16 +6971,13 @@ msgstr "Aufgabe"
 #: lib/layouts/theorems-ams-bytype.inc:134
 #: lib/layouts/theorems-ams-bytype.inc:143
 #: lib/layouts/theorems-ams-bytype.inc:146
-#: lib/layouts/theorems-ams-bytype.module:33
-#: lib/layouts/theorems-ams-chap-bytype.inc:35
-#: lib/layouts/theorems-ams-chap-bytype.inc:144
+#: lib/layouts/theorems-ams-chap-bytype.inc:37
 #: lib/layouts/theorems-ams-chap-bytype.inc:157
-#: lib/layouts/theorems-ams-chap-bytype.inc:160
-#: lib/layouts/theorems-ams-chap-bytype.module:49
-#: lib/layouts/theorems-ams.inc:93 lib/layouts/theorems-ams.inc:103
-#: lib/layouts/theorems-ams.inc:106 lib/layouts/theorems-bytype.inc:90
-#: lib/layouts/theorems-bytype.inc:99 lib/layouts/theorems-bytype.inc:102
-#: lib/layouts/theorems-bytype.module:25
+#: lib/layouts/theorems-ams-chap-bytype.inc:170
+#: lib/layouts/theorems-ams-chap-bytype.inc:173 lib/layouts/theorems-ams.inc:93
+#: lib/layouts/theorems-ams.inc:103 lib/layouts/theorems-ams.inc:106
+#: lib/layouts/theorems-bytype.inc:90 lib/layouts/theorems-bytype.inc:99
+#: lib/layouts/theorems-bytype.inc:102 lib/layouts/theorems-bytype.module:25
 #: lib/layouts/theorems-chap-bytype.module:27
 #: lib/layouts/theorems-chap-bytype.module:91 lib/layouts/theorems-order.inc:19
 #: lib/layouts/theorems-sec-bytype.module:27
@@ -7007,12 +7000,12 @@ msgstr "Lemma"
 #: lib/layouts/theorems-ams-extended-bytype.module:261
 #: lib/layouts/theorems-ams-extended-bytype.module:276
 #: lib/layouts/theorems-ams-extended-bytype.module:279
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:57
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:273
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:286
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:289
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:304
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:307
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:62
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:284
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:297
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:300
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:315
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:318
 #: lib/layouts/theorems-ams-extended.module:208
 #: lib/layouts/theorems-ams-extended.module:217
 #: lib/layouts/theorems-ams-extended.module:220
@@ -7026,12 +7019,10 @@ msgstr "Notation"
 #: lib/layouts/theorems-ams-bytype.inc:250
 #: lib/layouts/theorems-ams-bytype.inc:260
 #: lib/layouts/theorems-ams-bytype.inc:263
-#: lib/layouts/theorems-ams-bytype.module:54
-#: lib/layouts/theorems-ams-chap-bytype.inc:53
-#: lib/layouts/theorems-ams-chap-bytype.inc:284
-#: lib/layouts/theorems-ams-chap-bytype.inc:298
-#: lib/layouts/theorems-ams-chap-bytype.inc:301
-#: lib/layouts/theorems-ams-chap-bytype.module:70
+#: lib/layouts/theorems-ams-chap-bytype.inc:61
+#: lib/layouts/theorems-ams-chap-bytype.inc:297
+#: lib/layouts/theorems-ams-chap-bytype.inc:311
+#: lib/layouts/theorems-ams-chap-bytype.inc:314
 #: lib/layouts/theorems-ams.inc:207 lib/layouts/theorems-ams.inc:216
 #: lib/layouts/theorems-ams.inc:219 lib/layouts/theorems-bytype.inc:206
 #: lib/layouts/theorems-bytype.inc:216 lib/layouts/theorems-bytype.inc:219
@@ -7059,12 +7050,10 @@ msgstr "Problem"
 #: lib/layouts/theorems-ams-bytype.inc:152
 #: lib/layouts/theorems-ams-bytype.inc:161
 #: lib/layouts/theorems-ams-bytype.inc:164
-#: lib/layouts/theorems-ams-bytype.module:36
-#: lib/layouts/theorems-ams-chap-bytype.inc:38
-#: lib/layouts/theorems-ams-chap-bytype.inc:166
+#: lib/layouts/theorems-ams-chap-bytype.inc:41
 #: lib/layouts/theorems-ams-chap-bytype.inc:179
-#: lib/layouts/theorems-ams-chap-bytype.inc:182
-#: lib/layouts/theorems-ams-chap-bytype.module:52
+#: lib/layouts/theorems-ams-chap-bytype.inc:192
+#: lib/layouts/theorems-ams-chap-bytype.inc:195
 #: lib/layouts/theorems-ams.inc:111 lib/layouts/theorems-ams.inc:121
 #: lib/layouts/theorems-ams.inc:124 lib/layouts/theorems-bytype.inc:108
 #: lib/layouts/theorems-bytype.inc:117 lib/layouts/theorems-bytype.inc:120
@@ -7091,12 +7080,10 @@ msgstr "Satz"
 #: lib/layouts/theorems-ams-bytype.inc:307
 #: lib/layouts/theorems-ams-bytype.inc:324
 #: lib/layouts/theorems-ams-bytype.inc:327
-#: lib/layouts/theorems-ams-bytype.module:60
-#: lib/layouts/theorems-ams-chap-bytype.inc:62
-#: lib/layouts/theorems-ams-chap-bytype.inc:353
-#: lib/layouts/theorems-ams-chap-bytype.inc:374
-#: lib/layouts/theorems-ams-chap-bytype.inc:377
-#: lib/layouts/theorems-ams-chap-bytype.module:76
+#: lib/layouts/theorems-ams-chap-bytype.inc:73
+#: lib/layouts/theorems-ams-chap-bytype.inc:366
+#: lib/layouts/theorems-ams-chap-bytype.inc:387
+#: lib/layouts/theorems-ams-chap-bytype.inc:390
 #: lib/layouts/theorems-ams.inc:258 lib/layouts/theorems-ams.inc:276
 #: lib/layouts/theorems-ams.inc:279 lib/layouts/theorems-bytype.inc:263
 #: lib/layouts/theorems-bytype.inc:280 lib/layouts/theorems-bytype.inc:283
@@ -7117,6 +7104,7 @@ msgstr "Bemerkung"
 
 #: lib/layouts/AEA.layout:276 lib/layouts/ijmpc.layout:384
 #: lib/layouts/ijmpd.layout:395 lib/layouts/theorems-ams-bytype.inc:310
+#: lib/layouts/theorems-ams-chap-bytype.inc:369
 #: lib/layouts/theorems-bytype.inc:266
 #: lib/layouts/theorems-without-preamble.inc:339
 msgid "Remark \\theremark."
@@ -7128,12 +7116,10 @@ msgstr "Bemerkung \\theremark."
 #: lib/layouts/theorems-ams-bytype.inc:288
 #: lib/layouts/theorems-ams-bytype.inc:298
 #: lib/layouts/theorems-ams-bytype.inc:301
-#: lib/layouts/theorems-ams-bytype.module:51
-#: lib/layouts/theorems-ams-chap-bytype.inc:59
-#: lib/layouts/theorems-ams-chap-bytype.inc:330
-#: lib/layouts/theorems-ams-chap-bytype.inc:344
-#: lib/layouts/theorems-ams-chap-bytype.inc:347
-#: lib/layouts/theorems-ams-chap-bytype.module:67
+#: lib/layouts/theorems-ams-chap-bytype.inc:69
+#: lib/layouts/theorems-ams-chap-bytype.inc:343
+#: lib/layouts/theorems-ams-chap-bytype.inc:357
+#: lib/layouts/theorems-ams-chap-bytype.inc:360
 #: lib/layouts/theorems-ams.inc:241 lib/layouts/theorems-ams.inc:250
 #: lib/layouts/theorems-ams.inc:253 lib/layouts/theorems-bytype.inc:244
 #: lib/layouts/theorems-bytype.inc:254 lib/layouts/theorems-bytype.inc:257
@@ -7149,6 +7135,7 @@ msgid "Solution"
 msgstr "Lösung"
 
 #: lib/layouts/AEA.layout:286 lib/layouts/theorems-ams-bytype.inc:291
+#: lib/layouts/theorems-ams-chap-bytype.inc:346
 #: lib/layouts/theorems-bytype.inc:247
 #: lib/layouts/theorems-without-preamble.inc:289
 msgid "Solution \\thesolution."
@@ -7167,12 +7154,12 @@ msgstr "Lösung \\thesolution."
 #: lib/layouts/theorems-ams-extended-bytype.module:296
 #: lib/layouts/theorems-ams-extended-bytype.module:311
 #: lib/layouts/theorems-ams-extended-bytype.module:314
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:60
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:312
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:326
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:329
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:344
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:347
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:66
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:323
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:337
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:340
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:355
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:358
 #: lib/layouts/theorems-ams-extended.module:242
 #: lib/layouts/theorems-ams-extended.module:251
 #: lib/layouts/theorems-ams-extended.module:254
@@ -7268,7 +7255,7 @@ msgstr "Standard"
 
 #: lib/layouts/IEEEtran.layout:67 lib/layouts/aa.layout:204
 #: lib/layouts/aapaper.layout:78 lib/layouts/aapaper.layout:172
-#: lib/layouts/aastex.layout:136 lib/layouts/achemso.layout:53
+#: lib/layouts/aastex.layout:137 lib/layouts/achemso.layout:53
 #: lib/layouts/acmart.layout:145 lib/layouts/acmsiggraph-0-92.layout:165
 #: lib/layouts/acmsiggraph.layout:141 lib/layouts/agutex.layout:56
 #: lib/layouts/amsdefs.inc:27 lib/layouts/apa.layout:41 lib/layouts/apax.inc:37
@@ -7311,7 +7298,7 @@ msgstr "Kleinschreibung"
 
 #: lib/layouts/IEEEtran.layout:119 lib/layouts/aa.layout:216
 #: lib/layouts/aapaper.layout:84 lib/layouts/aapaper.layout:183
-#: lib/layouts/aastex.layout:148 lib/layouts/aastex62.layout:149
+#: lib/layouts/aastex.layout:149 lib/layouts/aastex62.layout:150
 #: lib/layouts/achemso.layout:80 lib/layouts/acmart.layout:81
 #: lib/layouts/acmsiggraph-0-92.layout:175 lib/layouts/acmsiggraph.layout:151
 #: lib/layouts/amsdefs.inc:54 lib/layouts/apa.layout:119
@@ -7425,8 +7412,8 @@ msgstr "Anhänge"
 
 #: lib/layouts/IEEEtran.layout:310 lib/layouts/IEEEtran.layout:349
 #: lib/layouts/IEEEtran.layout:385 lib/layouts/aa.layout:158
-#: lib/layouts/aastex.layout:319 lib/layouts/aastex.layout:383
-#: lib/layouts/aastex.layout:415 lib/layouts/achemso.layout:242
+#: lib/layouts/aastex.layout:320 lib/layouts/aastex.layout:386
+#: lib/layouts/aastex.layout:418 lib/layouts/achemso.layout:242
 #: lib/layouts/acmart.layout:652 lib/layouts/acmsiggraph-0-92.layout:346
 #: lib/layouts/acmsiggraph.layout:302 lib/layouts/agutex.layout:159
 #: lib/layouts/agutex.layout:169 lib/layouts/agutex.layout:189
@@ -7461,10 +7448,10 @@ msgid "PeerReviewTitle"
 msgstr "Peer-Review-Titel"
 
 #: lib/layouts/IEEEtran.layout:333 lib/layouts/IEEEtran.layout:336
-#: lib/layouts/aastex.layout:379 lib/layouts/aastex6.layout:95
-#: lib/layouts/aastex62.layout:106 lib/layouts/aastex62.layout:227
-#: lib/layouts/aastex62.layout:233 lib/layouts/aastex62.layout:249
-#: lib/layouts/aastex62.layout:265 lib/layouts/copernicus.layout:244
+#: lib/layouts/aastex.layout:382 lib/layouts/aastex6.layout:96
+#: lib/layouts/aastex62.layout:107 lib/layouts/aastex62.layout:228
+#: lib/layouts/aastex62.layout:234 lib/layouts/aastex62.layout:250
+#: lib/layouts/aastex62.layout:266 lib/layouts/copernicus.layout:244
 #: lib/layouts/copernicus.layout:250 lib/layouts/copernicus.layout:262
 #: lib/layouts/copernicus.layout:274 lib/layouts/copernicus.layout:279
 #: lib/layouts/ijmpc.layout:445 lib/layouts/ijmpc.layout:447
@@ -7484,7 +7471,7 @@ msgid "Short title for the appendix"
 msgstr "Kurztitel für den Anhang"
 
 #: lib/layouts/IEEEtran.layout:345 lib/layouts/aapaper.layout:108
-#: lib/layouts/aapaper.layout:222 lib/layouts/aastex.layout:411
+#: lib/layouts/aapaper.layout:222 lib/layouts/aastex.layout:414
 #: lib/layouts/aguplus.inc:172 lib/layouts/aguplus.inc:174
 #: lib/layouts/agutex.layout:208 lib/layouts/amsbook.layout:120
 #: lib/layouts/amsdefs.inc:203 lib/layouts/beamer.layout:1159
@@ -7511,8 +7498,8 @@ msgstr "Kurztitel für den Anhang"
 msgid "Bibliography"
 msgstr "Literaturverzeichnis"
 
-#: lib/layouts/IEEEtran.layout:361 lib/layouts/aastex.layout:425
-#: lib/layouts/aastex.layout:446 lib/layouts/agutex.layout:224
+#: lib/layouts/IEEEtran.layout:361 lib/layouts/aastex.layout:428
+#: lib/layouts/aastex.layout:449 lib/layouts/agutex.layout:224
 #: lib/layouts/amsdefs.inc:219 lib/layouts/beamer.layout:1174
 #: lib/layouts/cl2emult.layout:122 lib/layouts/copernicus.layout:371
 #: lib/layouts/egs.layout:644 lib/layouts/elsarticle.layout:300
@@ -7528,7 +7515,7 @@ msgstr "Literaturverzeichnis"
 msgid "References"
 msgstr "Literaturverzeichnis"
 
-#: lib/layouts/IEEEtran.layout:370 lib/layouts/aastex.layout:435
+#: lib/layouts/IEEEtran.layout:370 lib/layouts/aastex.layout:438
 #: lib/layouts/agutex.layout:233 lib/layouts/amsdefs.inc:231
 #: lib/layouts/beamer.layout:1183 lib/layouts/cl2emult.layout:131
 #: lib/layouts/copernicus.layout:379 lib/layouts/egs.layout:652
@@ -7542,7 +7529,7 @@ msgstr "Literaturverzeichnis"
 msgid "Bib preamble"
 msgstr "Lit.-Vorspann"
 
-#: lib/layouts/IEEEtran.layout:371 lib/layouts/aastex.layout:436
+#: lib/layouts/IEEEtran.layout:371 lib/layouts/aastex.layout:439
 #: lib/layouts/agutex.layout:234 lib/layouts/amsdefs.inc:232
 #: lib/layouts/beamer.layout:1184 lib/layouts/cl2emult.layout:132
 #: lib/layouts/copernicus.layout:380 lib/layouts/egs.layout:653
@@ -7556,7 +7543,7 @@ msgstr "Lit.-Vorspann"
 msgid "Bibliography Preamble"
 msgstr "Literaturverzeichnis-Vorspann"
 
-#: lib/layouts/IEEEtran.layout:372 lib/layouts/aastex.layout:437
+#: lib/layouts/IEEEtran.layout:372 lib/layouts/aastex.layout:440
 #: lib/layouts/agutex.layout:235 lib/layouts/amsdefs.inc:233
 #: lib/layouts/beamer.layout:1185 lib/layouts/cl2emult.layout:133
 #: lib/layouts/copernicus.layout:381 lib/layouts/egs.layout:654
@@ -7618,7 +7605,7 @@ msgstr "Biographie ohne Foto"
 #: lib/layouts/ijmpc.layout:355 lib/layouts/ijmpd.layout:358
 #: lib/layouts/llncs.layout:307 lib/layouts/siamltex.layout:118
 #: lib/layouts/svcommon.inc:656 lib/layouts/theorems-ams-bytype.inc:69
-#: lib/layouts/theorems-ams-chap-bytype.inc:71 lib/layouts/theorems-ams.inc:28
+#: lib/layouts/theorems-ams-chap-bytype.inc:84 lib/layouts/theorems-ams.inc:28
 #: lib/layouts/theorems-bytype.inc:28 lib/layouts/theorems-case.inc:32
 #: lib/layouts/theorems-named.module:13 lib/layouts/theorems-named.module:58
 #: lib/layouts/theorems-proof.inc:14 lib/layouts/theorems-starred.inc:27
@@ -7719,7 +7706,7 @@ msgstr "Adresse"
 #: lib/layouts/RJournal.layout:76 lib/layouts/RJournal.layout:77
 #: lib/layouts/aa.layout:374 lib/layouts/aa.layout:378
 #: lib/layouts/aapaper.inc:46 lib/layouts/aapaper.layout:90
-#: lib/layouts/aastex.layout:199 lib/layouts/aastex62.layout:140
+#: lib/layouts/aastex.layout:200 lib/layouts/aastex62.layout:141
 #: lib/layouts/achemso.layout:93 lib/layouts/acmart.layout:169
 #: lib/layouts/amsdefs.inc:152 lib/layouts/db_stdcharstyles.inc:72
 #: lib/layouts/db_stdcharstyles.inc:73 lib/layouts/ectaart.layout:73
@@ -7820,7 +7807,7 @@ msgid "Acknowledgements."
 msgstr "Danksagungen."
 
 #: lib/layouts/aa.layout:178 lib/layouts/aapaper.layout:66
-#: lib/layouts/aapaper.layout:139 lib/layouts/aastex.layout:96
+#: lib/layouts/aapaper.layout:139 lib/layouts/aastex.layout:97
 #: lib/layouts/aguplus.inc:29 lib/layouts/amsart.layout:65
 #: lib/layouts/amsbook.layout:56 lib/layouts/apa.layout:305
 #: lib/layouts/apax.inc:404 lib/layouts/beamer.layout:286
@@ -7843,7 +7830,7 @@ msgid "Section"
 msgstr "Abschnitt"
 
 #: lib/layouts/aa.layout:186 lib/layouts/aapaper.layout:70
-#: lib/layouts/aapaper.layout:149 lib/layouts/aastex.layout:109
+#: lib/layouts/aapaper.layout:149 lib/layouts/aastex.layout:110
 #: lib/layouts/aguplus.inc:44 lib/layouts/amsart.layout:106
 #: lib/layouts/amsbook.layout:66 lib/layouts/apa.layout:316
 #: lib/layouts/apax.inc:415 lib/layouts/beamer.layout:348
@@ -7861,7 +7848,7 @@ msgid "Subsection"
 msgstr "Unterabschnitt"
 
 #: lib/layouts/aa.layout:196 lib/layouts/aapaper.layout:74
-#: lib/layouts/aapaper.layout:161 lib/layouts/aastex.layout:122
+#: lib/layouts/aapaper.layout:161 lib/layouts/aastex.layout:123
 #: lib/layouts/amsart.layout:129 lib/layouts/amsbook.layout:75
 #: lib/layouts/apa.layout:326 lib/layouts/apax.inc:425
 #: lib/layouts/beamer.layout:410 lib/layouts/isprs.layout:170
@@ -7878,7 +7865,7 @@ msgid "Subsubsection"
 msgstr "Unterunterabschnitt"
 
 #: lib/layouts/aa.layout:227 lib/layouts/aapaper.layout:99
-#: lib/layouts/aapaper.layout:194 lib/layouts/aastex.layout:238
+#: lib/layouts/aapaper.layout:194 lib/layouts/aastex.layout:239
 #: lib/layouts/acmart.layout:133 lib/layouts/amsdefs.inc:74
 #: lib/layouts/beamer.layout:1111 lib/layouts/beamerposter.layout:41
 #: lib/layouts/dinbrief.layout:161 lib/layouts/egs.layout:540
@@ -7968,8 +7955,8 @@ msgstr "E-Mail"
 msgid "email:"
 msgstr "E-Mail:"
 
-#: lib/layouts/aapaper.inc:91 lib/layouts/aastex.layout:318
-#: lib/layouts/aastex62.layout:215 lib/layouts/apa.layout:212
+#: lib/layouts/aapaper.inc:91 lib/layouts/aastex.layout:319
+#: lib/layouts/aastex62.layout:216 lib/layouts/apa.layout:212
 #: lib/layouts/copernicus.layout:349 lib/layouts/egs.layout:577
 #: lib/layouts/elsart.layout:448 lib/layouts/isprs.layout:209
 #: lib/layouts/iucr.layout:230 lib/layouts/kluwer.layout:305
@@ -8048,7 +8035,7 @@ msgstr "Liste"
 msgid "American Astronomical Society (AASTeX v. 5)"
 msgstr "American Astronomical Society (AASTeX v. 5)"
 
-#: lib/layouts/aastex.layout:160 lib/layouts/aastex62.layout:164
+#: lib/layouts/aastex.layout:161 lib/layouts/aastex62.layout:165
 #: lib/layouts/achemso.layout:102 lib/layouts/acmart.layout:203
 #: lib/layouts/aguplus.inc:65 lib/layouts/apa.layout:159
 #: lib/layouts/apax.inc:148 lib/layouts/iucr.layout:175
@@ -8059,160 +8046,160 @@ msgstr "American Astronomical Society (AASTeX v. 5)"
 msgid "Affiliation"
 msgstr "Zugehörigkeit"
 
-#: lib/layouts/aastex.layout:177 lib/layouts/aastex62.layout:209
+#: lib/layouts/aastex.layout:178 lib/layouts/aastex62.layout:210
 msgid "Altaffilation"
 msgstr "Alt. Zugehörigkeit"
 
-#: lib/layouts/aastex.layout:186 lib/layouts/agutex.layout:124
+#: lib/layouts/aastex.layout:187 lib/layouts/agutex.layout:124
 #: src/mathed/InsetMathHull.cpp:1893 src/mathed/InsetMathHull.cpp:1902
 msgid "Number"
 msgstr "Nummer"
 
-#: lib/layouts/aastex.layout:187
+#: lib/layouts/aastex.layout:188
 msgid "Consecutive number for the alternative affiliations"
 msgstr "Fortlaufende Nummer für die alternative Zugehörigkeit"
 
-#: lib/layouts/aastex.layout:192
+#: lib/layouts/aastex.layout:193
 msgid "Alternative affiliation:"
 msgstr "Alternative Zugehörigkeit:"
 
-#: lib/layouts/aastex.layout:218
+#: lib/layouts/aastex.layout:219
 msgid "And"
 msgstr "Und"
 
-#: lib/layouts/aastex.layout:229 src/frontends/qt/GuiDocument.cpp:3089
+#: lib/layouts/aastex.layout:230 src/frontends/qt/GuiDocument.cpp:3089
 #: src/frontends/qt/GuiDocument.cpp:3101 src/frontends/qt/GuiDocument.cpp:3227
 #: src/frontends/qt/GuiDocument.cpp:3246
 msgid "and"
 msgstr "und"
 
-#: lib/layouts/aastex.layout:269
+#: lib/layouts/aastex.layout:270
 msgid "altaffilmark"
 msgstr "Alt. Zugehörigkeit (Fußnotenmarke)"
 
-#: lib/layouts/aastex.layout:273
+#: lib/layouts/aastex.layout:274
 msgid "altaffiliation mark"
 msgstr "Alt. Zugehörigkeit (Fußnotenmarke)"
 
-#: lib/layouts/aastex.layout:304
+#: lib/layouts/aastex.layout:305
 msgid "Subject headings:"
 msgstr "Schlagwörter:"
 
-#: lib/layouts/aastex.layout:329
+#: lib/layouts/aastex.layout:330
 msgid "[Acknowledgements]"
 msgstr "[Danksagungen]"
 
-#: lib/layouts/aastex.layout:339
+#: lib/layouts/aastex.layout:342
 msgid "PlaceFigure"
 msgstr "Abbildung platzieren"
 
-#: lib/layouts/aastex.layout:350
+#: lib/layouts/aastex.layout:353
 msgid "Place Figure here:"
 msgstr "Abbildung hier platzieren:"
 
-#: lib/layouts/aastex.layout:359
+#: lib/layouts/aastex.layout:362
 msgid "PlaceTable"
 msgstr "Tabelle platzieren"
 
-#: lib/layouts/aastex.layout:370
+#: lib/layouts/aastex.layout:373
 msgid "Place Table here:"
 msgstr "Tabelle hier platzieren:"
 
-#: lib/layouts/aastex.layout:389 lib/layouts/copernicus.layout:285
+#: lib/layouts/aastex.layout:392 lib/layouts/copernicus.layout:285
 msgid "[Appendix]"
 msgstr "[Anhang]"
 
-#: lib/layouts/aastex.layout:399
+#: lib/layouts/aastex.layout:402
 msgid "MathLetters"
 msgstr "Mathe-Buchstaben"
 
-#: lib/layouts/aastex.layout:453
+#: lib/layouts/aastex.layout:456
 msgid "NoteToEditor"
 msgstr "Hinweis an Herausgeber"
 
-#: lib/layouts/aastex.layout:465
+#: lib/layouts/aastex.layout:468
 msgid "Note to Editor:"
 msgstr "Hinweis an Herausgeber:"
 
-#: lib/layouts/aastex.layout:474 lib/layouts/aastex6.layout:102
-#: lib/layouts/aastex62.layout:113
+#: lib/layouts/aastex.layout:477 lib/layouts/aastex6.layout:103
+#: lib/layouts/aastex62.layout:114
 msgid "TableRefs"
 msgstr "Tabellen-Verweise"
 
-#: lib/layouts/aastex.layout:486
+#: lib/layouts/aastex.layout:489
 msgid "References. ---"
 msgstr "Referenzen. ---"
 
-#: lib/layouts/aastex.layout:494 lib/layouts/aastex6.layout:109
-#: lib/layouts/aastex62.layout:120
+#: lib/layouts/aastex.layout:497 lib/layouts/aastex6.layout:110
+#: lib/layouts/aastex62.layout:121
 msgid "TableComments"
 msgstr "Tabellen-Kommentare"
 
-#: lib/layouts/aastex.layout:506
+#: lib/layouts/aastex.layout:509
 msgid "Note. ---"
 msgstr "Notiz. ---"
 
-#: lib/layouts/aastex.layout:514
+#: lib/layouts/aastex.layout:517
 msgid "Table note"
 msgstr "Tabellenfußnote"
 
-#: lib/layouts/aastex.layout:522
+#: lib/layouts/aastex.layout:525
 msgid "Table note:"
 msgstr "Tabellenfußnote:"
 
-#: lib/layouts/aastex.layout:529
+#: lib/layouts/aastex.layout:532
 msgid "tablenotemark"
 msgstr "Tabellenfußnotenmarke"
 
-#: lib/layouts/aastex.layout:533
+#: lib/layouts/aastex.layout:536
 msgid "tablenote mark"
 msgstr "Tabellenfußnotenmarke"
 
-#: lib/layouts/aastex.layout:551
+#: lib/layouts/aastex.layout:554
 msgid "FigCaption"
 msgstr "Abbildungslegende"
 
-#: lib/layouts/aastex.layout:552
+#: lib/layouts/aastex.layout:555
 msgid "fig."
 msgstr "Abb."
 
-#: lib/layouts/aastex.layout:558
+#: lib/layouts/aastex.layout:561
 msgid "Filename to identify the corresponding figure file"
 msgstr "Dateiname zur Identifikation der entsprechenden Grafikdatei"
 
-#: lib/layouts/aastex.layout:573
+#: lib/layouts/aastex.layout:576
 msgid "Facility"
 msgstr "Einrichtung"
 
-#: lib/layouts/aastex.layout:585
+#: lib/layouts/aastex.layout:588
 msgid "Facility:"
 msgstr "Einrichtung:"
 
-#: lib/layouts/aastex.layout:599
+#: lib/layouts/aastex.layout:602
 msgid "Objectname"
 msgstr "Objektname"
 
-#: lib/layouts/aastex.layout:611
+#: lib/layouts/aastex.layout:614
 msgid "Obj:"
 msgstr "Objekt:"
 
-#: lib/layouts/aastex.layout:613 lib/layouts/aastex.layout:643
+#: lib/layouts/aastex.layout:616 lib/layouts/aastex.layout:646
 msgid "Recognized Name"
 msgstr "Wahrgenommener Name"
 
-#: lib/layouts/aastex.layout:614
+#: lib/layouts/aastex.layout:617
 msgid "Separate the recognized name of an object from text"
 msgstr "Trennt den wahrgenommenen Namen eines Objekts vom Text"
 
-#: lib/layouts/aastex.layout:629
+#: lib/layouts/aastex.layout:632
 msgid "Dataset"
 msgstr "Datensatz"
 
-#: lib/layouts/aastex.layout:641
+#: lib/layouts/aastex.layout:644
 msgid "Dataset:"
 msgstr "Datensatz:"
 
-#: lib/layouts/aastex.layout:644
+#: lib/layouts/aastex.layout:647
 msgid "Separate the dataset ID from text"
 msgstr "Separiert die Datensatz-ID vom Text"
 
@@ -8228,15 +8215,15 @@ msgstr "Software"
 msgid "Software:"
 msgstr "Software:"
 
-#: lib/layouts/aastex6.layout:99 lib/layouts/aastex62.layout:110
+#: lib/layouts/aastex6.layout:100 lib/layouts/aastex62.layout:111
 msgid "APPENDIX"
 msgstr "ANHANG"
 
-#: lib/layouts/aastex6.layout:103 lib/layouts/aastex62.layout:114
+#: lib/layouts/aastex6.layout:104 lib/layouts/aastex62.layout:115
 msgid "References-"
 msgstr "Literaturverzeichnis-"
 
-#: lib/layouts/aastex6.layout:110 lib/layouts/aastex62.layout:121
+#: lib/layouts/aastex6.layout:111 lib/layouts/aastex62.layout:122
 msgid "Note-"
 msgstr "Notiz-"
 
@@ -8244,31 +8231,31 @@ msgstr "Notiz-"
 msgid "American Astronomical Society (AASTeX v. 6.2)"
 msgstr "American Astronomical Society (AASTeX v. 6.2)"
 
-#: lib/layouts/aastex62.layout:126 lib/layouts/ectaart.layout:178
+#: lib/layouts/aastex62.layout:127 lib/layouts/ectaart.layout:178
 #: lib/layouts/ectaart.layout:181
 msgid "Corresponding Author"
 msgstr "Korrespondierender Autor"
 
-#: lib/layouts/aastex62.layout:132
+#: lib/layouts/aastex62.layout:133
 msgid "Corresponding author:"
 msgstr "Korrespondenzautor:"
 
-#: lib/layouts/aastex62.layout:151 lib/layouts/copernicus.layout:62
+#: lib/layouts/aastex62.layout:152 lib/layouts/copernicus.layout:62
 #: lib/layouts/egs.layout:375 lib/layouts/svmult.layout:83
 msgid "Author:"
 msgstr "Autor:"
 
-#: lib/layouts/aastex62.layout:157 lib/layouts/acmart.layout:190
+#: lib/layouts/aastex62.layout:158 lib/layouts/acmart.layout:190
 #: lib/layouts/apax.inc:603 lib/layouts/apax.inc:623
 msgid "ORCID"
 msgstr "ORCID"
 
-#: lib/layouts/aastex62.layout:158
+#: lib/layouts/aastex62.layout:159
 msgid "Enter the 16 digit ORCID as xxxx-xxxx-xxxx-xxxx"
 msgstr ""
 "Geben Sie die 16-stellige ORCID in dieser Form ein: xxxx-xxxx-xxxx-xxxx"
 
-#: lib/layouts/aastex62.layout:167 lib/layouts/apa.layout:172
+#: lib/layouts/aastex62.layout:168 lib/layouts/apa.layout:172
 #: lib/layouts/apax.inc:161 lib/layouts/copernicus.layout:83
 #: lib/layouts/egs.layout:397 lib/layouts/iucr.layout:179
 #: lib/layouts/jss.layout:78 lib/layouts/revtex4-x.inc:77
@@ -8276,53 +8263,53 @@ msgstr ""
 msgid "Affiliation:"
 msgstr "Zugehörigkeit:"
 
-#: lib/layouts/aastex62.layout:177 lib/layouts/revtex4-x.inc:141
+#: lib/layouts/aastex62.layout:178 lib/layouts/revtex4-x.inc:141
 #: lib/layouts/revtex4.layout:190
 msgid "Collaboration"
 msgstr "Kollaboration"
 
-#: lib/layouts/aastex62.layout:184 lib/layouts/revtex4-x.inc:144
+#: lib/layouts/aastex62.layout:185 lib/layouts/revtex4-x.inc:144
 #: lib/layouts/revtex4.layout:193
 msgid "Collaboration:"
 msgstr "Kollaboration:"
 
-#: lib/layouts/aastex62.layout:193
+#: lib/layouts/aastex62.layout:194
 msgid "Nocollaboration"
 msgstr "Keine Zusammenarbeit"
 
-#: lib/layouts/aastex62.layout:200
+#: lib/layouts/aastex62.layout:201
 msgid "No collaboration"
 msgstr "Keine Zusammenarbeit"
 
-#: lib/layouts/aastex62.layout:231 lib/layouts/copernicus.layout:248
+#: lib/layouts/aastex62.layout:232 lib/layouts/copernicus.layout:248
 msgid "Section Appendix"
 msgstr "Anhang (Abschnitt)"
 
-#: lib/layouts/aastex62.layout:235
+#: lib/layouts/aastex62.layout:236
 msgid "\\Alph{appendix}."
 msgstr "\\Alph{appendix}."
 
-#: lib/layouts/aastex62.layout:243 lib/layouts/copernicus.layout:256
+#: lib/layouts/aastex62.layout:244 lib/layouts/copernicus.layout:256
 msgid "Subappendix"
 msgstr "Unter-Anhang"
 
-#: lib/layouts/aastex62.layout:247 lib/layouts/copernicus.layout:260
+#: lib/layouts/aastex62.layout:248 lib/layouts/copernicus.layout:260
 msgid "Subsection Appendix"
 msgstr "Anhang (Unterabschnitt)"
 
-#: lib/layouts/aastex62.layout:251
+#: lib/layouts/aastex62.layout:252
 msgid "\\Alph{appendix}\\arabic{subappendix}."
 msgstr "\\Alph{appendix}\\arabic{subappendix}."
 
-#: lib/layouts/aastex62.layout:259 lib/layouts/copernicus.layout:268
+#: lib/layouts/aastex62.layout:260 lib/layouts/copernicus.layout:268
 msgid "Subsubappendix"
 msgstr "Unterunter-Anhang"
 
-#: lib/layouts/aastex62.layout:263 lib/layouts/copernicus.layout:272
+#: lib/layouts/aastex62.layout:264 lib/layouts/copernicus.layout:272
 msgid "Subsubsection Appendix"
 msgstr "Anhang (Unterunterabschnitt)"
 
-#: lib/layouts/aastex62.layout:267
+#: lib/layouts/aastex62.layout:268
 msgid "\\Alph{appendix}\\arabic{subappendix}.\\arabic{subsubappendix}."
 msgstr "\\Alph{appendix}\\arabic{subappendix}.\\arabic{subsubappendix}."
 
@@ -8820,7 +8807,7 @@ msgid "List of Tables"
 msgstr "Tabellenverzeichnis"
 
 #: lib/layouts/acmart.layout:539 lib/layouts/theorems-ams-bytype.inc:66
-#: lib/layouts/theorems-ams-chap-bytype.inc:68 lib/layouts/theorems-ams.inc:25
+#: lib/layouts/theorems-ams-chap-bytype.inc:81 lib/layouts/theorems-ams.inc:25
 #: lib/layouts/theorems-starred.inc:24
 #: lib/layouts/theorems-without-preamble.inc:31 lib/layouts/theorems.inc:25
 msgid "Definitions & Theorems"
@@ -8828,7 +8815,7 @@ msgstr "Definitionen & Theoreme"
 
 #: lib/layouts/acmart.layout:556 lib/layouts/beamer.layout:1313
 #: lib/layouts/theorems-ams-bytype.inc:78
-#: lib/layouts/theorems-ams-chap-bytype.inc:80 lib/layouts/theorems-ams.inc:37
+#: lib/layouts/theorems-ams-chap-bytype.inc:93 lib/layouts/theorems-ams.inc:37
 #: lib/layouts/theorems-bytype.inc:35 lib/layouts/theorems-named.module:22
 #: lib/layouts/theorems-starred.inc:38 lib/layouts/theorems.inc:37
 msgid "Additional Theorem Text"
@@ -8836,7 +8823,7 @@ msgstr "Zusätzlicher Theoremtext"
 
 #: lib/layouts/acmart.layout:557 lib/layouts/beamer.layout:1314
 #: lib/layouts/theorems-ams-bytype.inc:79
-#: lib/layouts/theorems-ams-chap-bytype.inc:81 lib/layouts/theorems-ams.inc:38
+#: lib/layouts/theorems-ams-chap-bytype.inc:94 lib/layouts/theorems-ams.inc:38
 #: lib/layouts/theorems-bytype.inc:36 lib/layouts/theorems-named.module:23
 #: lib/layouts/theorems-starred.inc:39 lib/layouts/theorems.inc:38
 msgid "Additional text appended to the theorem header"
@@ -8844,7 +8831,8 @@ msgstr "Zusatztext, der an den Theoremtitel angehängt wird"
 
 #: lib/layouts/acmart.layout:571 lib/layouts/ijmpc.layout:374
 #: lib/layouts/ijmpd.layout:381 lib/layouts/theorems-ams-bytype.inc:93
-#: lib/layouts/theorems-ams.inc:52 lib/layouts/theorems-bytype.inc:49
+#: lib/layouts/theorems-ams-chap-bytype.inc:108 lib/layouts/theorems-ams.inc:52
+#: lib/layouts/theorems-bytype.inc:49
 #: lib/layouts/theorems-without-preamble.inc:60 lib/layouts/theorems.inc:52
 msgid "Theorem \\thetheorem."
 msgstr "Theorem \\thetheorem."
@@ -9653,12 +9641,12 @@ msgstr "Sechs Zugehörigkeiten"
 #: lib/layouts/theorems-ams-extended-bytype.module:226
 #: lib/layouts/theorems-ams-extended-bytype.module:241
 #: lib/layouts/theorems-ams-extended-bytype.module:244
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:54
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:234
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:247
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:250
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:265
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:268
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:58
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:245
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:258
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:261
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:276
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:279
 #: lib/layouts/theorems-ams-extended.module:174
 #: lib/layouts/theorems-ams-extended.module:183
 #: lib/layouts/theorems-ams-extended.module:186
@@ -10290,12 +10278,10 @@ msgstr "Beispiele."
 #: lib/layouts/theorems-ams-bytype.inc:188
 #: lib/layouts/theorems-ams-bytype.inc:197
 #: lib/layouts/theorems-ams-bytype.inc:200
-#: lib/layouts/theorems-ams-bytype.module:42
-#: lib/layouts/theorems-ams-chap-bytype.inc:44
-#: lib/layouts/theorems-ams-chap-bytype.inc:210
+#: lib/layouts/theorems-ams-chap-bytype.inc:49
 #: lib/layouts/theorems-ams-chap-bytype.inc:223
-#: lib/layouts/theorems-ams-chap-bytype.inc:226
-#: lib/layouts/theorems-ams-chap-bytype.module:58
+#: lib/layouts/theorems-ams-chap-bytype.inc:236
+#: lib/layouts/theorems-ams-chap-bytype.inc:239
 #: lib/layouts/theorems-ams.inc:147 lib/layouts/theorems-ams.inc:157
 #: lib/layouts/theorems-ams.inc:160 lib/layouts/theorems-bytype.inc:144
 #: lib/layouts/theorems-bytype.inc:153 lib/layouts/theorems-bytype.inc:156
@@ -11930,6 +11916,7 @@ msgid "endnote"
 msgstr "Endnote"
 
 #: lib/layouts/endnotes.module:32 lib/layouts/endnotes.module:35
+#: lib/layouts/foottoend.module:20 lib/layouts/foottoend.module:23
 #: lib/layouts/memoir.layout:318 lib/layouts/memoir.layout:321
 msgid "Notes[[Endnotes]]"
 msgstr "Anmerkungen"
@@ -12810,11 +12797,6 @@ msgstr ""
 "Distributionen funktioniert. Mit Einfügen > Verzeichnisse > Endnoten legen "
 "Sie fest, wo die Endnoten erscheinen sollen."
 
-#: lib/layouts/foottoend.module:20 lib/layouts/foottoend.module:23
-#: lib/layouts/stdinsets.inc:13
-msgid "Notes"
-msgstr "Notizen"
-
 #: lib/layouts/foottoenotez.module:2
 msgid "Footnotes as Endnotes (Extended)"
 msgstr "Fußnoten als Endnoten (erweitert)"
@@ -13488,19 +13470,25 @@ msgstr ""
 "römisch nummerierten Einträgen"
 
 #: lib/layouts/ijmpc.layout:392 lib/layouts/ijmpd.layout:407
-#: lib/layouts/theorems-ams-bytype.inc:119 lib/layouts/theorems-bytype.inc:75
+#: lib/layouts/theorems-ams-bytype.inc:119
+#: lib/layouts/theorems-ams-chap-bytype.inc:138
+#: lib/layouts/theorems-bytype.inc:75
 #: lib/layouts/theorems-without-preamble.inc:85
 msgid "Corollary \\thecorollary."
 msgstr "Korollar \\thecorollary."
 
 #: lib/layouts/ijmpc.layout:396 lib/layouts/ijmpd.layout:415
-#: lib/layouts/theorems-ams-bytype.inc:137 lib/layouts/theorems-bytype.inc:93
+#: lib/layouts/theorems-ams-bytype.inc:137
+#: lib/layouts/theorems-ams-chap-bytype.inc:160
+#: lib/layouts/theorems-bytype.inc:93
 #: lib/layouts/theorems-without-preamble.inc:102
 msgid "Lemma \\thelemma."
 msgstr "Lemma \\thelemma."
 
 #: lib/layouts/ijmpc.layout:400 lib/layouts/ijmpd.layout:423
-#: lib/layouts/theorems-ams-bytype.inc:155 lib/layouts/theorems-bytype.inc:111
+#: lib/layouts/theorems-ams-bytype.inc:155
+#: lib/layouts/theorems-ams-chap-bytype.inc:182
+#: lib/layouts/theorems-bytype.inc:111
 #: lib/layouts/theorems-without-preamble.inc:119
 msgid "Proposition \\theproposition."
 msgstr "Satz \\theproposition."
@@ -13514,12 +13502,12 @@ msgstr "Satz \\theproposition."
 #: lib/layouts/theorems-ams-extended-bytype.module:436
 #: lib/layouts/theorems-ams-extended-bytype.module:450
 #: lib/layouts/theorems-ams-extended-bytype.module:453
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:72
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:468
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:482
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:485
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:499
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:502
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:82
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:479
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:493
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:496
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:510
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:513
 #: lib/layouts/theorems-ams-extended.module:378
 #: lib/layouts/theorems-ams-extended.module:388
 #: lib/layouts/theorems-ams-extended.module:391
@@ -13534,17 +13522,22 @@ msgstr "Frage"
 
 #: lib/layouts/ijmpc.layout:404 lib/layouts/ijmpd.layout:431
 #: lib/layouts/theorems-ams-extended-bytype.module:427
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:483
 #: lib/layouts/theorems-without-preamble.inc:406
 msgid "Question \\thequestion."
 msgstr "Frage \\thequestion."
 
 #: lib/layouts/ijmpc.layout:417 lib/layouts/ijmpd.layout:443
-#: lib/layouts/theorems-ams-bytype.inc:338 lib/layouts/theorems-bytype.inc:294
+#: lib/layouts/theorems-ams-bytype.inc:338
+#: lib/layouts/theorems-ams-chap-bytype.inc:401
+#: lib/layouts/theorems-bytype.inc:294
 msgid "Claim \\theclaim."
 msgstr "Behauptung \\theclaim."
 
 #: lib/layouts/ijmpc.layout:428 lib/layouts/ijmpd.layout:454
-#: lib/layouts/theorems-ams-bytype.inc:173 lib/layouts/theorems-bytype.inc:129
+#: lib/layouts/theorems-ams-bytype.inc:173
+#: lib/layouts/theorems-ams-chap-bytype.inc:204
+#: lib/layouts/theorems-bytype.inc:129
 #: lib/layouts/theorems-without-preamble.inc:153
 msgid "Conjecture \\theconjecture."
 msgstr "Vermutung \\theconjecture."
@@ -16572,7 +16565,7 @@ msgstr "Vermutung*"
 
 #: lib/layouts/siamltex.layout:123
 #: lib/layouts/theorems-ams-extended-bytype.module:127
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:139
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:150
 #: lib/layouts/theorems-ams-extended.module:88
 msgid "Algorithm*"
 msgstr "Algorithmus*"
@@ -16863,6 +16856,10 @@ msgstr "Randnotizen"
 msgid "Footnotes"
 msgstr "Fußnoten"
 
+#: lib/layouts/stdinsets.inc:13
+msgid "Notes"
+msgstr "Notizen"
+
 #: lib/layouts/stdinsets.inc:14 src/frontends/qt/GuiDocument.cpp:1784
 msgid "Branches"
 msgstr "Zweige"
@@ -16887,8 +16884,8 @@ msgstr "Fußnote"
 msgid "Greyedout"
 msgstr "Grauschrift"
 
-#: lib/layouts/stdinsets.inc:207 src/insets/InsetERT.cpp:157
-#: src/insets/InsetERT.cpp:159
+#: lib/layouts/stdinsets.inc:207 src/insets/InsetERT.cpp:164
+#: src/insets/InsetERT.cpp:166
 msgid "ERT"
 msgstr "ERT"
 
@@ -17390,27 +17387,37 @@ msgstr "Maßgeschneiderte Farbbox 4"
 msgid "Custom Color Box 5"
 msgstr "Maßgeschneiderte Farbbox 5"
 
-#: lib/layouts/theorems-ams-bytype.inc:191 lib/layouts/theorems-bytype.inc:147
+#: lib/layouts/theorems-ams-bytype.inc:191
+#: lib/layouts/theorems-ams-chap-bytype.inc:226
+#: lib/layouts/theorems-bytype.inc:147
 #: lib/layouts/theorems-without-preamble.inc:177
 msgid "Fact \\thefact."
 msgstr "Fakt \\thefact."
 
-#: lib/layouts/theorems-ams-bytype.inc:209 lib/layouts/theorems-bytype.inc:165
+#: lib/layouts/theorems-ams-bytype.inc:209
+#: lib/layouts/theorems-ams-chap-bytype.inc:248
+#: lib/layouts/theorems-bytype.inc:165
 #: lib/layouts/theorems-without-preamble.inc:194
 msgid "Definition \\thedefinition."
 msgstr "Definition \\thedefinition."
 
-#: lib/layouts/theorems-ams-bytype.inc:234 lib/layouts/theorems-bytype.inc:190
+#: lib/layouts/theorems-ams-bytype.inc:234
+#: lib/layouts/theorems-ams-chap-bytype.inc:277
+#: lib/layouts/theorems-bytype.inc:190
 #: lib/layouts/theorems-without-preamble.inc:219
 msgid "Example \\theexample."
 msgstr "Beispiel \\theexample."
 
-#: lib/layouts/theorems-ams-bytype.inc:253 lib/layouts/theorems-bytype.inc:209
+#: lib/layouts/theorems-ams-bytype.inc:253
+#: lib/layouts/theorems-ams-chap-bytype.inc:300
+#: lib/layouts/theorems-bytype.inc:209
 #: lib/layouts/theorems-without-preamble.inc:238
 msgid "Problem \\theproblem."
 msgstr "Problem \\theproblem."
 
-#: lib/layouts/theorems-ams-bytype.inc:272 lib/layouts/theorems-bytype.inc:228
+#: lib/layouts/theorems-ams-bytype.inc:272
+#: lib/layouts/theorems-ams-chap-bytype.inc:323
+#: lib/layouts/theorems-bytype.inc:228
 #: lib/layouts/theorems-without-preamble.inc:321
 msgid "Exercise \\theexercise."
 msgstr "Aufgabe \\theexercise."
@@ -17439,58 +17446,6 @@ msgstr ""
 "das gesamte Dokument. Verwenden Sie für abschnitts- und kapitelweise "
 "Nummerierung eines der entsprechenden Module."
 
-#: lib/layouts/theorems-ams-chap-bytype.inc:95
-msgid "Theorem \\thechapter.\\thetheorem."
-msgstr "Theorem \\thechapter.\\thetheorem."
-
-#: lib/layouts/theorems-ams-chap-bytype.inc:125
-msgid "Corollary \\thechapter.\\thecorollary."
-msgstr "Korollar \\thechapter.\\thecorollary."
-
-#: lib/layouts/theorems-ams-chap-bytype.inc:147
-msgid "Lemma \\thechapter.\\thelemma."
-msgstr "Lemma \\thechapter.\\thelemma."
-
-#: lib/layouts/theorems-ams-chap-bytype.inc:169
-msgid "Proposition \\thechapter.\\theproposition."
-msgstr "Satz \\thechapter.\\theproposition."
-
-#: lib/layouts/theorems-ams-chap-bytype.inc:191
-msgid "Conjecture \\thechapter.\\theconjecture."
-msgstr "Vermutung \\thechapter.\\theconjecture."
-
-#: lib/layouts/theorems-ams-chap-bytype.inc:213
-msgid "Fact \\thechapter.\\thefact."
-msgstr "Fakt \\thechapter.\\thefact."
-
-#: lib/layouts/theorems-ams-chap-bytype.inc:235
-msgid "Definition \\thechapter.\\thedefinition."
-msgstr "Definition \\thechapter.\\thedefinition."
-
-#: lib/layouts/theorems-ams-chap-bytype.inc:264
-msgid "Example \\thechapter.\\theexample."
-msgstr "Beispiel \\thechapter.\\theexample."
-
-#: lib/layouts/theorems-ams-chap-bytype.inc:287
-msgid "Problem \\thechapter.\\theproblem."
-msgstr "Problem \\thechapter.\\theproblem."
-
-#: lib/layouts/theorems-ams-chap-bytype.inc:310
-msgid "Exercise \\thechapter.\\theexercise."
-msgstr "Aufgabe \\thechapter.\\theexercise."
-
-#: lib/layouts/theorems-ams-chap-bytype.inc:333
-msgid "Solution \\thechapter.\\thesolution."
-msgstr "Lösung \\thechapter.\\thesolution."
-
-#: lib/layouts/theorems-ams-chap-bytype.inc:356
-msgid "Remark \\thechapter.\\theremark."
-msgstr "Bemerkung \\thechapter.\\theremark."
-
-#: lib/layouts/theorems-ams-chap-bytype.inc:388
-msgid "Claim \\thechapter.\\theclaim."
-msgstr "Behauptung \\thechapter.\\theclaim."
-
 #: lib/layouts/theorems-ams-chap-bytype.module:2
 msgid "AMS Theorems (Numbered by Type within Chapters)"
 msgstr "AMS-Theoreme (kapitelweise nach Typ nummeriert)"
@@ -17541,12 +17496,12 @@ msgstr ""
 #: lib/layouts/theorems-ams-extended-bytype.module:401
 #: lib/layouts/theorems-ams-extended-bytype.module:416
 #: lib/layouts/theorems-ams-extended-bytype.module:419
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:69
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:430
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:443
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:446
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:461
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:464
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:78
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:441
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:454
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:457
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:472
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:475
 #: lib/layouts/theorems-ams-extended.module:344
 #: lib/layouts/theorems-ams-extended.module:354
 #: lib/layouts/theorems-ams-extended.module:357
@@ -17556,162 +17511,172 @@ msgid "Assumption"
 msgstr "Annahme"
 
 #: lib/layouts/theorems-ams-extended-bytype.module:78
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:92
 msgid "Criterion \\thecriterion."
 msgstr "Kriterium \\thecriterion."
 
 #: lib/layouts/theorems-ams-extended-bytype.module:92
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:100
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:111
 #: lib/layouts/theorems-ams-extended.module:53
 msgid "Criterion*"
 msgstr "Kriterium*"
 
 #: lib/layouts/theorems-ams-extended-bytype.module:95
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:103
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:114
 #: lib/layouts/theorems-ams-extended.module:56
 msgid "Criterion."
 msgstr "Kriterium."
 
 #: lib/layouts/theorems-ams-extended-bytype.module:112
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:131
 msgid "Algorithm \\thealgorithm."
 msgstr "Algorithmus \\thealgorithm."
 
 #: lib/layouts/theorems-ams-extended-bytype.module:130
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:142
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:153
 #: lib/layouts/theorems-ams-extended.module:91
 msgid "Algorithm."
 msgstr "Algorithmus."
 
 #: lib/layouts/theorems-ams-extended-bytype.module:147
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:170
 msgid "Axiom \\theaxiom."
 msgstr "Axiom \\theaxiom."
 
 #: lib/layouts/theorems-ams-extended-bytype.module:162
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:178
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:189
 #: lib/layouts/theorems-ams-extended.module:123
 msgid "Axiom*"
 msgstr "Axiom*"
 
 #: lib/layouts/theorems-ams-extended-bytype.module:165
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:181
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:192
 #: lib/layouts/theorems-ams-extended.module:126
 msgid "Axiom."
 msgstr "Axiom."
 
 #: lib/layouts/theorems-ams-extended-bytype.module:182
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:209
 msgid "Condition \\thecondition."
 msgstr "Bedingung \\thecondition."
 
 #: lib/layouts/theorems-ams-extended-bytype.module:197
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:217
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:228
 #: lib/layouts/theorems-ams-extended.module:157
 msgid "Condition*"
 msgstr "Bedingung*"
 
 #: lib/layouts/theorems-ams-extended-bytype.module:200
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:220
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:231
 #: lib/layouts/theorems-ams-extended.module:160
 msgid "Condition."
 msgstr "Bedingung."
 
 #: lib/layouts/theorems-ams-extended-bytype.module:217
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:248
 #: lib/layouts/theorems-without-preamble.inc:424
 msgid "Note \\thenote."
 msgstr "Notiz \\thenote."
 
 #: lib/layouts/theorems-ams-extended-bytype.module:232
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:256
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:267
 #: lib/layouts/theorems-ams-extended.module:191
 msgid "Note*"
 msgstr "Notiz*"
 
 #: lib/layouts/theorems-ams-extended-bytype.module:235
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:259
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:270
 #: lib/layouts/theorems-ams-extended.module:194
 msgid "Note."
 msgstr "Notiz."
 
 #: lib/layouts/theorems-ams-extended-bytype.module:252
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:287
 msgid "Notation \\thenotation."
 msgstr "Notation \\thenotation."
 
 #: lib/layouts/theorems-ams-extended-bytype.module:267
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:295
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:306
 #: lib/layouts/theorems-ams-extended.module:225
 msgid "Notation*"
 msgstr "Notation*"
 
 #: lib/layouts/theorems-ams-extended-bytype.module:270
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:298
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:309
 #: lib/layouts/theorems-ams-extended.module:228
 msgid "Notation."
 msgstr "Notation."
 
 #: lib/layouts/theorems-ams-extended-bytype.module:287
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:326
 msgid "Summary \\thesummary."
 msgstr "Zusammenfassung \\thesummary."
 
 #: lib/layouts/theorems-ams-extended-bytype.module:302
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:335
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:346
 #: lib/layouts/theorems-ams-extended.module:259
 msgid "Summary*"
 msgstr "Zusammenfassung*"
 
 #: lib/layouts/theorems-ams-extended-bytype.module:305
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:338
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:349
 #: lib/layouts/theorems-ams-extended.module:262
 msgid "Summary."
 msgstr "Zusammenfassung."
 
 #: lib/layouts/theorems-ams-extended-bytype.module:322
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:366
 msgid "Acknowledgement \\theacknowledgement."
 msgstr "Danksagung \\theacknowledgement."
 
 #: lib/layouts/theorems-ams-extended-bytype.module:337
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:374
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:385
 #: lib/layouts/theorems-ams-extended.module:293
 msgid "Acknowledgement*"
 msgstr "Danksagung*"
 
 #: lib/layouts/theorems-ams-extended-bytype.module:357
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:405
 msgid "Conclusion \\theconclusion."
 msgstr "Schlussfolgerung \\theconclusion."
 
 #: lib/layouts/theorems-ams-extended-bytype.module:372
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:413
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:424
 #: lib/layouts/theorems-ams-extended.module:327
 msgid "Conclusion*"
 msgstr "Schlussfolgerung*"
 
 #: lib/layouts/theorems-ams-extended-bytype.module:375
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:416
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:427
 #: lib/layouts/theorems-ams-extended.module:330
 msgid "Conclusion."
 msgstr "Schlussfolgerung."
 
 #: lib/layouts/theorems-ams-extended-bytype.module:392
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:444
 msgid "Assumption \\theassumption."
 msgstr "Annahme \\theassumption."
 
 #: lib/layouts/theorems-ams-extended-bytype.module:407
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:452
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:463
 #: lib/layouts/theorems-ams-extended.module:362
 msgid "Assumption*"
 msgstr "Annahme*"
 
 #: lib/layouts/theorems-ams-extended-bytype.module:410
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:455
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:466
 #: lib/layouts/theorems-ams-extended.module:365
 msgid "Assumption."
 msgstr "Annahme."
 
 #: lib/layouts/theorems-ams-extended-bytype.module:441
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:490
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:501
 #: lib/layouts/theorems-ams-extended.module:395
 msgid "Question*"
 msgstr "Frage*"
 
 #: lib/layouts/theorems-ams-extended-bytype.module:444
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:493
+#: lib/layouts/theorems-ams-extended-chap-bytype.module:504
 #: lib/layouts/theorems-ams-extended.module:398
 msgid "Question."
 msgstr "Frage."
@@ -17739,50 +17704,6 @@ msgstr ""
 "Kriterium 1.1, Kriterium 1.2, Axiom 1.1, Annahme 1.1, Kriterium 1.3, ..., "
 "und nicht Kriterium 1, Kriterium 2, Axiom 3, Annahme 4, ...)."
 
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:81
-msgid "Criterion \\thechapter.\\thecriterion."
-msgstr "Kriterium \\thechapter.\\thecriterion."
-
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:120
-msgid "Algorithm \\thechapter.\\thealgorithm."
-msgstr "Algorithmus \\thechapter.\\thealgorithm."
-
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:159
-msgid "Axiom \\thechapter.\\theaxiom."
-msgstr "Axiom \\thechapter.\\theaxiom."
-
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:198
-msgid "Condition \\thechapter.\\thecondition."
-msgstr "Bedingung \\thechapter.\\thecondition."
-
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:237
-msgid "Note \\thechapter.\\thenote."
-msgstr "Notiz \\thechapter.\\thenote."
-
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:276
-msgid "Notation \\thechapter.\\thenotation."
-msgstr "Notation \\thechapter.\\thenotation."
-
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:315
-msgid "Summary \\thechapter.\\thesummary."
-msgstr "Zusammenfassung \\thechapter.\\thesummary."
-
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:355
-msgid "Acknowledgement \\thechapter.\\theacknowledgement."
-msgstr "Danksagung \\thechapter.\\theacknowledgement."
-
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:394
-msgid "Conclusion \\thechapter.\\theconclusion."
-msgstr "Schlussfolgerung \\thechapter.\\theconclusion."
-
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:433
-msgid "Assumption \\thechapter.\\theassumption."
-msgstr "Annahme \\thechapter.\\theassumption."
-
-#: lib/layouts/theorems-ams-extended-chap-bytype.module:472
-msgid "Question \\thechapter.\\thequestion."
-msgstr "Frage \\thechapter.\\thequestion."
-
 #: lib/layouts/theorems-ams-extended.module:2
 msgid "AMS Theorems (Extended)"
 msgstr "AMS-Theoreme (erweitert)"
@@ -19524,20 +19445,20 @@ msgstr "Als Querverweis kopieren|k"
 
 #: lib/ui/stdcontext.inc:61 lib/ui/stdcontext.inc:353 lib/ui/stdmenus.inc:108
 #: lib/ui/stdtoolbars.inc:86 src/Text3.cpp:1536
-#: src/mathed/InsetMathNest.cpp:558
+#: src/mathed/InsetMathNest.cpp:560
 msgid "Cut"
 msgstr "Ausschneiden"
 
 #: lib/ui/stdcontext.inc:62 lib/ui/stdcontext.inc:354 lib/ui/stdmenus.inc:109
 #: lib/ui/stdtoolbars.inc:87 src/Text3.cpp:1541
-#: src/mathed/InsetMathNest.cpp:567
+#: src/mathed/InsetMathNest.cpp:569
 msgid "Copy"
 msgstr "Kopieren"
 
 #: lib/ui/stdcontext.inc:63 lib/ui/stdcontext.inc:355 lib/ui/stdmenus.inc:110
 #: lib/ui/stdtoolbars.inc:88 src/Text3.cpp:1481
-#: src/frontends/qt/GuiToolbar.cpp:410 src/mathed/InsetMathGrid.cpp:1586
-#: src/mathed/InsetMathNest.cpp:537
+#: src/frontends/qt/GuiToolbar.cpp:420 src/mathed/InsetMathGrid.cpp:1586
+#: src/mathed/InsetMathNest.cpp:539
 msgid "Paste"
 msgstr "Einfügen"
 
@@ -26673,7 +26594,7 @@ msgstr "MS-Word Office-Open XML"
 msgid "Table (CSV)"
 msgstr "Tabelle (CSV)"
 
-#: lib/configure.py:783 src/frontends/qt/GuiView.cpp:1447
+#: lib/configure.py:783 src/frontends/qt/GuiView.cpp:1491
 #: src/mathed/InsetMathMacroTemplate.cpp:539
 msgid "LyX"
 msgstr "LyX"
@@ -26800,12 +26721,8 @@ msgid "External Material"
 msgstr "Externes Material"
 
 #: lib/examples/Articles:0
-msgid "Minted File Listing"
-msgstr "Minted-Programmlistings (Dateien)"
-
-#: lib/examples/Articles:0
-msgid "Minted Listings"
-msgstr "Minted-Programmlistings"
+msgid "Feynman Diagrams"
+msgstr "Feynman-Diagramme"
 
 #: lib/examples/Articles:0
 msgid "Instant Preview"
@@ -26816,22 +26733,30 @@ msgid "Itemize Bullets"
 msgstr "Auflistungszeichen"
 
 #: lib/examples/Articles:0
-msgid "Feynman Diagrams"
-msgstr "Feynman-Diagramme"
+msgid "Minted File Listing"
+msgstr "Minted-Programmlistings (Dateien)"
 
 #: lib/examples/Articles:0
-msgid "XY-Pic"
-msgstr "XY-Pic"
+msgid "Minted Listings"
+msgstr "Minted-Programmlistings"
 
 #: lib/examples/Articles:0
 msgid "XY-Figure"
 msgstr "XY-Figure"
 
 #: lib/examples/Articles:0
+msgid "XY-Pic"
+msgstr "XY-Pic"
+
+#: lib/examples/Articles:0
 msgid "Graphics and Insets"
 msgstr "Grafiken und Einfügungen"
 
 #: lib/examples/Articles:0
+msgid "Serial Letter 1"
+msgstr "Serienbrief 1"
+
+#: lib/examples/Articles:0
 msgid "Serial Letter 2"
 msgstr "Serienbrief 2"
 
@@ -26840,38 +26765,38 @@ msgid "Serial Letter 3"
 msgstr "Serienbrief 3"
 
 #: lib/examples/Articles:0
-msgid "Serial Letter 1"
-msgstr "Serienbrief 1"
-
-#: lib/examples/Articles:0
 msgid "Localization Test"
 msgstr "Ãœbersetzungstest"
 
 #: lib/examples/Articles:0
-msgid "Noweb Listerrors"
-msgstr "Noweb-Fehlerbericht"
-
-#: lib/examples/Articles:0
-msgid "Multilingual Captions"
-msgstr "Mehrsprachige Legenden"
+msgid "Hazard and Precautionary Statements"
+msgstr "H- und P-Sätze"
 
 #: lib/examples/Articles:0
 msgid "LilyPond Book"
 msgstr "LilyPond-Buch"
 
 #: lib/examples/Articles:0
-msgid "Hazard and Precautionary Statements"
-msgstr "H- und P-Sätze"
+msgid "Multilingual Captions"
+msgstr "Mehrsprachige Legenden"
 
 #: lib/examples/Articles:0
 msgid "Noweb2LyX"
 msgstr "Noweb2LyX"
 
+#: lib/examples/Articles:0
+msgid "Noweb Listerrors"
+msgstr "Noweb-Fehlerbericht"
+
 #: lib/examples/Articles:0 src/frontends/qt/GuiDocument.cpp:1767
 msgid "Modules"
 msgstr "Module"
 
 #: lib/examples/Articles:0
+msgid "Beamer (Complex)"
+msgstr "Beamer (komplex)"
+
+#: lib/examples/Articles:0
 msgid "Foils"
 msgstr "Foils"
 
@@ -26880,100 +26805,100 @@ msgid "Foils Landslide"
 msgstr "Foils (Querformat)"
 
 #: lib/examples/Articles:0
-msgid "Beamer (Complex)"
-msgstr "Beamer (komplex)"
-
-#: lib/examples/Articles:0
 msgid "Welcome"
 msgstr "Willkommen"
 
 #: lib/examples/Articles:0
+msgid "Multilingual Typesetting with CJKutf8"
+msgstr "Mehrsprachige Dokumente mit CJKutf8"
+
+#: lib/examples/Articles:0
 msgid "Multilingual Typesetting with platex"
 msgstr "Mehrsprachige Dokumente mit platex"
 
 #: lib/examples/Articles:0
-msgid "Multilingual Typesetting with CJKutf8"
-msgstr "Mehrsprachige Dokumente mit CJKutf8"
+msgid "IEEE Transactions Conference"
+msgstr "IEEE Transactions Conference"
+
+#: lib/examples/Articles:0
+msgid "IEEE Transactions Journal"
+msgstr "IEEE Transactions Journal"
 
 #: lib/examples/Articles:0
 msgid "Mathematical Monthly"
 msgstr "Mathematical Monthly"
 
 #: lib/examples/Articles:0
+msgid "Springers Global Journal Template (V. 3)"
+msgstr "Springers globale Vorlage für Zeitschriften (V. 3)"
+
+#: lib/examples/Articles:0
 msgid "Hebrew Article (KOMA-Script)"
 msgstr "Hebräischer Aufsatz (KOMA-Script)"
 
 #: lib/examples/Articles:0
-msgid "Springers Global Journal Template (V. 3)"
-msgstr "Springers globale Vorlage für Zeitschriften (V. 3)"
+msgid "00 Main File"
+msgstr "00 Hauptdatei"
 
 #: lib/examples/Articles:0
-msgid "IEEE Transactions Journal"
-msgstr "IEEE Transactions Journal"
+msgid "01 Dedication"
+msgstr "01 Widmung"
 
 #: lib/examples/Articles:0
-msgid "IEEE Transactions Conference"
-msgstr "IEEE Transactions Conference"
+msgid "02 Foreword"
+msgstr "02 Vorwort"
 
 #: lib/examples/Articles:0
-msgid "08 Author"
-msgstr "08 Autor"
+msgid "03 Preface"
+msgstr "03 Vorwort"
 
 #: lib/examples/Articles:0
-msgid "05 Contributor List"
-msgstr "05 Liste der Mitwirkenden"
+msgid "04 Acknowledgements"
+msgstr "04 Danksagungen"
 
 #: lib/examples/Articles:0
-msgid "07 Part"
-msgstr "07 Teil"
+msgid "05 Contributor List"
+msgstr "05 Liste der Mitwirkenden"
 
 #: lib/examples/Articles:0
 msgid "06 Acronym"
 msgstr "06 Akronyme"
 
 #: lib/examples/Articles:0
-msgid "03 Preface"
-msgstr "03 Vorwort"
+msgid "07 Part"
+msgstr "07 Teil"
 
 #: lib/examples/Articles:0
-msgid "00 Main File"
-msgstr "00 Hauptdatei"
+msgid "08 Author"
+msgstr "08 Autor"
 
 #: lib/examples/Articles:0
-msgid "11 References"
-msgstr "11 Literaturverzeichnis"
+msgid "09 Appendix"
+msgstr "09 Anhang"
 
 #: lib/examples/Articles:0
 msgid "10 Glossary"
 msgstr "10 Glossar"
 
 #: lib/examples/Articles:0
-msgid "04 Acknowledgements"
-msgstr "04 Danksagungen"
-
-#: lib/examples/Articles:0
-msgid "02 Foreword"
-msgstr "02 Vorwort"
-
-#: lib/examples/Articles:0
-msgid "01 Dedication"
-msgstr "01 Widmung"
-
-#: lib/examples/Articles:0
-msgid "09 Appendix"
-msgstr "09 Anhang"
+msgid "11 References"
+msgstr "11 Literaturverzeichnis"
 
 #: lib/examples/Articles:0
 msgid "05 Acronym"
 msgstr "05 Akronyme"
 
 #: lib/examples/Articles:0
+msgid "06 Part"
+msgstr "06 Teil"
+
+#: lib/examples/Articles:0
 msgid "07 Chapter"
 msgstr "07 Kapitel"
 
 #: lib/examples/Articles:0
-msgid "06 Part"
-msgstr "06 Teil"
+msgid "08 Appendix"
+msgstr "08 Anhang"
 
 #: lib/examples/Articles:0
 msgid "09 Glossary"
@@ -26984,26 +26909,22 @@ msgid "10 Solutions"
 msgstr "10 Lösungen"
 
 #: lib/examples/Articles:0
-msgid "08 Appendix"
-msgstr "08 Anhang"
+msgid "Colored"
+msgstr "Farbig"
 
 #: lib/examples/Articles:0
 msgid "Simple"
 msgstr "Schlicht"
 
 #: lib/examples/Articles:0
-msgid "Colored"
-msgstr "Farbig"
+msgid "Chapter 1"
+msgstr "Kapitel 1"
 
 #: lib/examples/Articles:0
 msgid "Chapter 2"
 msgstr "Kapitel 2"
 
 #: lib/examples/Articles:0
-msgid "Chapter 1"
-msgstr "Kapitel 1"
-
-#: lib/examples/Articles:0
 msgid "Main File"
 msgstr "Hauptdatei"
 
@@ -27117,7 +27038,7 @@ msgstr ""
 "\\lyxdeleted im LaTeX-Vorspann neu."
 
 #: src/Buffer.cpp:1089 src/BufferParams.cpp:469 src/frontends/qt/GuiLog.cpp:257
-#: src/insets/InsetIndex.cpp:641
+#: src/insets/InsetIndex.cpp:642
 msgid "Index"
 msgstr "Stichwortverzeichnis"
 
@@ -27217,8 +27138,8 @@ msgid "Overwrite modified file?"
 msgstr "Modifizierte Datei überschreiben?"
 
 #: src/Buffer.cpp:1462 src/Exporter.cpp:50
-#: src/frontends/qt/GuiClipboard.cpp:247 src/frontends/qt/GuiView.cpp:2602
-#: src/frontends/qt/GuiView.cpp:2870 src/frontends/qt/GuiView.cpp:2973
+#: src/frontends/qt/GuiClipboard.cpp:247 src/frontends/qt/GuiView.cpp:2646
+#: src/frontends/qt/GuiView.cpp:2914 src/frontends/qt/GuiView.cpp:3017
 msgid "&Overwrite"
 msgstr "&Ãœberschreiben"
 
@@ -27458,7 +27379,7 @@ msgstr "Zweig \"%1$s\" existiert bereits."
 msgid "Error viewing the output file."
 msgstr "Fehler bei der Ansicht der Ausgabedatei."
 
-#: src/Buffer.cpp:3363 src/frontends/qt/GuiView.cpp:2431
+#: src/Buffer.cpp:3363 src/frontends/qt/GuiView.cpp:2475
 #: src/frontends/qt/Validator.cpp:222 src/insets/ExternalSupport.cpp:395
 #: src/insets/InsetGraphics.cpp:690 src/insets/InsetInclude.cpp:602
 msgid "Invalid filename"
@@ -27545,7 +27466,7 @@ msgstr ""
 msgid "Couldn't export file"
 msgstr "Die Datei konnte nicht exportiert werden"
 
-#: src/Buffer.cpp:4490 src/frontends/qt/GuiView.cpp:2575
+#: src/Buffer.cpp:4490 src/frontends/qt/GuiView.cpp:2619
 msgid "File name error"
 msgstr "Fehler im Dateinamen"
 
@@ -27562,7 +27483,7 @@ msgstr ""
 "enthält Leerzeichen, aber Ihre TeX-Installation erlaubt dies nicht. Bitte "
 "speichern Sie Ihr Dokument in einem Verzeichnis ohne Leerzeichen."
 
-#: src/Buffer.cpp:4580 src/Buffer.cpp:4610 src/frontends/qt/GuiView.cpp:755
+#: src/Buffer.cpp:4580 src/Buffer.cpp:4610 src/frontends/qt/GuiView.cpp:756
 msgid "Document export cancelled."
 msgstr "Der Export des Dokuments wurde abgebrochen."
 
@@ -27712,12 +27633,12 @@ msgstr ""
 msgid "Senseless!!! "
 msgstr "Sinnlos!!! "
 
-#: src/Buffer.cpp:5429
+#: src/Buffer.cpp:5424
 #, c-format
 msgid "Document %1$s reloaded."
 msgstr "Dokument %1$s neu geladen."
 
-#: src/Buffer.cpp:5432
+#: src/Buffer.cpp:5427
 #, c-format
 msgid "Could not reload document %1$s."
 msgstr "Kann Dokument %1$s nicht neu laden."
@@ -27830,7 +27751,7 @@ msgid "Document class not available"
 msgstr "Die Dokumentklasse ist nicht verfügbar"
 
 #: src/BufferParams.cpp:1751 src/BufferParams.cpp:2194 src/Encoding.cpp:253
-#: src/Paragraph.cpp:2799 src/frontends/qt/LaTeXHighlighter.cpp:122
+#: src/Paragraph.cpp:2790 src/frontends/qt/LaTeXHighlighter.cpp:122
 #: src/insets/InsetCommandParams.cpp:510 src/insets/InsetCommandParams.cpp:518
 #: src/insets/InsetGraphics.cpp:885 src/insets/InsetGraphics.cpp:893
 #: src/insets/InsetListings.cpp:301 src/insets/InsetListings.cpp:309
@@ -27840,7 +27761,7 @@ msgid "LyX Warning: "
 msgstr "LyX-Warnung: "
 
 #: src/BufferParams.cpp:1752 src/BufferParams.cpp:2195 src/Encoding.cpp:254
-#: src/Paragraph.cpp:2800 src/insets/InsetCommandParams.cpp:511
+#: src/Paragraph.cpp:2791 src/insets/InsetCommandParams.cpp:511
 #: src/insets/InsetCommandParams.cpp:519 src/insets/InsetGraphics.cpp:886
 #: src/insets/InsetGraphics.cpp:894 src/insets/InsetListings.cpp:302
 #: src/insets/InsetListings.cpp:310 src/mathed/MathExtern.cpp:1441
@@ -27963,7 +27884,7 @@ msgid "This portion of the document is deleted."
 msgstr "Dieser Teil des Dokuments wird gelöscht."
 
 #: src/BufferView.cpp:1141 src/BufferView.cpp:2185
-#: src/frontends/qt/GuiView.cpp:4029 src/frontends/qt/GuiView.cpp:4116
+#: src/frontends/qt/GuiView.cpp:4073 src/frontends/qt/GuiView.cpp:4160
 msgid "Absolute filename expected."
 msgstr "Ein absoluter Dateipfad wird erwartet."
 
@@ -28167,400 +28088,400 @@ msgstr ""
 msgid "ChkTeX warning id # %1$s"
 msgstr "ChkTeX-Warnung Nr. # %1$s"
 
-#: src/Color.cpp:203 src/insets/InsetBibtex.cpp:192
+#: src/Color.cpp:231 src/insets/InsetBibtex.cpp:192
 #: src/insets/InsetBibtex.cpp:211
 msgid "none"
 msgstr "keine"
 
-#: src/Color.cpp:204
+#: src/Color.cpp:232
 msgid "black"
 msgstr "Schwarz"
 
-#: src/Color.cpp:205
+#: src/Color.cpp:233
 msgid "white"
 msgstr "Weiß"
 
-#: src/Color.cpp:206
+#: src/Color.cpp:234
 msgid "blue"
 msgstr "Blau"
 
-#: src/Color.cpp:207
+#: src/Color.cpp:235
 msgid "brown"
 msgstr "Braun"
 
-#: src/Color.cpp:208
+#: src/Color.cpp:236
 msgid "cyan"
 msgstr "Cyan"
 
-#: src/Color.cpp:209
+#: src/Color.cpp:237
 msgid "darkgray"
 msgstr "Dunkelgrau"
 
-#: src/Color.cpp:210
+#: src/Color.cpp:238
 msgid "gray"
 msgstr "Grau"
 
-#: src/Color.cpp:211
+#: src/Color.cpp:239
 msgid "green"
 msgstr "Grün"
 
-#: src/Color.cpp:212
+#: src/Color.cpp:240
 msgid "lightgray"
 msgstr "Hellgrau"
 
-#: src/Color.cpp:213
+#: src/Color.cpp:241
 msgid "lime"
 msgstr "Neongrün"
 
-#: src/Color.cpp:214
+#: src/Color.cpp:242
 msgid "magenta"
 msgstr "Magenta"
 
-#: src/Color.cpp:215
+#: src/Color.cpp:243
 msgid "olive"
 msgstr "Olivgrün"
 
-#: src/Color.cpp:216
+#: src/Color.cpp:244
 msgid "orange"
 msgstr "Orange"
 
-#: src/Color.cpp:217
+#: src/Color.cpp:245
 msgid "pink"
 msgstr "Pink"
 
-#: src/Color.cpp:218
+#: src/Color.cpp:246
 msgid "purple"
 msgstr "Purpur"
 
-#: src/Color.cpp:219
+#: src/Color.cpp:247
 msgid "red"
 msgstr "Rot"
 
-#: src/Color.cpp:220
+#: src/Color.cpp:248
 msgid "teal"
 msgstr "Blaugrün"
 
-#: src/Color.cpp:221
+#: src/Color.cpp:249
 msgid "violet"
 msgstr "Violett"
 
-#: src/Color.cpp:222
+#: src/Color.cpp:250
 msgid "yellow"
 msgstr "Gelb"
 
-#: src/Color.cpp:223
+#: src/Color.cpp:251
 msgid "cursor"
 msgstr "Cursor"
 
-#: src/Color.cpp:224
+#: src/Color.cpp:252
 msgid "background"
 msgstr "Hintergrund"
 
-#: src/Color.cpp:225
+#: src/Color.cpp:253
 msgid "text"
 msgstr "Text"
 
-#: src/Color.cpp:226
+#: src/Color.cpp:254
 msgid "selection"
 msgstr "Auswahl"
 
-#: src/Color.cpp:227
+#: src/Color.cpp:255
 msgid "selected text"
 msgstr "Ausgewählter Text"
 
-#: src/Color.cpp:229
+#: src/Color.cpp:256
 msgid "LaTeX text"
 msgstr "LaTeX-Text"
 
-#: src/Color.cpp:230
+#: src/Color.cpp:257
 msgid "inline completion"
 msgstr "Wortvervollständigung (eindeutig)"
 
-#: src/Color.cpp:232
+#: src/Color.cpp:259
 msgid "non-unique inline completion"
 msgstr "Wortvervollständigung (mehrdeutig)"
 
-#: src/Color.cpp:234
+#: src/Color.cpp:261
 msgid "previewed snippet"
 msgstr "Vorschau-Schnipsel"
 
-#: src/Color.cpp:235
+#: src/Color.cpp:262
 msgid "note label"
 msgstr "Notiz (Marke)"
 
-#: src/Color.cpp:236
+#: src/Color.cpp:263
 msgid "note background"
 msgstr "Notiz (Hintergrund)"
 
-#: src/Color.cpp:237
+#: src/Color.cpp:264
 msgid "comment label"
 msgstr "Kommentar (Marke)"
 
-#: src/Color.cpp:238
+#: src/Color.cpp:265
 msgid "comment background"
 msgstr "Kommentar (Hintergrund)"
 
-#: src/Color.cpp:239
+#: src/Color.cpp:266
 msgid "greyedout inset label"
 msgstr "Grauschrift-Einfügung (Marke)"
 
-#: src/Color.cpp:240
+#: src/Color.cpp:267
 msgid "greyedout inset text"
 msgstr "Grauschrift-Einfügungstext"
 
-#: src/Color.cpp:241
+#: src/Color.cpp:268
 msgid "greyedout inset background"
 msgstr "Grauschrift-Einfügung (Hintergrund)"
 
-#: src/Color.cpp:242
+#: src/Color.cpp:269
 msgid "phantom inset text"
 msgstr "Phantom Einfügung (Text)"
 
-#: src/Color.cpp:243
+#: src/Color.cpp:270
 msgid "shaded box"
 msgstr "Schattierte Box"
 
-#: src/Color.cpp:244
+#: src/Color.cpp:271
 msgid "listings background"
 msgstr "Programmlistings (Hintergrund)"
 
-#: src/Color.cpp:245
+#: src/Color.cpp:272
 msgid "branch label"
 msgstr "Zweig (Marke)"
 
-#: src/Color.cpp:246
+#: src/Color.cpp:273
 msgid "footnote label"
 msgstr "Fußnote (Marke)"
 
-#: src/Color.cpp:247
+#: src/Color.cpp:274
 msgid "index label"
 msgstr "Stichwortmarke"
 
-#: src/Color.cpp:248
+#: src/Color.cpp:275
 msgid "margin note label"
 msgstr "Randnotiz (Marke)"
 
-#: src/Color.cpp:249
+#: src/Color.cpp:276
 msgid "URL label"
 msgstr "URL (Marke)"
 
-#: src/Color.cpp:250
+#: src/Color.cpp:277
 msgid "URL text"
 msgstr "URL (Text)"
 
-#: src/Color.cpp:251
+#: src/Color.cpp:278
 msgid "depth bar"
 msgstr "Balken für Tiefe"
 
-#: src/Color.cpp:252
+#: src/Color.cpp:279
 msgid "scroll indicator"
 msgstr "Scroll-Indikator"
 
-#: src/Color.cpp:253
+#: src/Color.cpp:280
 msgid "language"
 msgstr "Sprache"
 
-#: src/Color.cpp:254
+#: src/Color.cpp:281
 msgid "command inset"
 msgstr "Befehlseinfügung"
 
-#: src/Color.cpp:255
+#: src/Color.cpp:282
 msgid "command inset background"
 msgstr "Befehlseinfügung (Hintergrund)"
 
-#: src/Color.cpp:256
+#: src/Color.cpp:283
 msgid "command inset frame"
 msgstr "Befehlseinfügung (Rahmen)"
 
-#: src/Color.cpp:257
+#: src/Color.cpp:284
 msgid "command inset (broken reference)"
 msgstr "Befehlseinfügung (ungültiger Verweis)"
 
-#: src/Color.cpp:258
+#: src/Color.cpp:285
 msgid "button background (broken reference)"
 msgstr "Knopf (Hintergrund bei ungültigem Verweis)"
 
-#: src/Color.cpp:259
+#: src/Color.cpp:286
 msgid "button frame (broken reference)"
 msgstr "Knopf (Rahmen bei ungültigem Verweis)"
 
-#: src/Color.cpp:260
+#: src/Color.cpp:287
 msgid "button background (broken reference) under focus"
 msgstr "Knopf (Hintergrund bei Fokus auf ungültigem Verweis)"
 
-#: src/Color.cpp:261
+#: src/Color.cpp:288
 msgid "special character"
 msgstr "Sonderzeichen"
 
-#: src/Color.cpp:262
+#: src/Color.cpp:289
 msgid "math"
 msgstr "Mathe"
 
-#: src/Color.cpp:263
+#: src/Color.cpp:290
 msgid "math background"
 msgstr "Mathe (Hintergrund)"
 
-#: src/Color.cpp:264
+#: src/Color.cpp:291
 msgid "graphics background"
 msgstr "Grafik (Hintergrund)"
 
-#: src/Color.cpp:265 src/Color.cpp:269
+#: src/Color.cpp:292 src/Color.cpp:296
 msgid "math macro background"
 msgstr "Mathe-Makro (Hintergrund)"
 
-#: src/Color.cpp:266
+#: src/Color.cpp:293
 msgid "math frame"
 msgstr "Mathe (Rahmen)"
 
-#: src/Color.cpp:267
+#: src/Color.cpp:294
 msgid "math corners"
 msgstr "Mathe (Ecken)"
 
-#: src/Color.cpp:268
+#: src/Color.cpp:295
 msgid "math line"
 msgstr "Mathe (Linie)"
 
-#: src/Color.cpp:270
+#: src/Color.cpp:297
 msgid "math macro hovered background"
 msgstr "Mathe-Makro (schwebender Hintergrund)"
 
-#: src/Color.cpp:271
+#: src/Color.cpp:298
 msgid "math macro label"
 msgstr "Mathe-Makro (Marke)"
 
-#: src/Color.cpp:272
+#: src/Color.cpp:299
 msgid "math macro frame"
 msgstr "Mathe-Makro (Rahmen)"
 
-#: src/Color.cpp:273
+#: src/Color.cpp:300
 msgid "math macro blended out"
 msgstr "Mathe-Makro (ausgeblendet)"
 
-#: src/Color.cpp:274
+#: src/Color.cpp:301
 msgid "math macro old parameter"
 msgstr "Mathe-Makro (alter Parameter)"
 
-#: src/Color.cpp:275
+#: src/Color.cpp:302
 msgid "math macro new parameter"
 msgstr "Mathe-Makro (neuer Parameter)"
 
-#: src/Color.cpp:276
+#: src/Color.cpp:303
 msgid "collapsible inset text"
 msgstr "Einklappbare Einfügung (Text)"
 
-#: src/Color.cpp:277
+#: src/Color.cpp:304
 msgid "collapsible inset frame"
 msgstr "Einklappbare Einfügung (Rahmen)"
 
-#: src/Color.cpp:278
+#: src/Color.cpp:305
 msgid "inset background"
 msgstr "Einfügung (Hintergrund)"
 
-#: src/Color.cpp:279
+#: src/Color.cpp:306
 msgid "inset frame"
 msgstr "Einfügung (Rahmen)"
 
-#: src/Color.cpp:280
+#: src/Color.cpp:307
 msgid "LaTeX error"
 msgstr "LaTeX-Fehler"
 
-#: src/Color.cpp:281
+#: src/Color.cpp:308
 msgid "end-of-line marker"
 msgstr "Zeilenende-Markierung"
 
-#: src/Color.cpp:282
+#: src/Color.cpp:309
 msgid "appendix marker"
 msgstr "Anhangskennzeichnung"
 
-#: src/Color.cpp:283
+#: src/Color.cpp:310
 msgid "change bar"
 msgstr "Balken für Änderung"
 
-#: src/Color.cpp:284
+#: src/Color.cpp:311
 msgid "deleted text (output)"
 msgstr "Gelöschter Text (Ausgabe)"
 
-#: src/Color.cpp:285
+#: src/Color.cpp:312
 msgid "added text (output)"
 msgstr "Hinzugefügter Text (Ausgabe)"
 
-#: src/Color.cpp:286
+#: src/Color.cpp:313
 msgid "added text (workarea, 1st author)"
 msgstr "Hinzugefügter Text (Arbeitsbereich, 1. Autor)"
 
-#: src/Color.cpp:287
+#: src/Color.cpp:314
 msgid "added text (workarea, 2nd author)"
 msgstr "Hinzugefügter Text (Arbeitsbereich, 2. Autor)"
 
-#: src/Color.cpp:288
+#: src/Color.cpp:315
 msgid "added text (workarea, 3rd author)"
 msgstr "Hinzugefügter Text (Arbeitsbereich, 3. Autor)"
 
-#: src/Color.cpp:289
+#: src/Color.cpp:316
 msgid "added text (workarea, 4th author)"
 msgstr "Hinzugefügter Text (Arbeitsbereich, 4. Autor)"
 
-#: src/Color.cpp:290
+#: src/Color.cpp:317
 msgid "added text (workarea, 5th author)"
 msgstr "Hinzugefügter Text (Arbeitsbereich, 5. Autor)"
 
-#: src/Color.cpp:291
+#: src/Color.cpp:318
 msgid "deleted text modifier (workarea)"
 msgstr "Gelöschter Text, Modifizierer (Arbeitsbereich)"
 
-#: src/Color.cpp:292
+#: src/Color.cpp:319
 msgid "added space markers"
 msgstr "Abstandsmarkierungen"
 
-#: src/Color.cpp:293
+#: src/Color.cpp:320
 msgid "table line"
 msgstr "Tabelle (Linie)"
 
-#: src/Color.cpp:294
+#: src/Color.cpp:321
 msgid "table on/off line"
 msgstr "Tabelle an/aus Linie"
 
-#: src/Color.cpp:295
+#: src/Color.cpp:322
 msgid "bottom area"
 msgstr "Unterer Bereich"
 
-#: src/Color.cpp:296
+#: src/Color.cpp:323
 msgid "new page"
 msgstr "Neue Seite"
 
-#: src/Color.cpp:297
+#: src/Color.cpp:324
 msgid "page break / line break"
 msgstr "Seitenumbruch / Zeilenumbruch"
 
-#: src/Color.cpp:298
+#: src/Color.cpp:325
 msgid "button frame"
 msgstr "Knopf (Rahmen)"
 
-#: src/Color.cpp:299
+#: src/Color.cpp:326
 msgid "button background"
 msgstr "Knopf (Hintergrund)"
 
-#: src/Color.cpp:300
+#: src/Color.cpp:327
 msgid "button background under focus"
 msgstr "Knopf (Hintergrund bei Fokus)"
 
-#: src/Color.cpp:301
+#: src/Color.cpp:328
 msgid "paragraph marker"
 msgstr "Absatzmarkierung"
 
-#: src/Color.cpp:302
+#: src/Color.cpp:329
 msgid "preview frame"
 msgstr "Vorschaurahmen"
 
-#: src/Color.cpp:303
+#: src/Color.cpp:330
 msgid "inherit"
 msgstr "übernehmen"
 
-#: src/Color.cpp:304
+#: src/Color.cpp:331
 msgid "regexp frame"
 msgstr "Regulärer Ausdruck (Rahmen)"
 
-#: src/Color.cpp:305
+#: src/Color.cpp:332
 msgid "ignore"
 msgstr "ignorieren"
 
@@ -28858,15 +28779,15 @@ msgstr "Die Ausgabe ist leer"
 msgid "No output file was generated."
 msgstr "Es wurde keine Ausgabedatei erzeugt."
 
-#: src/Cursor.cpp:418 src/Text.cpp:2018
+#: src/Cursor.cpp:418 src/Text.cpp:2008
 msgid ", Inset: "
 msgstr ", Einfügung: "
 
-#: src/Cursor.cpp:419 src/Text.cpp:2020
+#: src/Cursor.cpp:419 src/Text.cpp:2010
 msgid ", Cell: "
 msgstr ", Zelle: "
 
-#: src/Cursor.cpp:420 src/Text.cpp:2023
+#: src/Cursor.cpp:420 src/Text.cpp:2013
 msgid ", Position: "
 msgstr ", Position: "
 
@@ -28962,7 +28883,7 @@ msgstr "&Nicht überschreiben"
 msgid "Overwrite &all"
 msgstr "&Alle überschreiben"
 
-#: src/Exporter.cpp:51 src/frontends/qt/GuiView.cpp:727
+#: src/Exporter.cpp:51 src/frontends/qt/GuiView.cpp:728
 msgid "&Cancel export"
 msgstr "Export &abbrechen"
 
@@ -29080,7 +29001,7 @@ msgstr "Eigenname %1$s, "
 msgid "Cannot view file"
 msgstr "Datei kann nicht betrachtet werden"
 
-#: src/Format.cpp:631 src/Format.cpp:723 src/frontends/qt/GuiView.cpp:3718
+#: src/Format.cpp:631 src/Format.cpp:723 src/frontends/qt/GuiView.cpp:3762
 #, c-format
 msgid "File does not exist: %1$s"
 msgstr "Die Datei existiert nicht: %1$s"
@@ -30128,7 +30049,7 @@ msgstr "LyX-VK: Protokollmeldung"
 msgid "(no log message)"
 msgstr "(keine Protokollmeldung)"
 
-#: src/LyXVC.cpp:246 src/frontends/qt/GuiView.cpp:3581
+#: src/LyXVC.cpp:246 src/frontends/qt/GuiView.cpp:3625
 msgid "LyX VC: Log Message"
 msgstr "LyX VK: Protokollmeldung"
 
@@ -30149,19 +30070,19 @@ msgstr ""
 msgid "Revert to stored version of document?"
 msgstr "Zur gespeicherten Version des Dokuments zurückkehren?"
 
-#: src/LyXVC.cpp:304 src/frontends/qt/GuiView.cpp:4165
+#: src/LyXVC.cpp:304 src/frontends/qt/GuiView.cpp:4209
 msgid "&Revert"
 msgstr "&Wiederherstellen"
 
-#: src/Paragraph.cpp:2050
+#: src/Paragraph.cpp:2040
 msgid "Senseless with this layout!"
 msgstr "Für dieses Format nicht relevant!"
 
-#: src/Paragraph.cpp:2104
+#: src/Paragraph.cpp:2094
 msgid "Alignment not permitted"
 msgstr "Ausrichtung nicht erlaubt"
 
-#: src/Paragraph.cpp:2105
+#: src/Paragraph.cpp:2095
 msgid ""
 "The new layout does not permit the alignment previously used.\n"
 "Setting to default."
@@ -30214,51 +30135,51 @@ msgstr ""
 msgid "Character is uncodable in this verbatim context."
 msgstr "Das Zeichen ist in diesem unformatierten Absatz nicht kodierbar."
 
-#: src/Text.cpp:1968
+#: src/Text.cpp:1958
 msgid "[Change Tracking] "
 msgstr "[Änderungsverfolgung] "
 
-#: src/Text.cpp:1976
+#: src/Text.cpp:1966
 #, c-format
 msgid "Changed by %1$s[[author]] on %2$s[[date]]. "
 msgstr "Geändert von %1$s[[Autor]] am %2$s[[Datum]]. "
 
-#: src/Text.cpp:1986 src/mathed/InsetMathFont.cpp:237
+#: src/Text.cpp:1976 src/mathed/InsetMathFont.cpp:237
 #: src/mathed/InsetMathFontOld.cpp:111
 #, c-format
 msgid "Font: %1$s"
 msgstr "Schrift: %1$s"
 
-#: src/Text.cpp:1991
+#: src/Text.cpp:1981
 #, c-format
 msgid ", Depth: %1$d"
 msgstr ", Tiefe: %1$d"
 
-#: src/Text.cpp:1997
+#: src/Text.cpp:1987
 msgid ", Spacing: "
 msgstr ", Abstand: "
 
-#: src/Text.cpp:2003 src/frontends/qt/GuiDocument.cpp:872
+#: src/Text.cpp:1993 src/frontends/qt/GuiDocument.cpp:872
 msgid "OneHalf"
 msgstr "Eineinhalb"
 
-#: src/Text.cpp:2009
+#: src/Text.cpp:1999
 msgid "Other ("
 msgstr "Andere ("
 
-#: src/Text.cpp:2021
+#: src/Text.cpp:2011
 msgid ", Paragraph: "
 msgstr ", Absatz: "
 
-#: src/Text.cpp:2022
+#: src/Text.cpp:2012
 msgid ", Id: "
 msgstr ", Id: "
 
-#: src/Text.cpp:2029
+#: src/Text.cpp:2019
 msgid ", Char: 0x"
 msgstr ", Zeichen: 0x"
 
-#: src/Text.cpp:2031
+#: src/Text.cpp:2021
 msgid ", Boundary: "
 msgstr ", Grenze: "
 
@@ -30274,7 +30195,7 @@ msgstr "Mathe-Editor-Modus"
 msgid "No valid math formula"
 msgstr "Keine gültige Matheformel"
 
-#: src/Text3.cpp:210 src/mathed/InsetMathNest.cpp:1032
+#: src/Text3.cpp:210 src/mathed/InsetMathNest.cpp:1034
 msgid "Already in regular expression mode"
 msgstr "Bereits im Regexp-Modus"
 
@@ -30451,8 +30372,8 @@ msgstr ""
 msgid "Error reading cite engine %1$s\n"
 msgstr "Fehler beim Lesen der Zitierformatdatei %1$s\n"
 
-#: src/TocBackend.cpp:267 src/insets/InsetIndex.cpp:467
-#: src/insets/InsetIndex.cpp:488
+#: src/TocBackend.cpp:267 src/insets/InsetIndex.cpp:468
+#: src/insets/InsetIndex.cpp:489
 msgid "unknown type!"
 msgstr "unbekannter Typ!"
 
@@ -30505,7 +30426,7 @@ msgstr "Nomenklatureinträge"
 #: src/VCBackend.cpp:929 src/VCBackend.cpp:988 src/VCBackend.cpp:1047
 #: src/VCBackend.cpp:1055 src/VCBackend.cpp:1356 src/VCBackend.cpp:1458
 #: src/VCBackend.cpp:1464 src/VCBackend.cpp:1487 src/VCBackend.cpp:1973
-#: src/frontends/qt/GuiView.cpp:3497 src/frontends/qt/GuiView.cpp:3540
+#: src/frontends/qt/GuiView.cpp:3541 src/frontends/qt/GuiView.cpp:3584
 msgid "Revision control error."
 msgstr "Fehler der Versionskontrolle."
 
@@ -30768,7 +30689,7 @@ msgstr ""
 "Möchten Sie die Änderungen verwerfen und zur gespeicherten Version "
 "zurückkehren?"
 
-#: src/buffer_funcs.cpp:77 src/frontends/qt/GuiView.cpp:4156
+#: src/buffer_funcs.cpp:77 src/frontends/qt/GuiView.cpp:4200
 msgid "Reload saved document?"
 msgstr "Gespeichertes Dokument neu laden?"
 
@@ -31063,13 +30984,6 @@ msgstr "Qt-Version (bei Erstellung): %1$s"
 msgid "About LyX"
 msgstr "Ãœber LyX"
 
-#: src/frontends/qt/GuiAlert.cpp:100 src/frontends/qt/GuiAlert.cpp:164
-#: src/frontends/qt/GuiAlert.cpp:220 src/frontends/qt/GuiAlert.cpp:266
-#: src/frontends/qt/GuiAlert.cpp:315
-#, c-format
-msgid "LyX: %1$s"
-msgstr "LyX: %1$s"
-
 #: src/frontends/qt/GuiApplication.cpp:650
 msgid "About %1"
 msgstr "Ãœber %1"
@@ -31122,7 +31036,7 @@ msgstr "Befehl wurde nicht ausgeführt"
 msgid "Command disabled"
 msgstr "Befehl ist deaktiviert"
 
-#: src/frontends/qt/GuiApplication.cpp:1312 src/frontends/qt/GuiView.cpp:1975
+#: src/frontends/qt/GuiApplication.cpp:1312 src/frontends/qt/GuiView.cpp:2019
 msgid "Command not allowed without a buffer open"
 msgstr "Dieser Befehl ist nur bei geöffnetem Dokument möglich"
 
@@ -31396,9 +31310,9 @@ msgstr "alle Literaturverzeichnisse"
 #: src/frontends/qt/GuiDocument.cpp:2837 src/frontends/qt/GuiExternal.cpp:677
 #: src/frontends/qt/GuiGraphics.cpp:791 src/frontends/qt/GuiInclude.cpp:330
 #: src/frontends/qt/GuiLyXFiles.cpp:353 src/frontends/qt/GuiLyXFiles.cpp:359
-#: src/frontends/qt/GuiView.cpp:2344 src/frontends/qt/GuiView.cpp:2403
-#: src/frontends/qt/GuiView.cpp:2541 src/frontends/qt/GuiView.cpp:2675
-#: src/frontends/qt/GuiView.cpp:2794 src/frontends/qt/GuiView.cpp:2916
+#: src/frontends/qt/GuiView.cpp:2388 src/frontends/qt/GuiView.cpp:2447
+#: src/frontends/qt/GuiView.cpp:2585 src/frontends/qt/GuiView.cpp:2719
+#: src/frontends/qt/GuiView.cpp:2838 src/frontends/qt/GuiView.cpp:2960
 msgid "D&ocuments"
 msgstr "Do&kumente"
 
@@ -31759,10 +31673,10 @@ msgstr "%1$s Dateien"
 msgid "Choose a filename to save the pasted graphic as"
 msgstr "Wählen Sie einen Dateinamen, um die eingefügte Grafik zu speichern als"
 
-#: src/frontends/qt/GuiClipboard.cpp:215 src/frontends/qt/GuiView.cpp:2417
-#: src/frontends/qt/GuiView.cpp:2560 src/frontends/qt/GuiView.cpp:2576
-#: src/frontends/qt/GuiView.cpp:2588 src/frontends/qt/GuiView.cpp:2605
-#: src/frontends/qt/GuiView.cpp:2690 src/frontends/qt/GuiView.cpp:4128
+#: src/frontends/qt/GuiClipboard.cpp:215 src/frontends/qt/GuiView.cpp:2461
+#: src/frontends/qt/GuiView.cpp:2604 src/frontends/qt/GuiView.cpp:2620
+#: src/frontends/qt/GuiView.cpp:2632 src/frontends/qt/GuiView.cpp:2649
+#: src/frontends/qt/GuiView.cpp:2734 src/frontends/qt/GuiView.cpp:4172
 msgid "Canceled."
 msgstr "Abgebrochen."
 
@@ -31792,8 +31706,8 @@ msgid "Select document"
 msgstr "Dokument wählen"
 
 #: src/frontends/qt/GuiCompare.cpp:157 src/frontends/qt/GuiLyXFiles.cpp:352
-#: src/frontends/qt/GuiView.cpp:2348 src/frontends/qt/GuiView.cpp:2406
-#: src/frontends/qt/GuiView.cpp:2679 src/frontends/qt/GuiView.cpp:2805
+#: src/frontends/qt/GuiView.cpp:2392 src/frontends/qt/GuiView.cpp:2450
+#: src/frontends/qt/GuiView.cpp:2723 src/frontends/qt/GuiView.cpp:2849
 msgid "LyX Documents (*.lyx)"
 msgstr "LyX-Dokumente (*.lyx)"
 
@@ -32654,19 +32568,19 @@ msgstr "Maximale Breite des Bilds bei der Ausgabe"
 msgid "Maximal height of image in output"
 msgstr "Maximale Höhe des Bilds bei der Ausgabe"
 
-#: src/frontends/qt/GuiGraphics.cpp:498 src/lengthcommon.cpp:41
+#: src/frontends/qt/GuiGraphics.cpp:498 src/support/lengthcommon.cpp:40
 msgid "bp"
 msgstr "bp"
 
-#: src/frontends/qt/GuiGraphics.cpp:498 src/lengthcommon.cpp:41
+#: src/frontends/qt/GuiGraphics.cpp:498 src/support/lengthcommon.cpp:40
 msgid "cm"
 msgstr "cm"
 
-#: src/frontends/qt/GuiGraphics.cpp:498 src/lengthcommon.cpp:42
+#: src/frontends/qt/GuiGraphics.cpp:498 src/support/lengthcommon.cpp:41
 msgid "mm"
 msgstr "mm"
 
-#: src/frontends/qt/GuiGraphics.cpp:498 src/lengthcommon.cpp:42
+#: src/frontends/qt/GuiGraphics.cpp:498 src/support/lengthcommon.cpp:41
 msgid "in[[unit of measure]]"
 msgstr "in"
 
@@ -33176,17 +33090,17 @@ msgstr ""
 msgid "Select example file"
 msgstr "Wählen Sie eine Beispieldatei"
 
-#: src/frontends/qt/GuiLyXFiles.cpp:354 src/frontends/qt/GuiView.cpp:2404
-#: src/frontends/qt/GuiView.cpp:2542 src/frontends/qt/GuiView.cpp:2676
+#: src/frontends/qt/GuiLyXFiles.cpp:354 src/frontends/qt/GuiView.cpp:2448
+#: src/frontends/qt/GuiView.cpp:2586 src/frontends/qt/GuiView.cpp:2720
 msgid "&Examples"
 msgstr "&Beispiele"
 
-#: src/frontends/qt/GuiLyXFiles.cpp:358 src/frontends/qt/GuiView.cpp:2343
+#: src/frontends/qt/GuiLyXFiles.cpp:358 src/frontends/qt/GuiView.cpp:2387
 msgid "Select template file"
 msgstr "Wählen Sie eine Vorlagendatei"
 
-#: src/frontends/qt/GuiLyXFiles.cpp:360 src/frontends/qt/GuiView.cpp:2345
-#: src/frontends/qt/GuiView.cpp:2795
+#: src/frontends/qt/GuiLyXFiles.cpp:360 src/frontends/qt/GuiView.cpp:2389
+#: src/frontends/qt/GuiView.cpp:2839
 msgid "&Templates"
 msgstr "&Vorlagen"
 
@@ -33313,7 +33227,7 @@ msgstr ""
 "Normalerweise müssen Sie diese Breite nicht festlegen, da die maximale "
 "Breite aller Punkte verwendet wird."
 
-#: src/frontends/qt/GuiParagraph.cpp:166 src/frontends/qt/GuiView.cpp:3073
+#: src/frontends/qt/GuiParagraph.cpp:166 src/frontends/qt/GuiView.cpp:3117
 msgid "&Close"
 msgstr "&Schließen"
 
@@ -34009,33 +33923,33 @@ msgstr "Kein Thesaurus für diese Sprache vorhanden!"
 msgid "Outline"
 msgstr "Gliederung"
 
-#: src/frontends/qt/GuiToolbar.cpp:397
+#: src/frontends/qt/GuiToolbar.cpp:407
 msgid "&Reset to default"
 msgstr "Auf &Voreinstellungen zurücksetzen"
 
-#: src/frontends/qt/GuiToolbar.cpp:398
+#: src/frontends/qt/GuiToolbar.cpp:408
 msgid "Reset all font settings to their defaults"
 msgstr "Alle Schrifteigenschaften auf die Voreinstellungen zurücksetzen"
 
-#: src/frontends/qt/GuiToolbar.cpp:605 src/frontends/qt/Toolbars.cpp:409
+#: src/frontends/qt/GuiToolbar.cpp:621 src/frontends/qt/Toolbars.cpp:409
 msgid "auto"
 msgstr "automatisch"
 
-#: src/frontends/qt/GuiToolbar.cpp:610 src/frontends/qt/GuiToolbar.cpp:619
+#: src/frontends/qt/GuiToolbar.cpp:626 src/frontends/qt/GuiToolbar.cpp:635
 #: src/insets/InsetBranch.cpp:79 src/insets/InsetBranch.cpp:82
 msgid "off"
 msgstr "aus"
 
-#: src/frontends/qt/GuiToolbar.cpp:626 src/frontends/qt/GuiToolbar.cpp:646
+#: src/frontends/qt/GuiToolbar.cpp:642 src/frontends/qt/GuiToolbar.cpp:662
 #, c-format
 msgid "Toolbar \"%1$s\" state set to %2$s"
 msgstr "Status der Werkzeugleiste \"%1$s\" auf %2$s gesetzt"
 
-#: src/frontends/qt/GuiToolbar.cpp:643
+#: src/frontends/qt/GuiToolbar.cpp:659
 msgid "movable"
 msgstr "beweglich"
 
-#: src/frontends/qt/GuiToolbar.cpp:645
+#: src/frontends/qt/GuiToolbar.cpp:661
 msgid "immovable"
 msgstr "verankert"
 
@@ -34043,7 +33957,7 @@ msgstr "verankert"
 msgid "Vertical Space Settings"
 msgstr "Einstellungen für vertikalen Abstand"
 
-#: src/frontends/qt/GuiView.cpp:162
+#: src/frontends/qt/GuiView.cpp:163
 msgid ""
 "The Document\n"
 "Processor[[welcome banner]]"
@@ -34051,19 +33965,19 @@ msgstr ""
 "Die bessere\n"
 "Textverarbeitung"
 
-#: src/frontends/qt/GuiView.cpp:163
+#: src/frontends/qt/GuiView.cpp:164
 msgid "1.0[[possibly scale the welcome banner text size]]"
 msgstr "1.1"
 
-#: src/frontends/qt/GuiView.cpp:166
+#: src/frontends/qt/GuiView.cpp:167
 msgid "version "
 msgstr "Version "
 
-#: src/frontends/qt/GuiView.cpp:166
+#: src/frontends/qt/GuiView.cpp:167
 msgid "unknown version"
 msgstr "unbekannte Version"
 
-#: src/frontends/qt/GuiView.cpp:642
+#: src/frontends/qt/GuiView.cpp:643
 msgid ""
 "WARNING: LaTeX is allowed to execute external commands for this document. "
 "Right click to change."
@@ -34071,96 +33985,96 @@ msgstr ""
 "ACHTUNG: LaTeX darf für dieses Dokument beliebige externe Befehle ausführen. "
 "Um dies zu ändern, klicken Sie die rechte Maustaste."
 
-#: src/frontends/qt/GuiView.cpp:723
+#: src/frontends/qt/GuiView.cpp:724
 msgid "Cancel Export?"
 msgstr "Export abbrechen?"
 
-#: src/frontends/qt/GuiView.cpp:724
+#: src/frontends/qt/GuiView.cpp:725
 msgid "Do you want to cancel the background export process?"
 msgstr "Wollen Sie den Exportvorgang im Hintergrund abbrechen?"
 
-#: src/frontends/qt/GuiView.cpp:727
+#: src/frontends/qt/GuiView.cpp:728
 msgid "Co&ntinue"
 msgstr "&Fortfahren"
 
-#: src/frontends/qt/GuiView.cpp:752
+#: src/frontends/qt/GuiView.cpp:753
 #, c-format
 msgid "Successful export to format: %1$s"
 msgstr "Export in das Format %1$s erfolgreich"
 
-#: src/frontends/qt/GuiView.cpp:761
+#: src/frontends/qt/GuiView.cpp:762
 #, c-format
 msgid "Error while exporting format: %1$s"
 msgstr "Fehler beim Export in das Formats %1$s"
 
-#: src/frontends/qt/GuiView.cpp:764
+#: src/frontends/qt/GuiView.cpp:765
 #, c-format
 msgid "Successful preview of format: %1$s"
 msgstr "Erfolgreiche Vorschau des Formats %1$s"
 
-#: src/frontends/qt/GuiView.cpp:767
+#: src/frontends/qt/GuiView.cpp:768
 #, c-format
 msgid "Error while previewing format: %1$s"
 msgstr "Fehler bei der Vorschau des Formats %1$s"
 
-#: src/frontends/qt/GuiView.cpp:770
+#: src/frontends/qt/GuiView.cpp:771
 #, c-format
 msgid "Conversion cancelled while previewing format: %1$s"
 msgstr "Abbruch der Ausgabe bei der Vorschau des Formats %1$s"
 
-#: src/frontends/qt/GuiView.cpp:1108
+#: src/frontends/qt/GuiView.cpp:1109
 msgid "Exit LyX"
 msgstr "LyX beenden"
 
-#: src/frontends/qt/GuiView.cpp:1109
+#: src/frontends/qt/GuiView.cpp:1110
 msgid "LyX could not be closed because documents are being processed by LyX."
 msgstr ""
 "LyX konnte nicht geschlossen werden, da gerade Dokumente von LyX verarbeitet "
 "werden."
 
-#: src/frontends/qt/GuiView.cpp:1260
+#: src/frontends/qt/GuiView.cpp:1261
 #, c-format
 msgid "%1$s (modified externally)"
 msgstr "%1$s (extern bearbeitet)"
 
-#: src/frontends/qt/GuiView.cpp:1379
+#: src/frontends/qt/GuiView.cpp:1380
 msgid "Welcome to LyX!"
 msgstr "Willkommen bei LyX!"
 
-#: src/frontends/qt/GuiView.cpp:1855
+#: src/frontends/qt/GuiView.cpp:1899
 msgid "Automatic save done."
 msgstr "Automatische Speicherung abgeschlossen."
 
-#: src/frontends/qt/GuiView.cpp:1856
+#: src/frontends/qt/GuiView.cpp:1900
 msgid "Automatic save failed!"
 msgstr "Die automatische Speicherung ist fehlgeschlagen!"
 
-#: src/frontends/qt/GuiView.cpp:1912
+#: src/frontends/qt/GuiView.cpp:1956
 msgid "Command not allowed without any document open"
 msgstr "Dieser Befehl ist nur bei geöffnetem Dokument möglich"
 
-#: src/frontends/qt/GuiView.cpp:1981
+#: src/frontends/qt/GuiView.cpp:2025
 msgid "Invalid argument of master-buffer-forall"
 msgstr "Ungültiges Argument für master-buffer-forall"
 
-#: src/frontends/qt/GuiView.cpp:2100 src/frontends/qt/GuiView.cpp:2117
+#: src/frontends/qt/GuiView.cpp:2144 src/frontends/qt/GuiView.cpp:2161
 #, c-format
 msgid "Unknown toolbar \"%1$s\""
 msgstr "Unbekannte Werkzeugleiste \"%1$s\""
 
-#: src/frontends/qt/GuiView.cpp:2234 src/frontends/qt/GuiView.cpp:2247
+#: src/frontends/qt/GuiView.cpp:2278 src/frontends/qt/GuiView.cpp:2291
 msgid "Zoom level cannot be less than %1$d%."
 msgstr "Der Skalierungsfaktor darf nicht kleiner als %1$d% sein."
 
-#: src/frontends/qt/GuiView.cpp:2372
+#: src/frontends/qt/GuiView.cpp:2416
 msgid "Document not loaded."
 msgstr "Dokument nicht geladen."
 
-#: src/frontends/qt/GuiView.cpp:2402
+#: src/frontends/qt/GuiView.cpp:2446
 msgid "Select document to open"
 msgstr "Wählen Sie das zu öffnende Dokument"
 
-#: src/frontends/qt/GuiView.cpp:2432
+#: src/frontends/qt/GuiView.cpp:2476
 #, c-format
 msgid ""
 "The directory in the given path\n"
@@ -34171,40 +34085,40 @@ msgstr ""
 "%1$s\n"
 "existiert nicht."
 
-#: src/frontends/qt/GuiView.cpp:2449
+#: src/frontends/qt/GuiView.cpp:2493
 #, c-format
 msgid "Opening document %1$s..."
 msgstr "Öffne Dokument %1$s..."
 
-#: src/frontends/qt/GuiView.cpp:2454
+#: src/frontends/qt/GuiView.cpp:2498
 #, c-format
 msgid "Document %1$s opened."
 msgstr "Dokument %1$s ist geöffnet."
 
-#: src/frontends/qt/GuiView.cpp:2457
+#: src/frontends/qt/GuiView.cpp:2501
 msgid "Version control detected."
 msgstr "Versionskontrolle erkannt."
 
-#: src/frontends/qt/GuiView.cpp:2459
+#: src/frontends/qt/GuiView.cpp:2503
 #, c-format
 msgid "Could not open document %1$s"
 msgstr "Das Dokument %1$s konnte nicht geöffnet werden"
 
-#: src/frontends/qt/GuiView.cpp:2489
+#: src/frontends/qt/GuiView.cpp:2533
 msgid "Couldn't import file"
 msgstr "Die Datei konnte nicht importiert werden"
 
-#: src/frontends/qt/GuiView.cpp:2490
+#: src/frontends/qt/GuiView.cpp:2534
 #, c-format
 msgid "No information for importing the format %1$s."
 msgstr "Keine Informationen vorhanden, um das Format %1$s zu importieren."
 
-#: src/frontends/qt/GuiView.cpp:2537
+#: src/frontends/qt/GuiView.cpp:2581
 #, c-format
 msgid "Select %1$s file to import"
 msgstr "Wählen Sie die einzufügende %1$s-Datei"
 
-#: src/frontends/qt/GuiView.cpp:2572
+#: src/frontends/qt/GuiView.cpp:2616
 #, c-format
 msgid ""
 "The file name '%1$s' is invalid!\n"
@@ -34213,8 +34127,8 @@ msgstr ""
 "Der Dateiname '%1$s' ist ungültig!\n"
 "Import wird abgebrochen."
 
-#: src/frontends/qt/GuiView.cpp:2599 src/frontends/qt/GuiView.cpp:2865
-#: src/frontends/qt/GuiView.cpp:2968
+#: src/frontends/qt/GuiView.cpp:2643 src/frontends/qt/GuiView.cpp:2909
+#: src/frontends/qt/GuiView.cpp:3012
 #, c-format
 msgid ""
 "The document %1$s already exists.\n"
@@ -34225,33 +34139,33 @@ msgstr ""
 "\n"
 "Möchten Sie dieses Dokument überschreiben?"
 
-#: src/frontends/qt/GuiView.cpp:2601 src/frontends/qt/GuiView.cpp:2869
-#: src/frontends/qt/GuiView.cpp:2972
+#: src/frontends/qt/GuiView.cpp:2645 src/frontends/qt/GuiView.cpp:2913
+#: src/frontends/qt/GuiView.cpp:3016
 msgid "Overwrite document?"
 msgstr "Dokument überschreiben?"
 
-#: src/frontends/qt/GuiView.cpp:2610
+#: src/frontends/qt/GuiView.cpp:2654
 #, c-format
 msgid "Importing %1$s..."
 msgstr "Importiere %1$s..."
 
-#: src/frontends/qt/GuiView.cpp:2613
+#: src/frontends/qt/GuiView.cpp:2657
 msgid "imported."
 msgstr "wurde eingefügt."
 
-#: src/frontends/qt/GuiView.cpp:2615
+#: src/frontends/qt/GuiView.cpp:2659
 msgid "file not imported!"
 msgstr "Datei wurde nicht importiert!"
 
-#: src/frontends/qt/GuiView.cpp:2641
+#: src/frontends/qt/GuiView.cpp:2685
 msgid "newfile"
 msgstr "Neues_Dokument"
 
-#: src/frontends/qt/GuiView.cpp:2674
+#: src/frontends/qt/GuiView.cpp:2718
 msgid "Select LyX document to insert"
 msgstr "Wählen Sie das einzufügende LyX-Dokument"
 
-#: src/frontends/qt/GuiView.cpp:2720
+#: src/frontends/qt/GuiView.cpp:2764
 #, c-format
 msgid ""
 "It is suggested to save the template in a subdirectory\n"
@@ -34264,23 +34178,23 @@ msgstr ""
 "Dieser Unterordner existiert aber noch nicht.\n"
 "Soll er angelegt werden?"
 
-#: src/frontends/qt/GuiView.cpp:2725
+#: src/frontends/qt/GuiView.cpp:2769
 msgid "Create Language Directory?"
 msgstr "Sprach-Unterorder erstellen?"
 
-#: src/frontends/qt/GuiView.cpp:2726 src/frontends/qt/GuiView.cpp:2757
+#: src/frontends/qt/GuiView.cpp:2770 src/frontends/qt/GuiView.cpp:2801
 msgid "&Yes, Create"
 msgstr "&Ja, erstellen"
 
-#: src/frontends/qt/GuiView.cpp:2726 src/frontends/qt/GuiView.cpp:2757
+#: src/frontends/qt/GuiView.cpp:2770 src/frontends/qt/GuiView.cpp:2801
 msgid "&No, Save Template in Parent Directory"
 msgstr "&Nein, speichere Vorlage im Hauptordner"
 
-#: src/frontends/qt/GuiView.cpp:2729 src/frontends/qt/GuiView.cpp:2760
+#: src/frontends/qt/GuiView.cpp:2773 src/frontends/qt/GuiView.cpp:2804
 msgid "Subdirectory creation failed!"
 msgstr "Erstellung des Unterordners fehlgeschlagen!"
 
-#: src/frontends/qt/GuiView.cpp:2730 src/frontends/qt/GuiView.cpp:2761
+#: src/frontends/qt/GuiView.cpp:2774 src/frontends/qt/GuiView.cpp:2805
 msgid ""
 "Could not create subdirectory.\n"
 "The template will be saved in the parent directory."
@@ -34288,7 +34202,7 @@ msgstr ""
 "Der Unterordner konnte leider nicht erstellt werden\n"
 "Die Vorlage wird im Hauptordner gespeichert."
 
-#: src/frontends/qt/GuiView.cpp:2751
+#: src/frontends/qt/GuiView.cpp:2795
 #, c-format
 msgid ""
 "It is suggested to save the template in a subdirectory\n"
@@ -34301,19 +34215,19 @@ msgstr ""
 "Dieser Unterordner existiert aber noch nicht.\n"
 "Soll er angelegt werden?"
 
-#: src/frontends/qt/GuiView.cpp:2756
+#: src/frontends/qt/GuiView.cpp:2800
 msgid "Create Category Directory?"
 msgstr "Kategorien-Ordner erstellen?"
 
-#: src/frontends/qt/GuiView.cpp:2791
+#: src/frontends/qt/GuiView.cpp:2835
 msgid "Choose a filename to save template as"
 msgstr "Wählen Sie einen Dateinamen für die Vorlage"
 
-#: src/frontends/qt/GuiView.cpp:2792
+#: src/frontends/qt/GuiView.cpp:2836
 msgid "Choose a filename to save document as"
 msgstr "Wählen Sie einen Dateinamen für das Dokument"
 
-#: src/frontends/qt/GuiView.cpp:2828
+#: src/frontends/qt/GuiView.cpp:2872
 #, c-format
 msgid ""
 "The file\n"
@@ -34328,17 +34242,17 @@ msgstr ""
 "Bitte schließen Sie sie, wenn Sie sie überschreiben möchten.\n"
 "Möchten Sie statt dessen einen neuen Dateinamen wählen?"
 
-#: src/frontends/qt/GuiView.cpp:2832
+#: src/frontends/qt/GuiView.cpp:2876
 msgid "Chosen File Already Open"
 msgstr "Ausgewählte Datei bereits geöffnet"
 
-#: src/frontends/qt/GuiView.cpp:2833 src/frontends/qt/GuiView.cpp:2855
-#: src/frontends/qt/GuiView.cpp:2871 src/frontends/qt/GuiView.cpp:2973
-#: src/frontends/qt/GuiView.cpp:3018
+#: src/frontends/qt/GuiView.cpp:2877 src/frontends/qt/GuiView.cpp:2899
+#: src/frontends/qt/GuiView.cpp:2915 src/frontends/qt/GuiView.cpp:3017
+#: src/frontends/qt/GuiView.cpp:3062
 msgid "&Rename"
 msgstr "&Umbenennen"
 
-#: src/frontends/qt/GuiView.cpp:2848
+#: src/frontends/qt/GuiView.cpp:2892
 #, c-format
 msgid ""
 "The document %1$s is already registered.\n"
@@ -34349,27 +34263,27 @@ msgstr ""
 "\n"
 "Möchten Sie einen anderen Namen wählen?"
 
-#: src/frontends/qt/GuiView.cpp:2853
+#: src/frontends/qt/GuiView.cpp:2897
 msgid "Rename document?"
 msgstr "Dokument umbenennen?"
 
-#: src/frontends/qt/GuiView.cpp:2853
+#: src/frontends/qt/GuiView.cpp:2897
 msgid "Copy document?"
 msgstr "Dokument kopieren?"
 
-#: src/frontends/qt/GuiView.cpp:2855
+#: src/frontends/qt/GuiView.cpp:2899
 msgid "&Copy"
 msgstr "&Kopieren"
 
-#: src/frontends/qt/GuiView.cpp:2915
+#: src/frontends/qt/GuiView.cpp:2959
 msgid "Choose a filename to export the document as"
 msgstr "Wählen Sie einen Dateinamen für das exportierte Dokument"
 
-#: src/frontends/qt/GuiView.cpp:2919
+#: src/frontends/qt/GuiView.cpp:2963
 msgid "Guess from extension (*.*)"
 msgstr "Von der Dateierweiterung ableiten (*.*)"
 
-#: src/frontends/qt/GuiView.cpp:3014
+#: src/frontends/qt/GuiView.cpp:3058
 #, c-format
 msgid ""
 "The document %1$s could not be saved.\n"
@@ -34380,15 +34294,15 @@ msgstr ""
 "\n"
 "Möchten Sie das Dokument umbenennen und erneut versuchen?"
 
-#: src/frontends/qt/GuiView.cpp:3017
+#: src/frontends/qt/GuiView.cpp:3061
 msgid "Rename and save?"
 msgstr "Umbenennen und speichern?"
 
-#: src/frontends/qt/GuiView.cpp:3018
+#: src/frontends/qt/GuiView.cpp:3062
 msgid "&Retry"
 msgstr "&Wiederholen"
 
-#: src/frontends/qt/GuiView.cpp:3063
+#: src/frontends/qt/GuiView.cpp:3107
 #, c-format
 msgid ""
 "Last view on document %1$s is being closed.\n"
@@ -34410,25 +34324,25 @@ msgstr ""
 "die Voreinstellung in  Werkzeuge > Einstellungen ... >\n"
 "Aussehen & Handhabung > Benutzeroberfläche.\n"
 
-#: src/frontends/qt/GuiView.cpp:3072
+#: src/frontends/qt/GuiView.cpp:3116
 msgid "Close or hide document?"
 msgstr "Dokument schließen oder verbergen?"
 
-#: src/frontends/qt/GuiView.cpp:3073
+#: src/frontends/qt/GuiView.cpp:3117
 msgid "&Hide"
 msgstr "&Verbergen"
 
-#: src/frontends/qt/GuiView.cpp:3170
+#: src/frontends/qt/GuiView.cpp:3214
 msgid "Close document"
 msgstr "Dokument schließen"
 
-#: src/frontends/qt/GuiView.cpp:3171
+#: src/frontends/qt/GuiView.cpp:3215
 msgid "Document could not be closed because it is being processed by LyX."
 msgstr ""
 "Dokument konnte nicht geschlossen werden, da es gerade von LyX verarbeitet "
 "wird."
 
-#: src/frontends/qt/GuiView.cpp:3306 src/frontends/qt/GuiView.cpp:3421
+#: src/frontends/qt/GuiView.cpp:3350 src/frontends/qt/GuiView.cpp:3465
 #, c-format
 msgid ""
 "The document %1$s has not been saved yet.\n"
@@ -34439,16 +34353,16 @@ msgstr ""
 "\n"
 "Möchten Sie das Dokument speichern?"
 
-#: src/frontends/qt/GuiView.cpp:3309 src/frontends/qt/GuiView.cpp:3424
+#: src/frontends/qt/GuiView.cpp:3353 src/frontends/qt/GuiView.cpp:3468
 msgid "Save new document?"
 msgstr "Neues Dokument speichern?"
 
-#: src/frontends/qt/GuiView.cpp:3310 src/frontends/qt/GuiView.cpp:3324
-#: src/frontends/qt/GuiView.cpp:3426
+#: src/frontends/qt/GuiView.cpp:3354 src/frontends/qt/GuiView.cpp:3368
+#: src/frontends/qt/GuiView.cpp:3470
 msgid "&Save"
 msgstr "&Speichern"
 
-#: src/frontends/qt/GuiView.cpp:3315
+#: src/frontends/qt/GuiView.cpp:3359
 #, c-format
 msgid ""
 "The document %1$s has unsaved changes.\n"
@@ -34459,7 +34373,7 @@ msgstr ""
 "sind nicht gespeichert.\n"
 "Möchten Sie das Dokument speichern oder die Änderungen verwerfen?"
 
-#: src/frontends/qt/GuiView.cpp:3318
+#: src/frontends/qt/GuiView.cpp:3362
 #, c-format
 msgid ""
 "The document %1$s has not been saved yet.\n"
@@ -34470,19 +34384,19 @@ msgstr ""
 "\n"
 "Möchten Sie das Dokument speichern oder es endgültig verwerfen?"
 
-#: src/frontends/qt/GuiView.cpp:3322 src/frontends/qt/GuiView.cpp:3418
+#: src/frontends/qt/GuiView.cpp:3366 src/frontends/qt/GuiView.cpp:3462
 msgid "Save changed document?"
 msgstr "Geändertes Dokument speichern?"
 
-#: src/frontends/qt/GuiView.cpp:3322
+#: src/frontends/qt/GuiView.cpp:3366
 msgid "Save document?"
 msgstr "Dokument speichern?"
 
-#: src/frontends/qt/GuiView.cpp:3324
+#: src/frontends/qt/GuiView.cpp:3368
 msgid "&Discard"
 msgstr "&Verwerfen"
 
-#: src/frontends/qt/GuiView.cpp:3415
+#: src/frontends/qt/GuiView.cpp:3459
 #, c-format
 msgid ""
 "The document %1$s has unsaved changes.\n"
@@ -34493,7 +34407,7 @@ msgstr ""
 "\n"
 "Möchten Sie das Dokument speichern?"
 
-#: src/frontends/qt/GuiView.cpp:3450
+#: src/frontends/qt/GuiView.cpp:3494
 #, c-format
 msgid ""
 "Document \n"
@@ -34505,37 +34419,37 @@ msgstr ""
 "wurde extern verändert. Wollen Sie es erneut laden?\n"
 "Alle lokalen Veränderungen werden dann verworfen."
 
-#: src/frontends/qt/GuiView.cpp:3453
+#: src/frontends/qt/GuiView.cpp:3497
 msgid "Reload externally changed document?"
 msgstr "Extern geändertes Dokument neu laden?"
 
-#: src/frontends/qt/GuiView.cpp:3498
+#: src/frontends/qt/GuiView.cpp:3542
 msgid "Document could not be checked in."
 msgstr "Das Dokument konnte nicht eingecheckt werden."
 
-#: src/frontends/qt/GuiView.cpp:3541
+#: src/frontends/qt/GuiView.cpp:3585
 msgid "Error when setting the locking property."
 msgstr "Fehler beim Setzen der Dateisperrung."
 
-#: src/frontends/qt/GuiView.cpp:3590
+#: src/frontends/qt/GuiView.cpp:3634
 msgid "Directory is not accessible."
 msgstr "Das Verzeichnis ist nicht lesbar."
 
-#: src/frontends/qt/GuiView.cpp:3667
+#: src/frontends/qt/GuiView.cpp:3711
 #, c-format
 msgid "Opening child document %1$s..."
 msgstr "Öffne Unterdokument %1$s..."
 
-#: src/frontends/qt/GuiView.cpp:3725
+#: src/frontends/qt/GuiView.cpp:3769
 #, c-format
 msgid "No buffer for file: %1$s."
 msgstr "Kein Pufferspeicher für Datei: %1$s."
 
-#: src/frontends/qt/GuiView.cpp:3735
+#: src/frontends/qt/GuiView.cpp:3779
 msgid "Inverse Search Failed"
 msgstr "Rückwärtssuche gescheitert"
 
-#: src/frontends/qt/GuiView.cpp:3736
+#: src/frontends/qt/GuiView.cpp:3780
 msgid ""
 "Invalid position requested by inverse search.\n"
 "You may need to update the viewed document."
@@ -34543,35 +34457,35 @@ msgstr ""
 "Die Rückwärtssuche wollte eine ungültige Position anspringen.\n"
 "Bitte aktualisieren Sie das ausgegebene Dokument."
 
-#: src/frontends/qt/GuiView.cpp:3817
+#: src/frontends/qt/GuiView.cpp:3861
 msgid "Export Error"
 msgstr "Exportfehler"
 
-#: src/frontends/qt/GuiView.cpp:3818
+#: src/frontends/qt/GuiView.cpp:3862
 msgid "Error cloning the Buffer."
 msgstr "Fehler beim Klonen des Pufferspeichers."
 
-#: src/frontends/qt/GuiView.cpp:3969 src/frontends/qt/GuiView.cpp:3989
+#: src/frontends/qt/GuiView.cpp:4013 src/frontends/qt/GuiView.cpp:4033
 msgid "Exporting ..."
 msgstr "Exportiere ..."
 
-#: src/frontends/qt/GuiView.cpp:3998
+#: src/frontends/qt/GuiView.cpp:4042
 msgid "Previewing ..."
 msgstr "Generiere Vorschau ..."
 
-#: src/frontends/qt/GuiView.cpp:4036
+#: src/frontends/qt/GuiView.cpp:4080
 msgid "Document not loaded"
 msgstr "Dokument nicht geladen"
 
-#: src/frontends/qt/GuiView.cpp:4122
+#: src/frontends/qt/GuiView.cpp:4166
 msgid "Select file to insert"
 msgstr "Wählen Sie das einzufügende Dokument"
 
-#: src/frontends/qt/GuiView.cpp:4125
+#: src/frontends/qt/GuiView.cpp:4169
 msgid "All Files (*)"
 msgstr "Alle Dateien (*)"
 
-#: src/frontends/qt/GuiView.cpp:4153
+#: src/frontends/qt/GuiView.cpp:4197
 #, c-format
 msgid ""
 "The current version will be lost. Are you sure you want to load the version "
@@ -34581,7 +34495,7 @@ msgstr ""
 "dass Sie die auf der Festplatte gespeicherte Version des Dokuments %1$s "
 "laden möchten?"
 
-#: src/frontends/qt/GuiView.cpp:4160
+#: src/frontends/qt/GuiView.cpp:4204
 #, c-format
 msgid ""
 "Any changes will be lost. Are you sure you want to revert to the saved "
@@ -34590,61 +34504,61 @@ msgstr ""
 "Alle Änderungen gehen verloren. Sind Sie sicher, dass Sie zur gespeicherten "
 "Version des Dokuments %1$s zurückkehren möchten?"
 
-#: src/frontends/qt/GuiView.cpp:4163
+#: src/frontends/qt/GuiView.cpp:4207
 msgid "Revert to saved document?"
 msgstr "Gespeichertes Dokument neu laden?"
 
-#: src/frontends/qt/GuiView.cpp:4180
+#: src/frontends/qt/GuiView.cpp:4224
 msgid "Buffer export reset."
 msgstr "Export zurückgesetzt."
 
-#: src/frontends/qt/GuiView.cpp:4203
+#: src/frontends/qt/GuiView.cpp:4247
 msgid "Saving all documents..."
 msgstr "Speichere alle Dokumente..."
 
-#: src/frontends/qt/GuiView.cpp:4213
+#: src/frontends/qt/GuiView.cpp:4257
 msgid "All documents saved."
 msgstr "Alle Dokumente wurden gespeichert."
 
-#: src/frontends/qt/GuiView.cpp:4252
+#: src/frontends/qt/GuiView.cpp:4296
 msgid "Developer mode is now enabled."
 msgstr "Der Entwicklermodus ist nun aktiviert."
 
-#: src/frontends/qt/GuiView.cpp:4254
+#: src/frontends/qt/GuiView.cpp:4298
 msgid "Developer mode is now disabled."
 msgstr "Der Entwicklermodus ist nun deaktiviert."
 
-#: src/frontends/qt/GuiView.cpp:4278
+#: src/frontends/qt/GuiView.cpp:4322
 msgid "Toolbars unlocked."
 msgstr "Werkzeugleisten nicht verankert."
 
-#: src/frontends/qt/GuiView.cpp:4280
+#: src/frontends/qt/GuiView.cpp:4324
 msgid "Toolbars locked."
 msgstr "Werkzeugleisten verankert."
 
-#: src/frontends/qt/GuiView.cpp:4293
+#: src/frontends/qt/GuiView.cpp:4337
 #, c-format
 msgid "Icon size set to %1$dx%2$d."
 msgstr "Eingestellte Symbolgröße: %1$dx%2$d."
 
-#: src/frontends/qt/GuiView.cpp:4379
+#: src/frontends/qt/GuiView.cpp:4423
 #, c-format
 msgid "%1$s unknown command!"
 msgstr "LFUN_UI_TOGGLE %1$s unbekannter Befehl!"
 
-#: src/frontends/qt/GuiView.cpp:4483
+#: src/frontends/qt/GuiView.cpp:4527
 msgid "Zoom level is now %1$d% (default value: %2$d%)"
 msgstr "Aktueller Skalierungsfaktor: %1$d% (Standardwert: %2$d%)"
 
-#: src/frontends/qt/GuiView.cpp:4542
+#: src/frontends/qt/GuiView.cpp:4586
 msgid "Please, preview the document first."
 msgstr "Bitte geben Sie das Dokument zunächst aus."
 
-#: src/frontends/qt/GuiView.cpp:4558
+#: src/frontends/qt/GuiView.cpp:4602
 msgid "Couldn't proceed."
 msgstr "Konnte nicht fortfahren."
 
-#: src/frontends/qt/GuiView.cpp:5039
+#: src/frontends/qt/GuiView.cpp:5073
 msgid "Disable Shell Escape"
 msgstr "Erlaubnis zum Aufruf externer Programme widerrufen"
 
@@ -34657,27 +34571,27 @@ msgstr "Quelltext-Vorschau"
 msgid "%1[[preview format name]] Preview"
 msgstr "%1-Vorschau"
 
-#: src/frontends/qt/GuiWorkArea.cpp:1617
+#: src/frontends/qt/GuiWorkArea.cpp:1614
 msgid "Close File"
 msgstr "Datei schließen"
 
-#: src/frontends/qt/GuiWorkArea.cpp:2134
+#: src/frontends/qt/GuiWorkArea.cpp:2131
 msgid "%1 (read only)"
 msgstr "%1 (schreibgeschützt)"
 
-#: src/frontends/qt/GuiWorkArea.cpp:2138
+#: src/frontends/qt/GuiWorkArea.cpp:2135
 msgid "%1 (modified externally)"
 msgstr "%1 (extern bearbeitet)"
 
-#: src/frontends/qt/GuiWorkArea.cpp:2161
+#: src/frontends/qt/GuiWorkArea.cpp:2158
 msgid "Hide tab"
 msgstr "Unterfenster verstecken"
 
-#: src/frontends/qt/GuiWorkArea.cpp:2167
+#: src/frontends/qt/GuiWorkArea.cpp:2164
 msgid "Close tab"
 msgstr "Unterfenster schließen"
 
-#: src/frontends/qt/GuiWorkArea.cpp:2206
+#: src/frontends/qt/GuiWorkArea.cpp:2203
 msgid "<b>The file %1 changed on disk.</b>"
 msgstr "<b>Die Datei %1 wurde auf der Festplatte verändert.</b>"
 
@@ -35144,7 +35058,7 @@ msgid "active"
 msgstr "aktiv"
 
 #: src/insets/InsetBranch.cpp:70 src/insets/InsetBranch.cpp:72
-#: src/insets/InsetIndex.cpp:649
+#: src/insets/InsetIndex.cpp:650
 msgid "non-active"
 msgstr "inaktiv"
 
@@ -35376,15 +35290,15 @@ msgstr "FEHLER: Unbekannter Gleitobjekt-Typ: %1$s"
 msgid "float"
 msgstr "Gleitobjekt"
 
-#: src/insets/InsetFloat.cpp:732
+#: src/insets/InsetFloat.cpp:751
 msgid "float: "
 msgstr "Gleitobjekt: "
 
-#: src/insets/InsetFloat.cpp:735
+#: src/insets/InsetFloat.cpp:754
 msgid "subfloat: "
 msgstr "Untergleitobjekt: "
 
-#: src/insets/InsetFloat.cpp:745
+#: src/insets/InsetFloat.cpp:764
 msgid " (sideways)"
 msgstr " (seitwärts)"
 
@@ -35593,7 +35507,7 @@ msgstr ""
 "wurde nicht korrekt exportiert.\n"
 "Vorsicht, die LaTeX-Ausgabe ist vermutlich lückenhaft!"
 
-#: src/insets/InsetInclude.cpp:964 src/insets/InsetInclude.cpp:1070
+#: src/insets/InsetInclude.cpp:964 src/insets/InsetInclude.cpp:1068
 msgid "Unsupported Inclusion"
 msgstr "Einbettung nicht unterstützt"
 
@@ -35608,15 +35522,17 @@ msgstr ""
 "nicht unterstützt. Betroffene Datei:\n"
 "%1$s"
 
-#: src/insets/InsetInclude.cpp:1071
+#: src/insets/InsetInclude.cpp:1069
 #, c-format
 msgid ""
-"LyX does not know how to include non-LyX files when generating DocBook "
-"output. Offending file:\n"
+"LyX does not know how to process included non-LyX files when generating "
+"DocBook output. The content of the file will be output as a comment. "
+"Offending file:\n"
 "%1$s"
 msgstr ""
 "Die Einbettung von anderen als LyX-Dateien bei der Erzeugung von DocBook "
-"wird nicht unterstützt. Betroffene Datei:\n"
+"wird nicht unterstützt. Der Inhalt der Datei wird als Kommentar ausgegeben. "
+"Betroffene Datei:\n"
 "%1$s"
 
 #: src/insets/InsetIndex.cpp:156
@@ -35636,19 +35552,19 @@ msgstr ""
 "Bitte legen Sie die Sortierung manuell fest. Hinweise\n"
 "zum Vorgehen finden Sie im Benutzerhandbuch."
 
-#: src/insets/InsetIndex.cpp:460
+#: src/insets/InsetIndex.cpp:461
 msgid "Index Entry"
 msgstr "Stichwort"
 
-#: src/insets/InsetIndex.cpp:646
+#: src/insets/InsetIndex.cpp:647
 msgid "Unknown index type!"
 msgstr "Unbekannter Index-Typ!"
 
-#: src/insets/InsetIndex.cpp:647
+#: src/insets/InsetIndex.cpp:648
 msgid "All indexes"
 msgstr "Alle Indexe"
 
-#: src/insets/InsetIndex.cpp:651
+#: src/insets/InsetIndex.cpp:652
 msgid "subindex"
 msgstr "Unterindex"
 
@@ -36304,22 +36220,22 @@ msgstr "hphantom"
 msgid "vphantom"
 msgstr "vphantom"
 
-#: src/insets/InsetQuotes.cpp:646
+#: src/insets/InsetQuotes.cpp:580
 #, c-format
 msgid "%1$souter%2$s and %3$sinner%4$s[[quotation marks]]"
 msgstr "%1$sÄußere%2$s und %3$sinnere%4$s"
 
-#: src/insets/InsetQuotes.cpp:656
+#: src/insets/InsetQuotes.cpp:590
 #, c-format
 msgid "%1$s[[quot. mark description]] (language default)"
 msgstr "%1$s (Sprachvoreinstellung)"
 
-#: src/insets/InsetQuotes.cpp:669
+#: src/insets/InsetQuotes.cpp:603
 #, c-format
 msgid "%1$stext"
 msgstr "%1$sText"
 
-#: src/insets/InsetQuotes.cpp:671
+#: src/insets/InsetQuotes.cpp:605
 #, c-format
 msgid "text%1$s"
 msgstr "Text%1$s"
@@ -36485,7 +36401,7 @@ msgstr ""
 
 # , c-format
 # , c-format
-#: src/insets/InsetText.cpp:1146
+#: src/insets/InsetText.cpp:1154
 msgid "[contains tracked changes]"
 msgstr "[enthält verfolgte Änderungen]"
 
@@ -36553,66 +36469,6 @@ msgstr "Vorschau bereit"
 msgid "Preview failed"
 msgstr "Die Vorschau ist fehlgeschlagen"
 
-#: src/lengthcommon.cpp:41
-msgid "cc[[unit of measure]]"
-msgstr "cc"
-
-#: src/lengthcommon.cpp:41
-msgid "dd"
-msgstr "dd"
-
-#: src/lengthcommon.cpp:41
-msgid "em"
-msgstr "em"
-
-#: src/lengthcommon.cpp:42
-msgid "ex"
-msgstr "ex"
-
-#: src/lengthcommon.cpp:42
-msgid "mu[[unit of measure]]"
-msgstr "mu"
-
-#: src/lengthcommon.cpp:42
-msgid "pc"
-msgstr "pc"
-
-#: src/lengthcommon.cpp:43
-msgid "pt"
-msgstr "pt"
-
-#: src/lengthcommon.cpp:43
-msgid "sp"
-msgstr "sp"
-
-#: src/lengthcommon.cpp:43
-msgid "Text Width %"
-msgstr "Textbreite %"
-
-#: src/lengthcommon.cpp:44
-msgid "Column Width %"
-msgstr "Spaltenbreite %"
-
-#: src/lengthcommon.cpp:44
-msgid "Page Width %"
-msgstr "Seitenbreite %"
-
-#: src/lengthcommon.cpp:44
-msgid "Line Width %"
-msgstr "Zeilenbreite %"
-
-#: src/lengthcommon.cpp:45
-msgid "Text Height %"
-msgstr "Texthöhe %"
-
-#: src/lengthcommon.cpp:45
-msgid "Page Height %"
-msgstr "Seitenhöhe %"
-
-#: src/lengthcommon.cpp:45
-msgid "Line Distance %"
-msgstr "Zeilenabstand %"
-
 #: src/lyxfind.cpp:236
 msgid "Search error"
 msgstr "Fehler beim Suchen"
@@ -36706,7 +36562,7 @@ msgstr ""
 "In einer 'Fallunterscheidung' kann die Spaltenanzahl nicht geändert werden: "
 "'%1$s'"
 
-#: src/mathed/InsetMathColor.cpp:117
+#: src/mathed/InsetMathColor.cpp:156
 #, c-format
 msgid "Color: %1$s"
 msgstr "Farbe: %1$s"
@@ -36800,22 +36656,22 @@ msgstr "Mathe-Makro: \\%1$s"
 msgid "Invalid macro! \\%1$s"
 msgstr "Ungültiges Makro! \\%1$s"
 
-#: src/mathed/InsetMathNest.cpp:1018
+#: src/mathed/InsetMathNest.cpp:1020
 msgid "create new math text environment ($...$)"
 msgstr "Neue Mathe-Textumgebung erzeugen ($...$)"
 
-#: src/mathed/InsetMathNest.cpp:1021
+#: src/mathed/InsetMathNest.cpp:1023
 msgid "entered math text mode (textrm)"
 msgstr "Mathe-Textmodus betreten (textrm)"
 
-#: src/mathed/InsetMathNest.cpp:1043
+#: src/mathed/InsetMathNest.cpp:1045
 msgid "Regular expression editor mode"
 msgstr "Bearbeitungsmodus für reguläre Ausdrücke"
 
-#: src/mathed/InsetMathNest.cpp:1914
+#: src/mathed/InsetMathNest.cpp:1916
 #, c-format
 msgid "Cannot apply %1$s here."
-msgstr ""
+msgstr "%1$s kann hier nicht angewendet werden."
 
 #: src/mathed/InsetMathRef.cpp:245
 msgid "Standard[[mathref]]"
@@ -37153,6 +37009,66 @@ msgstr ""
 msgid "Fatal Exception!"
 msgstr "Fataler Ausnahmefehler!"
 
+#: src/support/lengthcommon.cpp:40
+msgid "cc[[unit of measure]]"
+msgstr "cc"
+
+#: src/support/lengthcommon.cpp:40
+msgid "dd"
+msgstr "dd"
+
+#: src/support/lengthcommon.cpp:40
+msgid "em"
+msgstr "em"
+
+#: src/support/lengthcommon.cpp:41
+msgid "ex"
+msgstr "ex"
+
+#: src/support/lengthcommon.cpp:41
+msgid "mu[[unit of measure]]"
+msgstr "mu"
+
+#: src/support/lengthcommon.cpp:41
+msgid "pc"
+msgstr "pc"
+
+#: src/support/lengthcommon.cpp:42
+msgid "pt"
+msgstr "pt"
+
+#: src/support/lengthcommon.cpp:42
+msgid "sp"
+msgstr "sp"
+
+#: src/support/lengthcommon.cpp:42
+msgid "Text Width %"
+msgstr "Textbreite %"
+
+#: src/support/lengthcommon.cpp:43
+msgid "Column Width %"
+msgstr "Spaltenbreite %"
+
+#: src/support/lengthcommon.cpp:43
+msgid "Page Width %"
+msgstr "Seitenbreite %"
+
+#: src/support/lengthcommon.cpp:43
+msgid "Line Width %"
+msgstr "Zeilenbreite %"
+
+#: src/support/lengthcommon.cpp:44
+msgid "Text Height %"
+msgstr "Texthöhe %"
+
+#: src/support/lengthcommon.cpp:44
+msgid "Page Height %"
+msgstr "Seitenhöhe %"
+
+#: src/support/lengthcommon.cpp:44
+msgid "Line Distance %"
+msgstr "Zeilenabstand %"
+
 #: src/support/os_win32.cpp:494
 msgid "System file not found"
 msgstr "Systemdatei nicht gefunden"
@@ -37181,6 +37097,86 @@ msgstr ""
 msgid "Unknown user"
 msgstr "Unbekannter Benutzer"
 
+#, fuzzy, c-format
+#~ msgid "%1$s"
+#~ msgstr "Unter-%1$s"
+
+#~ msgid "Theorem \\thechapter.\\thetheorem."
+#~ msgstr "Theorem \\thechapter.\\thetheorem."
+
+#~ msgid "Corollary \\thechapter.\\thecorollary."
+#~ msgstr "Korollar \\thechapter.\\thecorollary."
+
+#~ msgid "Lemma \\thechapter.\\thelemma."
+#~ msgstr "Lemma \\thechapter.\\thelemma."
+
+#~ msgid "Proposition \\thechapter.\\theproposition."
+#~ msgstr "Satz \\thechapter.\\theproposition."
+
+#~ msgid "Conjecture \\thechapter.\\theconjecture."
+#~ msgstr "Vermutung \\thechapter.\\theconjecture."
+
+#~ msgid "Fact \\thechapter.\\thefact."
+#~ msgstr "Fakt \\thechapter.\\thefact."
+
+#~ msgid "Definition \\thechapter.\\thedefinition."
+#~ msgstr "Definition \\thechapter.\\thedefinition."
+
+#~ msgid "Example \\thechapter.\\theexample."
+#~ msgstr "Beispiel \\thechapter.\\theexample."
+
+#~ msgid "Problem \\thechapter.\\theproblem."
+#~ msgstr "Problem \\thechapter.\\theproblem."
+
+#~ msgid "Exercise \\thechapter.\\theexercise."
+#~ msgstr "Aufgabe \\thechapter.\\theexercise."
+
+#~ msgid "Solution \\thechapter.\\thesolution."
+#~ msgstr "Lösung \\thechapter.\\thesolution."
+
+#~ msgid "Remark \\thechapter.\\theremark."
+#~ msgstr "Bemerkung \\thechapter.\\theremark."
+
+#~ msgid "Claim \\thechapter.\\theclaim."
+#~ msgstr "Behauptung \\thechapter.\\theclaim."
+
+#~ msgid "Criterion \\thechapter.\\thecriterion."
+#~ msgstr "Kriterium \\thechapter.\\thecriterion."
+
+#~ msgid "Algorithm \\thechapter.\\thealgorithm."
+#~ msgstr "Algorithmus \\thechapter.\\thealgorithm."
+
+#~ msgid "Axiom \\thechapter.\\theaxiom."
+#~ msgstr "Axiom \\thechapter.\\theaxiom."
+
+#~ msgid "Condition \\thechapter.\\thecondition."
+#~ msgstr "Bedingung \\thechapter.\\thecondition."
+
+#~ msgid "Note \\thechapter.\\thenote."
+#~ msgstr "Notiz \\thechapter.\\thenote."
+
+#~ msgid "Notation \\thechapter.\\thenotation."
+#~ msgstr "Notation \\thechapter.\\thenotation."
+
+#~ msgid "Summary \\thechapter.\\thesummary."
+#~ msgstr "Zusammenfassung \\thechapter.\\thesummary."
+
+#~ msgid "Acknowledgement \\thechapter.\\theacknowledgement."
+#~ msgstr "Danksagung \\thechapter.\\theacknowledgement."
+
+#~ msgid "Conclusion \\thechapter.\\theconclusion."
+#~ msgstr "Schlussfolgerung \\thechapter.\\theconclusion."
+
+#~ msgid "Assumption \\thechapter.\\theassumption."
+#~ msgstr "Annahme \\thechapter.\\theassumption."
+
+#~ msgid "Question \\thechapter.\\thequestion."
+#~ msgstr "Frage \\thechapter.\\thequestion."
+
+#, c-format
+#~ msgid "LyX: %1$s"
+#~ msgstr "LyX: %1$s"
+
 #~ msgid "American Geophysical Union (AGU, SGML Article)"
 #~ msgstr "American Geophysical Union (AGU, SGML-Aufsatz)"
 

commit b57166f656a84e61a7a5bfd06d815b5b76a9a96a
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Mon Aug 10 10:03:42 2020 +0200

    Nothing to translate here.

diff --git a/src/frontends/qt/GuiAlert.cpp b/src/frontends/qt/GuiAlert.cpp
index 8b626a9..ce696cb 100644
--- a/src/frontends/qt/GuiAlert.cpp
+++ b/src/frontends/qt/GuiAlert.cpp
@@ -304,7 +304,7 @@ bool doAskForText(docstring & response, docstring const & msg,
 		}
 	}
 
-	docstring const title = bformat(_("%1$s"), msg);
+	docstring const title = bformat(from_utf8("%1$s"), msg);
 
 	/// Long operation in progress prevents user from Ok-ing the error dialog
 	bool long_op = theApp()->longOperationStarted();

commit 74e63e754c5fcd0036c8453c718056910297720c
Author: Richard Kimberly Heck <rikiheck at lyx.org>
Date:   Sun Aug 9 13:31:36 2020 -0400

    Amend e6de6c2b

diff --git a/lib/layouts/theorems-ams-extended-chap-bytype.module b/lib/layouts/theorems-ams-extended-chap-bytype.module
index 75a7858..435eb65 100644
--- a/lib/layouts/theorems-ams-extended-chap-bytype.module
+++ b/lib/layouts/theorems-ams-extended-chap-bytype.module
@@ -56,24 +56,31 @@ Counter condition
 End
 Counter note
 	GuiName Note
+	Within         chapter
 End
 Counter notation
 	GuiName Notation
+	Within         chapter
 End
 Counter summary
 	GuiName Summary
+	Within         chapter
 End
 Counter acknowledgement
 	GuiName Acknowledgement
+	Within         chapter
 End
 Counter conclusion
 	GuiName Conclusion
+	Within         chapter
 End
 Counter assumption
 	GuiName Assumption
+	Within         chapter
 End
 Counter question
 	GuiName Question
+	Within         chapter
 End
 
 

commit e6de6c2b596d1554c4489a00cb82416010ae91c1
Author: Daniel Ramoeller <d.lyx at web.de>
Date:   Sun Aug 9 13:09:41 2020 -0400

    Fix bug #11741.
    
    Theorems weren't being numbered by chapter.

diff --git a/lib/layouts/theorems-ams-bytype.module b/lib/layouts/theorems-ams-bytype.module
index 0d39a1a..8c328c6 100644
--- a/lib/layouts/theorems-ams-bytype.module
+++ b/lib/layouts/theorems-ams-bytype.module
@@ -22,47 +22,6 @@ Format 82
 
 Requires	amsmath,amsthm
 
-# We need separate counters for each theorem-like style.
-Counter theorem
-	GuiName Theorem
-End
-Counter corollary
-	GuiName Corollary
-End
-Counter lemma
-	GuiName Lemma
-End
-Counter proposition
-	GuiName Proposition
-End
-Counter conjecture
-	GuiName Conjecture
-End
-Counter fact
-	GuiName Fact
-End
-Counter definition
-	GuiName Definition
-End
-Counter example
-	GuiName Example
-End
-Counter solution
-	GuiName Solution
-End
-Counter problem
-	GuiName Problem
-End
-Counter exercise
-	GuiName Exercise
-End
-Counter remark
-	GuiName Remark
-End
-Counter claim
-	GuiName Claim
-End
-
 Input theorems-order.inc
 Input theorems-ams-bytype.inc
 Input theorems-starred.inc
diff --git a/lib/layouts/theorems-ams-chap-bytype.inc b/lib/layouts/theorems-ams-chap-bytype.inc
index ffca387..e4528f7 100644
--- a/lib/layouts/theorems-ams-chap-bytype.inc
+++ b/lib/layouts/theorems-ams-chap-bytype.inc
@@ -27,42 +27,55 @@
 Format 82
 Counter theorem
 	GuiName Theorem
+	Within         chapter
 End
 Counter corollary
 	GuiName Corollary
+	Within         chapter
 End
 Counter lemma
 	GuiName Lemma
+	Within         chapter
 End
 Counter proposition
 	GuiName Proposition
+	Within         chapter
 End
 Counter conjecture
 	GuiName Conjecture
+	Within         chapter
 End
 Counter fact
 	GuiName Fact
+	Within         chapter
 End
 Counter definition
 	GuiName Definition
+	Within         chapter
 End
 Counter example
 	GuiName Example
+	Within         chapter
 End
 Counter problem
 	GuiName Problem
+	Within         chapter
 End
 Counter exercise
 	GuiName Exercise
+	Within         chapter
 End
 Counter solution
 	GuiName Solution
+	Within         chapter
 End
 Counter remark
 	GuiName Remark
+	Within         chapter
 End
 Counter claim
 	GuiName Claim
+	Within         chapter
 End
 
 OutlinerName thm "Definitions & Theorems"
@@ -92,7 +105,7 @@ Style Theorem
 	AlignPossible         Left
 	LabelType             Static
 	LabelCounter          theorem
-	LabelString           "Theorem \thechapter.\thetheorem."
+	LabelString           "Theorem \thetheorem."
 	Font
 	  Shape               Italic
 	  Size                Normal
@@ -122,7 +135,7 @@ End
 Style Corollary
 	CopyStyle             Theorem
 	LatexName             cor
-	LabelString           "Corollary \thechapter.\thecorollary."
+	LabelString           "Corollary \thecorollary."
 	Preamble
 	  \theoremstyle{plain}
     \ifx\thechapter\undefined
@@ -144,7 +157,7 @@ End
 Style Lemma
 	CopyStyle             Theorem
 	LatexName             lem
-	LabelString           "Lemma \thechapter.\thelemma."
+	LabelString           "Lemma \thelemma."
 	Preamble
 	  \theoremstyle{plain}
     \ifx\thechapter\undefined
@@ -166,7 +179,7 @@ End
 Style Proposition
 	CopyStyle             Theorem
 	LatexName             prop
-	LabelString           "Proposition \thechapter.\theproposition."
+	LabelString           "Proposition \theproposition."
 	Preamble
 	  \theoremstyle{plain}
     \ifx\thechapter\undefined
@@ -188,7 +201,7 @@ End
 Style Conjecture
 	CopyStyle             Theorem
 	LatexName             conjecture
-	LabelString           "Conjecture \thechapter.\theconjecture."
+	LabelString           "Conjecture \theconjecture."
 	Preamble
 	  \theoremstyle{plain}
     \ifx\thechapter\undefined
@@ -210,7 +223,7 @@ End
 Style Fact
 	CopyStyle             Theorem
 	LatexName             fact
-	LabelString           "Fact \thechapter.\thefact."
+	LabelString           "Fact \thefact."
 	Preamble
 	  \theoremstyle{plain}
     \ifx\thechapter\undefined
@@ -232,7 +245,7 @@ End
 Style Definition
 	CopyStyle             Theorem
 	LatexName             defn
-	LabelString           "Definition \thechapter.\thedefinition."
+	LabelString           "Definition \thedefinition."
 	Font
 	  Shape               Up
 	EndFont
@@ -261,7 +274,7 @@ End
 Style Example
 	CopyStyle             Definition
 	LatexName             example
-	LabelString           "Example \thechapter.\theexample."
+	LabelString           "Example \theexample."
 	Preamble
 	  \theoremstyle{definition}
     \ifx\thechapter\undefined
@@ -284,7 +297,7 @@ End
 Style Problem
 	CopyStyle             Definition
 	LatexName             problem
-	LabelString           "Problem \thechapter.\theproblem."
+	LabelString           "Problem \theproblem."
 	Preamble
 	  \theoremstyle{definition}
     \ifx\thechapter\undefined
@@ -307,7 +320,7 @@ End
 Style Exercise
 	CopyStyle             Definition
 	LatexName             xca
-	LabelString           "Exercise \thechapter.\theexercise."
+	LabelString           "Exercise \theexercise."
 	Preamble
 	  \theoremstyle{definition}
     \ifx\thechapter\undefined
@@ -330,7 +343,7 @@ End
 Style Solution
 	CopyStyle             Definition
 	LatexName             sol
-	LabelString           "Solution \thechapter.\thesolution."
+	LabelString           "Solution \thesolution."
 	Preamble
 	  \theoremstyle{definition}
     \ifx\thechapter\undefined
@@ -353,7 +366,7 @@ End
 Style Remark
 	CopyStyle             Theorem
 	LatexName             rem
-	LabelString           "Remark \thechapter.\theremark."
+	LabelString           "Remark \theremark."
 	Font
 	  Shape               Up
 	  Size                Normal
@@ -385,7 +398,7 @@ End
 Style Claim
 	CopyStyle             Remark
 	LatexName             claim
-	LabelString           "Claim \thechapter.\theclaim."
+	LabelString           "Claim \theclaim."
 	Preamble
 	  \theoremstyle{remark}
     \ifx\thechapter\undefined
diff --git a/lib/layouts/theorems-ams-chap-bytype.module b/lib/layouts/theorems-ams-chap-bytype.module
index b5c5a30..cc26eab 100644
--- a/lib/layouts/theorems-ams-chap-bytype.module
+++ b/lib/layouts/theorems-ams-chap-bytype.module
@@ -23,63 +23,6 @@ Format 82
 
 Requires	amsmath,amsthm
 
-# The environments defined (regular and starred) are :
-# - theorem
-# - corollary
-# - lemma
-# - proposition
-# - conjecture
-# - fact
-# - definition
-# - example
-# - solution
-# - problem
-# - exercise
-# - remark
-# - claim
-
-# We need separate counters for each theorem-like style.
-Counter theorem
-	GuiName Theorem
-End
-Counter corollary
-	GuiName Corollary
-End
-Counter lemma
-	GuiName Lemma
-End
-Counter proposition
-	GuiName Proposition
-End
-Counter conjecture
-	GuiName Conjecture
-End
-Counter fact
-	GuiName Fact
-End
-Counter definition
-	GuiName Definition
-End
-Counter example
-	GuiName Example
-End
-Counter solution
-	GuiName Solution
-End
-Counter problem
-	GuiName Problem
-End
-Counter exercise
-	GuiName Exercise
-End
-Counter remark
-	GuiName Remark
-End
-Counter claim
-	GuiName Claim
-End
-
-
 Input theorems-order.inc
 Input theorems-ams-chap-bytype.inc
 Input theorems-starred.inc
diff --git a/lib/layouts/theorems-ams-extended-chap-bytype.module b/lib/layouts/theorems-ams-extended-chap-bytype.module
index b2aced5..75a7858 100644
--- a/lib/layouts/theorems-ams-extended-chap-bytype.module
+++ b/lib/layouts/theorems-ams-extended-chap-bytype.module
@@ -40,15 +40,19 @@ Requires	amsmath
 # We need separate counters for each theorem-like style.
 Counter criterion
 	GuiName Criterion
+	Within         chapter
 End
 Counter algorithm
 	GuiName Algorithm
+	Within         chapter
 End
 Counter axiom
 	GuiName Axiom
+	Within         chapter
 End
 Counter condition
 	GuiName Condition
+	Within         chapter
 End
 Counter note
 	GuiName Note
@@ -78,7 +82,7 @@ End
 Style Criterion
 	CopyStyle             Theorem
 	LatexName             criterion
-	LabelString           "Criterion \thechapter.\thecriterion."
+	LabelString           "Criterion \thecriterion."
 	Preamble
 	  \theoremstyle{plain}
     \ifx\thechapter\undefined
@@ -117,7 +121,7 @@ End
 Style Algorithm
 	CopyStyle             Theorem
 	LatexName             lyxalgorithm
-	LabelString           "Algorithm \thechapter.\thealgorithm."
+	LabelString           "Algorithm \thealgorithm."
 	Preamble
 	  \theoremstyle{plain}
     \ifx\thechapter\undefined
@@ -156,7 +160,7 @@ End
 Style Axiom
 	CopyStyle             Theorem
 	LatexName             ax
-	LabelString           "Axiom \thechapter.\theaxiom."
+	LabelString           "Axiom \theaxiom."
 	Preamble
 	  \theoremstyle{plain}
     \ifx\thechapter\undefined
@@ -195,7 +199,7 @@ End
 Style Condition
 	CopyStyle             Definition
 	LatexName             condition
-	LabelString           "Condition \thechapter.\thecondition."
+	LabelString           "Condition \thecondition."
 	Preamble
 	  \theoremstyle{definition}
     \ifx\thechapter\undefined
@@ -234,7 +238,7 @@ End
 Style Note
 	CopyStyle             Remark
 	LatexName             note
-	LabelString           "Note \thechapter.\thenote."
+	LabelString           "Note \thenote."
 	Preamble
 	  \theoremstyle{remark}
     \ifx\thechapter\undefined
@@ -273,7 +277,7 @@ End
 Style Notation
 	CopyStyle             Remark
 	LatexName             notation
-	LabelString           "Notation \thechapter.\thenotation."
+	LabelString           "Notation \thenotation."
 	Preamble
 	  \theoremstyle{remark}
     \ifx\thechapter\undefined
@@ -312,7 +316,7 @@ End
 Style Summary
 	CopyStyle             Remark
 	LatexName             summary
-	LabelString           "Summary \thechapter.\thesummary."
+	LabelString           "Summary \thesummary."
 	Preamble
 	  \theoremstyle{remark}
     \ifx\thechapter\undefined
@@ -352,7 +356,7 @@ End
 Style Acknowledgement
 	CopyStyle             Remark
 	LatexName             acknowledgement
-	LabelString           "Acknowledgement \thechapter.\theacknowledgement."
+	LabelString           "Acknowledgement \theacknowledgement."
 	Preamble
 	  \theoremstyle{remark}
     \ifx\thechapter\undefined
@@ -391,7 +395,7 @@ End
 Style Conclusion
 	CopyStyle             Remark
 	LatexName             conclusion
-	LabelString           "Conclusion \thechapter.\theconclusion."
+	LabelString           "Conclusion \theconclusion."
 	Preamble
 	  \theoremstyle{remark}
     \ifx\thechapter\undefined
@@ -430,7 +434,7 @@ End
 Style Assumption
 	CopyStyle             Theorem
 	LatexName             assumption
-	LabelString           "Assumption \thechapter.\theassumption."
+	LabelString           "Assumption \theassumption."
 	Preamble
 	  \theoremstyle{plain}
     \ifx\thechapter\undefined
@@ -469,7 +473,7 @@ Style Question
 	CopyStyle             Theorem
 	DependsOn             Theorem
 	LatexName             question
-	LabelString           "Question \thechapter.\thequestion."
+	LabelString           "Question \thequestion."
 	Preamble
 	  \theoremstyle{plain}
     \ifx\thechapter\undefined

commit c9bb6994572939fc55da935c3f13ef43cf2e5840
Author: Richard Kimberly Heck <rikiheck at lyx.org>
Date:   Sun Aug 9 13:00:41 2020 -0400

    Fix #10328.
    
    Change title of LyX's windows to conform to the usual pattern.

diff --git a/src/frontends/qt/DialogView.cpp b/src/frontends/qt/DialogView.cpp
index 9b114ec..1c973b4 100644
--- a/src/frontends/qt/DialogView.cpp
+++ b/src/frontends/qt/DialogView.cpp
@@ -18,7 +18,7 @@ namespace lyx {
 namespace frontend {
 
 DialogView::DialogView(GuiView & lv, QString const & name, QString const & title)
-	: QDialog(&lv), Dialog(lv, name, "LyX: " + title)
+	: QDialog(&lv), Dialog(lv, name, title)
 {
 	connect(&lv, SIGNAL(bufferViewChanged()),
 	        this, SLOT(onBufferViewChanged()));
diff --git a/src/frontends/qt/GuiAlert.cpp b/src/frontends/qt/GuiAlert.cpp
index 886e0cb..8b626a9 100644
--- a/src/frontends/qt/GuiAlert.cpp
+++ b/src/frontends/qt/GuiAlert.cpp
@@ -75,14 +75,14 @@ docstring toPlainText(docstring const & msg)
 }
 
 
-int doPrompt(docstring const & title0, docstring const & question,
+int doPrompt(docstring const & title, docstring const & question,
 		  int default_button, int cancel_button,
 		  docstring const & b1, docstring const & b2,
 		  docstring const & b3, docstring const & b4)
 {
-	//lyxerr << "PROMPT" << title0 << "FOCUS: " << qApp->focusWidget() << endl;
+	//lyxerr << "PROMPT" << title << "FOCUS: " << qApp->focusWidget() << endl;
 	if (!use_gui || lyxerr.debugging()) {
-		lyxerr << toPlainText(title0) << '\n'
+		lyxerr << toPlainText(title) << '\n'
 		       << "----------------------------------------\n"
 		       << toPlainText(question) << endl;
 
@@ -97,8 +97,6 @@ int doPrompt(docstring const & title0, docstring const & question,
 			return default_button;
 	}
 
-	docstring const title = bformat(_("LyX: %1$s"), title0);
-
 	/// Long operation in progress prevents user from Ok-ing the error dialog
 	bool long_op = theApp()->longOperationStarted();
 	if (long_op)
@@ -137,7 +135,7 @@ int doPrompt(docstring const & title0, docstring const & question,
 	return res;
 }
 
-int prompt(docstring const & title0, docstring const & question,
+int prompt(docstring const & title, docstring const & question,
 		  int default_button, int cancel_button,
 		  docstring const & b0, docstring const & b1,
 		  docstring const & b2, docstring const & b3)
@@ -147,22 +145,20 @@ int prompt(docstring const & title0, docstring const & question,
 #else
 	return doPrompt(
 #endif
-				title0, question, default_button,
+				title, question, default_button,
 				cancel_button, b0, b1, b2, b3);
 }
 
-void doWarning(docstring const & title0, docstring const & message,
+void doWarning(docstring const & title, docstring const & message,
 	     bool const & askshowagain)
 {
-	lyxerr << "Warning: " << toPlainText(title0) << '\n'
+	lyxerr << "Warning: " << toPlainText(title) << '\n'
 	       << "----------------------------------------\n"
 	       << toPlainText(message) << endl;
 
 	if (!use_gui)
 		return;
 
-	docstring const title = bformat(_("LyX: %1$s"), title0);
-
 	if (theApp() == 0) {
 		noAppDialog(toqstr(title), toqstr(message), QMessageBox::Warning);
 		return;
@@ -193,7 +189,7 @@ void doWarning(docstring const & title0, docstring const & message,
 		theApp()->startLongOperation();
 }
 
-void warning(docstring const & title0, docstring const & message,
+void warning(docstring const & title, docstring const & message,
 	     bool const & askshowagain)
 {
 #ifdef EXPORT_in_THREAD
@@ -201,12 +197,12 @@ void warning(docstring const & title0, docstring const & message,
 #else
 	doWarning(
 #endif
-				title0, message, askshowagain);
+				title, message, askshowagain);
 }
 
-void doError(docstring const & title0, docstring const & message, bool backtrace)
+void doError(docstring const & title, docstring const & message, bool backtrace)
 {
-	lyxerr << "Error: " << toPlainText(title0) << '\n'
+	lyxerr << "Error: " << toPlainText(title) << '\n'
 	       << "----------------------------------------\n"
 	       << toPlainText(message) << endl;
 
@@ -217,8 +213,6 @@ void doError(docstring const & title0, docstring const & message, bool backtrace
 	if (!use_gui)
 		return;
 
-	docstring const title = bformat(_("LyX: %1$s"), title0);
-
 	if (theApp() == 0) {
 		noAppDialog(toqstr(title), toqstr(message), QMessageBox::Critical);
 		return;
@@ -243,28 +237,26 @@ void doError(docstring const & title0, docstring const & message, bool backtrace
 		theApp()->startLongOperation();
 }
 
-void error(docstring const & title0, docstring const & message, bool backtrace)
+void error(docstring const & title, docstring const & message, bool backtrace)
 {
 #ifdef EXPORT_in_THREAD
 	InGuiThread<void>().call(&doError,
 #else
 	doError(
 #endif
-				title0, message, backtrace);
+				title, message, backtrace);
 }
 
-void doInformation(docstring const & title0, docstring const & message)
+void doInformation(docstring const & title, docstring const & message)
 {
 	if (!use_gui || lyxerr.debugging())
-		lyxerr << toPlainText(title0) << '\n'
+		lyxerr << toPlainText(title) << '\n'
 		       << "----------------------------------------\n"
 		       << toPlainText(message) << endl;
 
 	if (!use_gui)
 		return;
 
-	docstring const title = bformat(_("LyX: %1$s"), title0);
-
 	if (theApp() == 0) {
 		noAppDialog(toqstr(title), toqstr(message), QMessageBox::Information);
 		return;
@@ -288,14 +280,14 @@ void doInformation(docstring const & title0, docstring const & message)
 		theApp()->startLongOperation();
 }
 
-void information(docstring const & title0, docstring const & message)
+void information(docstring const & title, docstring const & message)
 {
 #ifdef EXPORT_in_THREAD
 	InGuiThread<void>().call(&doInformation,
 #else
 	doInformation(
 #endif
-				title0, message);
+				title, message);
 }
 
 bool doAskForText(docstring & response, docstring const & msg,
@@ -312,7 +304,7 @@ bool doAskForText(docstring & response, docstring const & msg,
 		}
 	}
 
-	docstring const title = bformat(_("LyX: %1$s"), msg);
+	docstring const title = bformat(_("%1$s"), msg);
 
 	/// Long operation in progress prevents user from Ok-ing the error dialog
 	bool long_op = theApp()->longOperationStarted();
diff --git a/src/frontends/qt/GuiDialog.cpp b/src/frontends/qt/GuiDialog.cpp
index 8778886..3426c79 100644
--- a/src/frontends/qt/GuiDialog.cpp
+++ b/src/frontends/qt/GuiDialog.cpp
@@ -26,7 +26,7 @@ namespace lyx {
 namespace frontend {
 
 GuiDialog::GuiDialog(GuiView & lv, QString const & name, QString const & title)
-	: QDialog(&lv), Dialog(lv, name, "LyX: " + title), updating_(false),
+	: QDialog(&lv), Dialog(lv, name, title), updating_(false),
 	  is_closing_(false)
 {
 	connect(&lv, SIGNAL(bufferViewChanged()),
diff --git a/src/frontends/qt/ui/ToggleWarningUi.ui b/src/frontends/qt/ui/ToggleWarningUi.ui
index 47562f5..1b8b746 100644
--- a/src/frontends/qt/ui/ToggleWarningUi.ui
+++ b/src/frontends/qt/ui/ToggleWarningUi.ui
@@ -11,7 +11,7 @@
    </rect>
   </property>
   <property name="windowTitle">
-   <string>LyX: Enter text</string>
+   <string>Enter text</string>
   </property>
   <property name="sizeGripEnabled">
    <bool>true</bool>

commit d3a04c089b5e7345a6d5557dd99392a42cc0b83a
Author: Daniel Ramoeller <d.lyx at web.de>
Date:   Fri Aug 7 16:13:48 2020 +0200

    Fix for bug #11926
    
    Change comobox signal to user interaction only to avoid problems with "Apply changes immediately" aka "Immediate Apply". (See https://doc.qt.io/qt-5/qcombobox.html#currentIndexChanged and https://doc.qt.io/qt-5/qcombobox.html#activated.)

diff --git a/src/frontends/qt/GuiCharacter.cpp b/src/frontends/qt/GuiCharacter.cpp
index 06a007c..d1d4336 100644
--- a/src/frontends/qt/GuiCharacter.cpp
+++ b/src/frontends/qt/GuiCharacter.cpp
@@ -221,14 +221,14 @@ GuiCharacter::GuiCharacter(GuiView & lv)
 	connect(autoapplyCB, SIGNAL(stateChanged(int)), this,
 		SLOT(slotAutoApply()));
 
-	connect(ulineCO, SIGNAL(currentIndexChanged(int)), this, SLOT(change_adaptor()));
-	connect(strikeCO, SIGNAL(currentIndexChanged(int)), this, SLOT(change_adaptor()));
-	connect(sizeCO, SIGNAL(currentIndexChanged(int)), this, SLOT(change_adaptor()));
-	connect(familyCO, SIGNAL(currentIndexChanged(int)), this, SLOT(change_adaptor()));
-	connect(seriesCO, SIGNAL(currentIndexChanged(int)), this, SLOT(change_adaptor()));
-	connect(shapeCO, SIGNAL(currentIndexChanged(int)), this, SLOT(change_adaptor()));
-	connect(colorCO, SIGNAL(currentIndexChanged(int)), this, SLOT(change_adaptor()));
-	connect(langCO, SIGNAL(currentIndexChanged(int)), this, SLOT(change_adaptor()));
+	connect(ulineCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
+	connect(strikeCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
+	connect(sizeCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
+	connect(familyCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
+	connect(seriesCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
+	connect(shapeCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
+	connect(colorCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
+	connect(langCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
 
 	family = familyData();
 	series = seriesData();

commit e417597597d9be12cd792343ae9b958854ab4df8
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Sun Aug 9 12:01:49 2020 +0200

    Consider nesting when checking whether an inset is in a title
    
    Amends 0bddf448ef5

diff --git a/src/insets/InsetText.cpp b/src/insets/InsetText.cpp
index e448a3f..10b15c8 100644
--- a/src/insets/InsetText.cpp
+++ b/src/insets/InsetText.cpp
@@ -873,6 +873,14 @@ void InsetText::updateBuffer(ParIterator const & it, UpdateType utype, bool cons
 		// Record in this inset is embedded in a title layout
 		// This is needed to decide when \maketitle is output.
 		intitle_context_ = it.paragraph().layout().intitle;
+		// Also check embedding layouts
+		size_t const n = it.depth();
+		for (size_t i = 0; i < n; ++i) {
+			if (it[i].paragraph().layout().intitle) {
+				intitle_context_ = true;
+				break;
+			}
+		}
 	} else {
 		DocumentClass const & tclass = buffer().masterBuffer()->params().documentClass();
 		// Note that we do not need to call:

commit 9fffb7c614e00decf0af17abea69f44a8b78b376
Author: Kornel Benko <kornel at lyx.org>
Date:   Sun Aug 9 10:44:48 2020 +0200

    Update sk.po

diff --git a/po/sk.po b/po/sk.po
index 9f63b2e..553f9f7 100644
--- a/po/sk.po
+++ b/po/sk.po
@@ -8,8 +8,8 @@ msgid ""
 msgstr ""
 "Project-Id-Version: LyX-2.4\n"
 "Report-Msgid-Bugs-To: lyx-devel at lists.lyx.org\n"
-"POT-Creation-Date: 2020-08-01 08:07+0200\n"
-"PO-Revision-Date: 2020-08-01 16:57+0000\n"
+"POT-Creation-Date: 2020-08-08 16:52+0200\n"
+"PO-Revision-Date: 2020-08-08 15:18+0000\n"
 "Last-Translator: Kornel Benko <kornel at lyx.org>\n"
 "Language-Team: Slovak <kornel at lyx.org>\n"
 "Language: sk\n"
@@ -285,6 +285,10 @@ msgstr "Odstrániť vybranú databázu"
 msgid "&Delete"
 msgstr "Zm&azať"
 
+#: src/frontends/qt/ui/BibtexUi.ui:107
+msgid "Move the selected database up (Ctrl-Up)"
+msgstr "Presunúť označenú databázu nahor (Ctrl-Up)"
+
 #: src/frontends/qt/ui/BibtexUi.ui:107 src/frontends/qt/ui/CitationUi.ui:188
 msgid "Move the selected citation up (Ctrl-Up)"
 msgstr "Presunúť označenú citáciu nahor (Ctrl-Up)"
@@ -294,6 +298,10 @@ msgstr "Presunúť označenú citáciu nahor (Ctrl-Up)"
 msgid "&Up"
 msgstr "Na&hor"
 
+#: src/frontends/qt/ui/BibtexUi.ui:130
+msgid "Move the selected database down (Ctrl-Down)"
+msgstr "Presunúť označenú databázu nadol (Ctrl-Down)"
+
 #: src/frontends/qt/ui/BibtexUi.ui:130 src/frontends/qt/ui/CitationUi.ui:211
 msgid "Move the selected citation down (Ctrl-Down)"
 msgstr "Presunúť označenú citáciu nadol (Ctrl-Down)"
@@ -2494,6 +2502,10 @@ msgstr "Použiť d&ynamické úvodzovky"
 msgid "&Encoding:"
 msgstr "Kó&dovanie:"
 
+#: src/frontends/qt/ui/LanguageUi.ui:102
+msgid "Select encoding of the generated LaTeX source (LaTeX input encoding)."
+msgstr "Vybrať kódovanie pre vytvorený LaTeX zdroj (LaTeX input encoding)."
+
 #: src/frontends/qt/ui/LanguageUi.ui:116
 msgid "Select Unicode encoding variant."
 msgstr "Vyberte variant kódovania unicode (utf8)."

commit f78fac5a91e55029c228c02bc2d22d21eb835f38
Author: Kornel Benko <kornel at lyx.org>
Date:   Sun Aug 9 10:42:02 2020 +0200

    Cmake build: Set defaults for using 3rdparty sources according to build type

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1523397..62eff71 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -161,24 +161,28 @@ if(LYX_BUILD_TYPE STREQUAL "development")
   set(DefaultLyxStdlibDebug ON)
   set(DefaultLyxEnableAssertions ON)
   set(DefaultLyxProfile OFF)
+  set(DefaultExternalLibs OFF)
 elseif(LYX_BUILD_TYPE STREQUAL "prerelease")
   set(DefaultLyxDebug OFF)
   set(DefaultLyxRelease OFF)
   set(DefaultLyxStdlibDebug OFF)
   set(DefaultLyxEnableAssertions OFF)
   set(DefaultLyxProfile OFF)
+  set(DefaultExternalLibs ON)
 elseif(LYX_BUILD_TYPE STREQUAL "release")
   set(DefaultLyxDebug OFF)
   set(DefaultLyxRelease ON)
   set(DefaultLyxStdlibDebug OFF)
   set(DefaultLyxEnableAssertions OFF)
   set(DefaultLyxProfile OFF)
+  set(DefaultExternalLibs ON)
 elseif(LYX_BUILD_TYPE STREQUAL "gprof")
   set(DefaultLyxDebug ON)
   set(DefaultLyxRelease OFF)
   set(DefaultLyxStdlibDebug OFF)
   set(DefaultLyxEnableAssertions OFF)
   set(DefaultLyxProfile ON)
+  set(DefaultExternalLibs OFF)
 else()
   message(FATAL_ERROR "Invalid build type (${LYX_BUILD_TYPE}) encountered")
 endif()
@@ -220,15 +224,15 @@ LYX_COMBO(USE_QT            "Use Qt version as frontend" AUTO QT4 QT5)
 LYX_COMBO(USE_IPO           "Interprocedural optimization" OFF AUTO ON)
 #LYX_OPTION(3RDPARTY_BUILD   "Build 3rdparty libs" OFF ALL)
 LYX_OPTION(DISABLE_CALLSTACK_PRINTING "do not print a callstack when crashing" OFF ALL)
-LYX_OPTION(EXTERNAL_Z       "OFF := Build 3rdparty lib zlib" ON ALL)
-LYX_OPTION(EXTERNAL_DTL     "OFF := Build 3rdparty commands dt2dv and dv2dt" ON ALL)
-LYX_OPTION(EXTERNAL_ICONV   "OFF := Build 3rdparty lib iconvlib" ON ALL)
-LYX_OPTION(EXTERNAL_HUNSPELL "OFF := Build 3rdparty lib hunspelllib" ON ALL)
+LYX_OPTION(EXTERNAL_Z       "OFF := Build 3rdparty lib zlib" ${DefaultExternalLibs} ALL)
+LYX_OPTION(EXTERNAL_DTL     "OFF := Build 3rdparty commands dt2dv and dv2dt" ${DefaultExternalLibs} ALL)
+LYX_OPTION(EXTERNAL_ICONV   "OFF := Build 3rdparty lib iconvlib" ${DefaultExternalLibs} ALL)
+LYX_OPTION(EXTERNAL_HUNSPELL "OFF := Build 3rdparty lib hunspelllib" ${DefaultExternalLibs} ALL)
 LYX_COMBO(EXTERNAL_MYTHES   "OFF := Build 3rdparty lib mytheslib" AUTO OFF ON)
 
 # GCC specific
 LYX_OPTION(PROFILE              "Build with options for gprof" ${DefaultLyxProfile} GCC)
-LYX_OPTION(EXTERNAL_BOOST       "Use external boost" OFF GCC)
+LYX_OPTION(EXTERNAL_BOOST       "Use external boost" ${DefaultExternalLibs} GCC)
 LYX_OPTION(PROGRAM_SUFFIX       "Append version suffix to binaries" ON GCC)
 LYX_OPTION(DEBUG_GLIBC          "Enable libstdc++ debug mode" OFF GCC)
 LYX_OPTION(DEBUG_GLIBC_PEDANTIC "Enable libstdc++ pedantic debug mode" OFF GCC)

commit af7ffc7dfa00297e58d332d57f4ead76265cdda3
Author: Yuriy Skalko <yuriy.skalko at gmail.com>
Date:   Fri Aug 7 20:27:39 2020 +0300

    Correct UI strings

diff --git a/src/frontends/qt/ui/BibtexUi.ui b/src/frontends/qt/ui/BibtexUi.ui
index 3eac510..ac41646 100644
--- a/src/frontends/qt/ui/BibtexUi.ui
+++ b/src/frontends/qt/ui/BibtexUi.ui
@@ -104,7 +104,7 @@
            </sizepolicy>
           </property>
           <property name="toolTip">
-           <string>Move the selected citation up (Ctrl-Up)</string>
+           <string>Move the selected database up (Ctrl-Up)</string>
           </property>
           <property name="text">
            <string>&Up</string>
@@ -127,7 +127,7 @@
            </sizepolicy>
           </property>
           <property name="toolTip">
-           <string>Move the selected citation down (Ctrl-Down)</string>
+           <string>Move the selected database down (Ctrl-Down)</string>
           </property>
           <property name="text">
            <string>Do&wn</string>
diff --git a/src/frontends/qt/ui/LanguageUi.ui b/src/frontends/qt/ui/LanguageUi.ui
index f56026a..23e8630 100644
--- a/src/frontends/qt/ui/LanguageUi.ui
+++ b/src/frontends/qt/ui/LanguageUi.ui
@@ -99,8 +99,7 @@
         <bool>true</bool>
        </property>
        <property name="toolTip">
-        <string>Select encoding of the generated LaTeX source
-	  (LaTeX input encoding).</string>
+        <string>Select encoding of the generated LaTeX source (LaTeX input encoding).</string>
        </property>
        <property name="duplicatesEnabled">
         <bool>false</bool>

commit 1af9e3b0fc096e464c20c7cdd48145c335a50086
Author: Yuriy Skalko <yuriy.skalko at gmail.com>
Date:   Fri Aug 7 20:26:37 2020 +0300

    Update Russian localization

diff --git a/lib/doc/ru/Math.lyx b/lib/doc/ru/Math.lyx
index a216e05..f585afd 100644
--- a/lib/doc/ru/Math.lyx
+++ b/lib/doc/ru/Math.lyx
@@ -3186,7 +3186,7 @@ status collapsed
 status collapsed
 
 \begin_layout Plain Layout
-Химические символы ! Изотопы
+Химические символы ! изотопы
 \end_layout
 
 \end_inset
@@ -15671,7 +15671,7 @@ name "subsec:Operator-Limits"
 status collapsed
 
 \begin_layout Plain Layout
-Операторы ! Пределы
+Операторы ! пределы
 \end_layout
 
 \end_inset
@@ -22520,7 +22520,7 @@ reference "subsec:Font-Sizes"
 status collapsed
 
 \begin_layout Plain Layout
-Символы ! Символ евро
+Символы ! символ евро
 \end_layout
 
 \end_inset
@@ -30927,8 +30927,8 @@ removefromreset
 
 \begin_layout Standard
 
-\family typewriter
-(номер_раздела.номер_формулы)
+\series bold
+(номер-раздела.номер-формулы)
 \end_layout
 
 \begin_layout Standard
@@ -31153,7 +31153,7 @@ name "subsec:Chemical-Symbols-and"
 status collapsed
 
 \begin_layout Plain Layout
-Химические символы ! Знаки
+Химические символы ! знаки
 \end_layout
 
 \end_inset
@@ -32878,7 +32878,7 @@ A=B
 status collapsed
 
 \begin_layout Plain Layout
-Пользовательские команды ! Математические макросы
+Пользовательские команды ! математические макросы
 \end_layout
 
 \end_inset
@@ -35238,13 +35238,13 @@ hyperref
 \series bold
 
 \backslash
-texorpdfstring{часть}{альтернатива}
+texorpdfstring{строка-tex}{строка-pdf}
+\series default
+
 \begin_inset Index idx
-status open
+status collapsed
 
 \begin_layout Plain Layout
-
-\series bold
 Команды ! T ! 
 \backslash
 texorpdfstring
@@ -35258,15 +35258,15 @@ texorpdfstring
 \begin_layout Standard
 
 \series bold
-Часть
+Строка-tex
 \series default
  — это часть заголовка, которая не должна появляться в PDF-закладке.
  Это могут быть символы, формулы, сноски, а также перекрестные ссылки.
- 
+ Вместо этого для закладки используется 
 \series bold
-Альтернатива
+строка-pdf
 \series default
- используется вместо этой части для закладки.
+.
 \end_layout
 
 \begin_layout Standard
@@ -35405,7 +35405,7 @@ status collapsed
 
 \begin_layout Standard
 Формулы в многоколоночном тексте часто слишком широки, чтобы поместиться
- в столбец, и поэтому их необходимо задавать по всей ширине страницы.
+ в столбец, и поэтому их необходимо размещать на всю ширину страницы.
  Это делается с помощью \SpecialChar LaTeX
 -пакета 
 \series bold
@@ -35463,7 +35463,7 @@ status open
 Настройки\SpecialChar menuseparator
 Макет текста
 \family default
- не должен быть выбран.
+ устанавливать не нужно.
 \end_layout
 
 \end_inset
@@ -35472,7 +35472,8 @@ status open
 \end_layout
 
 \begin_layout Standard
-Перед многоколоночным текстом команда
+Перед многоколоночным текстом в режиме \SpecialChar TeX
+ записывается команда
 \end_layout
 
 \begin_layout Standard
@@ -35484,16 +35485,14 @@ begin{multicols}{количество-колонок}
 \end_layout
 
 \begin_layout Standard
-записывается в режиме \SpecialChar TeX
-.
- 
+
 \series bold
 Количество-колонок
 \series default
  — это число в диапазоне 2–10.
- Перед формулой текст из нескольких столбцов заканчивается вводом, также
+ Перед формулой текст из нескольких столбцов заканчивается путем задания
  в режиме \SpecialChar TeX
-, команды
+ команды
 \end_layout
 
 \begin_layout Standard
@@ -35514,9 +35513,9 @@ end{multicols}
 
 mm.
  Если при этом используется стиль 
-\series bold
+\family sans
 Отступ для формулы
-\series default
+\family default
 
 \begin_inset Foot
 status collapsed
@@ -35782,9 +35781,9 @@ status collapsed
 hfill
 \series default
  работает только в формулах со стилем 
-\series bold
+\family sans
 Отступ для формулы
-\series default
+\family default
 , см.
  
 \begin_inset CommandInset ref
@@ -35798,8 +35797,8 @@ reference "subsec:Variable-Space"
 
 \end_inset
 
- вставляется до и после матрицы, чтобы иметь одинаковый промежуток от матрицы,
- и до уравнения, и до бокового поля.
+ вставляется до и после матрицы, чтобы иметь одинаковый промежуток от матрицы
+ до уравнения и до бокового поля.
 \end_layout
 
 \begin_layout Standard
@@ -36109,7 +36108,7 @@ reference "subsec:Binary-Operators"
 
 \end_inset
 
-, потому что этот символ определен во всех кодировки как текстовый символ.
+, потому что этот символ определен во всех кодировках как текстовый символ.
  Но кодировка может быть изменена следующей строкой преамбулы \SpecialChar LaTeX
 :
 \end_layout
@@ -36119,7 +36118,7 @@ reference "subsec:Binary-Operators"
 \series bold
 
 \backslash
-Declare Inputtext{183}{
+DeclareInputtext{183}{
 \backslash
 ifmmode
 \backslash
@@ -36141,7 +36140,15 @@ i}
 Язык
 \family default
 ) указывает, какой символ появляется при нажатии клавиши клавиатуры.
- При нажатии клавиши для символа '·' внутри используется команда 
+ При нажатии клавиши для символа 
+\begin_inset Quotes rld
+\end_inset
+
+·
+\begin_inset Quotes rrd
+\end_inset
+
+ внутри используется команда 
 \series bold
 
 \backslash
@@ -36155,7 +36162,7 @@ textperiodcentered
 \end_layout
 
 \begin_layout Standard
-Кодировка некоторых символов сохраняется в файлах определений.
+Кодировки наборов символов хранятся в файлах определений.
  Например, кодировка 
 \series bold
 latin9
@@ -36164,7 +36171,7 @@ latin9
 \series bold
 latin9.def
 \series default
-, который находится в папке установки \SpecialChar LaTeX
+, который находится в каталоге установки \SpecialChar LaTeX
 .
  Кодировки следует изменять только через преамбулу \SpecialChar LaTeX
 , а не в файлах определений.
@@ -36292,7 +36299,7 @@ A=B%\text{Это --- комментарий}
 status collapsed
 
 \begin_layout Plain Layout
-Типографские комментарии
+Типографские рекомендации
 \end_layout
 
 \end_inset
@@ -36584,8 +36591,8 @@ status collapsed
 \end_layout
 
 \begin_layout Standard
-Некоторые символы и знаки могут быть созданы с помощью определенных команд.
- Приведем список команд синонимов:
+Некоторые символы и знаки могут быть созданы с помощью нескольких команд.
+ Приведем список команд-синонимов:
 \end_layout
 
 \begin_layout Standard
@@ -36616,7 +36623,7 @@ status collapsed
 \begin_inset Text
 
 \begin_layout Plain Layout
-эквивалентна
+Синоним
 \end_layout
 
 \end_inset
@@ -36904,7 +36911,7 @@ vert
 \begin_inset Text
 
 \begin_layout Plain Layout
-эквивалентна
+Синоним
 \end_layout
 
 \end_inset
diff --git a/lib/doc/ru/Tutorial.lyx b/lib/doc/ru/Tutorial.lyx
index 1bc089c..128a250 100644
--- a/lib/doc/ru/Tutorial.lyx
+++ b/lib/doc/ru/Tutorial.lyx
@@ -1533,8 +1533,8 @@ status collapsed
 \end_layout
 
 \begin_layout Itemize
-планы и структуры могут использовать нумерованные списки (и буквенные подсписки)
- окружения 
+планы могут использовать нумерованные списки (и буквенные подсписки) окружения
+ 
 \family sans
 Перечисление
 \family default
@@ -1547,7 +1547,8 @@ status collapsed
 \family sans
 Описание
 \family default
-, где каждый пункт списка начинается с выделенного жирным шрифтом слова;
+, где каждый пункт списка начинается с выделенного жирным шрифтом названия
+ пакета;
 \end_layout
 
 \begin_layout Itemize
@@ -3243,7 +3244,7 @@ pdf
 \begin_inset space ~
 \end_inset
 
-структуры
+навигации
 \begin_inset Foot
 status collapsed
 
@@ -3265,10 +3266,10 @@ arg   "dialog-toggle toc"
  Это очень полезный инструмент для переупорядочивания частей вашего документа.
  Вы можете использовать панель 
 \family sans
-Структура
+Навигация
 \family default
  для перемещения по вашему документу.
- Нажатие кнопкой мыши на заголовок раздела или подраздела в нём приведёт
+ Нажатие кнопкой мыши на заголовок раздела или подраздела в ней приведёт
  к подсветке строки и перемещению курсора (в окне редактора \SpecialChar LyX
 ) на соответствующее
  место в документе.
diff --git a/lib/doc/ru/UserGuide.lyx b/lib/doc/ru/UserGuide.lyx
index bf70941..3ac4e63 100644
--- a/lib/doc/ru/UserGuide.lyx
+++ b/lib/doc/ru/UserGuide.lyx
@@ -1633,7 +1633,7 @@ status collapsed
 \begin_layout Itemize
 Панель 
 \family sans
-Структура
+Навигация
 \family default
 , доступ к которой осуществляется либо через меню 
 \family sans
@@ -1642,7 +1642,7 @@ status collapsed
 \begin_inset space ~
 \end_inset
 
-структуры
+навигации
 \family default
 , либо с помощью кнопки панели инструментов 
 \begin_inset Info
@@ -1693,7 +1693,7 @@ F5
 \end_layout
 
 \begin_layout Subsection
-Структура документа
+Панель навигации
 \begin_inset CommandInset label
 LatexCommand label
 name "subsec:The-Outliner"
@@ -1705,17 +1705,7 @@ name "subsec:The-Outliner"
 status collapsed
 
 \begin_layout Plain Layout
-Навигация ! структура
-\end_layout
-
-\end_inset
-
-
-\begin_inset Index idx
-status collapsed
-
-\begin_layout Plain Layout
-Структура
+Навигация ! панель
 \end_layout
 
 \end_inset
@@ -1724,10 +1714,9 @@ status collapsed
 \end_layout
 
 \begin_layout Standard
-В раскрывающемся списке в верхней части панели структуры можно выбрать один
- из нескольких различных списков, включая другие объекты, подобные содержанию,
- такие как списки таблиц, рисунков, сносок, меток и перекрестных ссылок
- (см.
+В раскрывающемся списке в верхней части панели навигации можно выбрать один
+ из нескольких различных списков, подобных содержанию, такие как списки
+ таблиц, рисунков, сносок, меток и перекрестных ссылок (см.
  раздел
 \begin_inset space ~
 \end_inset
@@ -1759,8 +1748,8 @@ reference "sec:Bibliography"
 \begin_layout Standard
 Щелчок правой кнопкой мыши на элементе этой структуры во многих случаях
  открывает контекстное меню, которое позволяет напрямую изменять этот элемент.
- Например, при обзоре библиографических ссылок контекстное меню позволяет
- открыть диалоговое окно и изменить ссылку.
+ Например, если вы просматриваете библиографические ссылки, то контекстное
+ меню позволяет открыть диалоговое окно и изменить ссылку.
 \end_layout
 
 \begin_layout Standard
@@ -1768,20 +1757,20 @@ reference "sec:Bibliography"
 \family sans
 Фильтр
 \family default
- в верхней части позволяет вам вводить ограничение на записи, которые появляются
- в структуре.
+ в верхней части позволяет вам вводить ограничение на элементы, которые
+ появляются в списке.
  Например, если вы отображаете список 
 \shape italic
 Метки и ссылки
 \shape default
  и хотите видеть только ссылки на подразделы, вы можете ввести в фильтр
- текст «под», и тогда будут отображаться только записи, содержащие этот
+ текст «под», и тогда будут отображаться только элементы, содержащие этот
  текст.
 \end_layout
 
 \begin_layout Standard
-В нижней части панели структуры находятся несколько элементов, которые позволяют
- дополнительно управлять отображением.
+В нижней части панели навигации находятся несколько элементов управления,
+ которые позволяют дополнительно настроить отображение.
  Опция 
 \family sans
 Сортировать
@@ -1867,7 +1856,7 @@ Shift-Tab
 \end_layout
 
 \begin_layout Standard
-Щелкнув правой кнопкой мыши по разделу на панели структуры, вы можете выбрать
+Щелкнув правой кнопкой мыши по разделу на панели навигации, вы можете выбрать
  весь раздел, чтобы скопировать, вырезать или удалить его.
 \end_layout
 
@@ -5902,7 +5891,7 @@ name "sec:Enumerate"
 \family sans
 Перечисление
 \family default
- используется для создания нумерованных списков и структур.
+ используется для создания нумерованных списков.
  Оно имеет свойства:
 \end_layout
 
@@ -8134,7 +8123,15 @@ Return
 \family sans
 Буквально
 \family default
- с той лишь разницей, что пробелы появляются в выводе в виде символа '␣'.
+ с той лишь разницей, что пробелы появляются в выводе в виде символа 
+\begin_inset Quotes rld
+\end_inset
+
+␣
+\begin_inset Quotes rrd
+\end_inset
+
+.
  Пример:
 \end_layout
 
@@ -8181,7 +8178,7 @@ name "sec:Nesting"
  свойствами.
  Это позволяет создавать блоки, которые наследуют некоторые свойства другого
  блока.
- Например, пусть имеются три основных пункта в некоторой структуре, а второй
+ Например, пусть имеются три основных пункта в некотором плане, а второй
  пункт также имеет два подпункта.
  Другими словами, имеется список внутри другого списка, «прикрепленный»
  ко второму элементу:
@@ -23573,7 +23570,8 @@ alpha
 \end_inset
 
 .
- Ввод команд иногда может быстрее привести к результату, чем с помощью 
+ Ввод команд иногда может быстрее привести к результату, чем использование
+ 
 \family sans
 Панели
 \begin_inset space ~
@@ -25176,23 +25174,31 @@ type  "icon"
 arg   "dialog-show mathdelimiter"
 \end_inset
 
-, а выражение справа — с помощью клавиш '
+, а выражение справа — с помощью клавиш 
+\begin_inset Quotes rld
+\end_inset
+
+
 \family typewriter
 (
 \family default
-'
-\family typewriter
- 
-\family default
-и
-\family typewriter
- 
-\family default
-'
+
+\begin_inset Quotes rrd
+\end_inset
+
+ и 
+\begin_inset Quotes rld
+\end_inset
+
+
 \family typewriter
 )
 \family default
-'.
+
+\begin_inset Quotes rrd
+\end_inset
+
+.
 \begin_inset Formula 
 \[
 \frac{1}{\left(1+\left(\frac{1}{1+\left(\frac{1}{1+x}\right)}\right)\right)}\qquad\qquad\frac{1}{(1+(\frac{1}{1+(\frac{1}{1+x})}))}
@@ -27269,17 +27275,7 @@ status collapsed
 status collapsed
 
 \begin_layout Plain Layout
-Навигация ! структура
-\end_layout
-
-\end_inset
-
-
-\begin_inset Index idx
-status collapsed
-
-\begin_layout Plain Layout
-Структура
+Навигация ! панель
 \end_layout
 
 \end_inset
@@ -27321,16 +27317,16 @@ name "subsec:Table-of-Contents"
  в виде серого поля.
  Если вы щелкнете по нему, появится панель 
 \family sans
-Структура
+Навигация
 \family default
-, в которой вы увидите записи содержания в виде схемы, что позволит вам
+, в которой вы увидите записи содержания в виде списка, что позволит вам
  перемещать и переупорядочивать разделы в ваших документах.
- Так что, это действие является альтернативой меню 
+ Это действие является альтернативой меню 
 \family sans
 Вид\SpecialChar menuseparator
-Панель структуры
+Панель навигации
 \family default
-, которая описана в подразделе
+, как описано в подразделе
 \begin_inset space ~
 \end_inset
 
@@ -28744,9 +28740,8 @@ literal "true"
 
 \begin_layout Standard
 \SpecialChar LyX
- поддерживает некоторые особые виды библиографий, такие как библиографии
- для разделов и множественные библиографии, что подробно объясняется в разделе
- 
+ поддерживает некоторые особые виды библиографий, такие как разделенные
+ и отдельные библиографии, что подробно объясняется в разделе 
 \shape italic
 Настройка библиографии с помощью Bib\SpecialChar TeX
  или Biblatex
@@ -36657,11 +36652,11 @@ status collapsed
 \end_layout
 
 \begin_layout Subsection
-Панель структуры
+Панель навигации
 \end_layout
 
 \begin_layout Standard
-Показывает панель структуры, как описано в разделах
+Показывает панель навигации, как описано в разделах
 \begin_inset space ~
 \end_inset
 
@@ -39997,10 +39992,10 @@ arg   "dialog-toggle toc"
 \begin_inset Text
 
 \begin_layout Plain Layout
-Переключить панель структуры, 
+Переключить панель навигации, 
 \family sans
 Вид\SpecialChar menuseparator
-Панель структуры
+Панель навигации
 \end_layout
 
 \end_inset
@@ -45417,9 +45412,33 @@ TEXINPUTS Переменная окружения TEXINPUTS позволяет 
  или в
  преамбуле документа.
  Этот префикс по умолчанию включает каталог документов (представленный одной
- точкой '.').
+ точкой 
+\begin_inset Quotes rld
+\end_inset
+
+.
+\begin_inset Quotes rrd
+\end_inset
+
+).
  Префикс может содержать любой список путей, разделенных разделителем по
- умолчанию для ОС (':' в UNIX-подобных системах и ';' в Windows).
+ умолчанию для ОС (
+\begin_inset Quotes rld
+\end_inset
+
+:
+\begin_inset Quotes rrd
+\end_inset
+
+ в UNIX-подобных системах и 
+\begin_inset Quotes rld
+\end_inset
+
+;
+\begin_inset Quotes rrd
+\end_inset
+
+ в Windows).
  
 \begin_inset Newline newline
 \end_inset
@@ -45429,8 +45448,16 @@ TEXINPUTS Переменная окружения TEXINPUTS позволяет 
  Обратите внимание, что любой неабсолютный путь, указанный в префиксе TEXINPUTS,
  считается относительным к каталогу вашего файла \SpecialChar LyX
 .
- Рекомендуется всегда включать '.' как один из путей; в противном случае
- компиляция может не сработать для некоторых документов.
+ Рекомендуется всегда включать 
+\begin_inset Quotes rld
+\end_inset
+
+.
+\begin_inset Quotes rrd
+\end_inset
+
+ как один из путей; в противном случае компиляция может не сработать для
+ некоторых документов.
 \end_layout
 
 \begin_layout Section
diff --git a/lib/examples/ru/Graphics_and_Insets/XY-Pic.lyx b/lib/examples/ru/Graphics_and_Insets/XY-Pic.lyx
index 083f698..ca8f379 100644
--- a/lib/examples/ru/Graphics_and_Insets/XY-Pic.lyx
+++ b/lib/examples/ru/Graphics_and_Insets/XY-Pic.lyx
@@ -1002,8 +1002,19 @@ $
 \end_inset
 
 .
- Использование символа '|' вместо '^' или '_' позволяет даже поместить метку
- прямо на стрелке (частично перекрывая ее).
+ Использование символа 
+\family typewriter
+|
+\family default
+ вместо 
+\family typewriter
+^
+\family default
+ или 
+\family typewriter
+_
+\family default
+ позволяет даже поместить метку прямо на стрелке (частично перекрывая ее).
 \end_layout
 
 \begin_layout Standard
@@ -1415,7 +1426,8 @@ $
 \family typewriter
 
 \backslash
-ar@{->>}
+ar@{->\SpecialChar ligaturebreak
+>}
 \end_layout
 
 \end_inset
@@ -1443,7 +1455,8 @@ $
 \family typewriter
 
 \backslash
-ar@{-->>}
+ar@{-->\SpecialChar ligaturebreak
+>}
 \end_layout
 
 \end_inset
@@ -1471,7 +1484,8 @@ $
 \family typewriter
 
 \backslash
-ar@{>->>}
+ar@{>->\SpecialChar ligaturebreak
+>}
 \end_layout
 
 \end_inset
@@ -1574,10 +1588,26 @@ ar@{|-|}
 \family typewriter
 @
 \family default
- один из символов: 2, 3, _ либо ^, можно создавать стрелки, соответственно
- с двойной, тройной линией, без верхней\SpecialChar breakableslash
-нижней части начала или конца стрелки;
- стрелки также не обязательно могут иметь наконечники.
+ один из символов: 
+\family typewriter
+2
+\family default
+, 
+\family typewriter
+3
+\family default
+, 
+\family typewriter
+_
+\family default
+ либо 
+\family typewriter
+^
+\family default
+, можно создавать стрелки, соответственно с двойной, тройной линией, без
+ верхней\SpecialChar breakableslash
+нижней части начала или конца стрелки; стрелки также не обязательно
+ могут иметь наконечники.
  Вот некоторые примеры подобных ситуаций:
 \end_layout
 
@@ -2730,7 +2760,7 @@ Alt+M C I
 Правка\SpecialChar menuseparator
 Строки и столбцы
 \family default
-, соотвующие им клавиатурные команды начинаются с 
+, соответствующие им клавиатурные команды начинаются с 
 \family sans
 Alt+M C
 \family default
@@ -2810,30 +2840,14 @@ r
 \end_inset
 
 ).
- Как обычно, в математическом редакторе символ подчеркивания 
-\begin_inset Quotes rld
-\end_inset
-
-
+ Как обычно, в математическом редакторе символ 
 \family typewriter
 _
 \family default
-
-\begin_inset Quotes rrd
-\end_inset
-
  открывает поле для нижнего индекса, а 
-\begin_inset Quotes rld
-\end_inset
-
-
 \family typewriter
 ^
 \family default
-
-\begin_inset Quotes rrd
-\end_inset
-
  — поле для верхнего индекса.
  В качестве метки можно ввести любой \SpecialChar LaTeX
 -код.
@@ -2960,7 +2974,7 @@ xypic
 \emph default
  — любой допустимый размер в \SpecialChar TeX
 , который должна быть введен как верхний или
- нижний индекс для первый косой черты 
+ нижний индекс для первой косой черты 
 \family typewriter
 /
 \family default
@@ -3144,11 +3158,19 @@ xymatrix at R=1pt
 xymatrix at R=1pt at C=1dd
 \family default
  — нет.
- Метод также не работает, если используется '
+ Метод также не работает, если используется 
+\begin_inset Quotes rld
+\end_inset
+
+
 \family typewriter
 !
 \family default
-' для получения фиксированной сетки с определенным размером, например, 
+
+\begin_inset Quotes rrd
+\end_inset
+
+ для получения фиксированной сетки с определенным размером, например, 
 \family typewriter
 
 \backslash
@@ -3475,15 +3497,15 @@ ar[ur]_(0.3)
 phi
 \family default
 , не приведут к желаемому результату.
- Вместо этого нужно заменить символы '
+ Вместо этого нужно заменить символы 
 \family typewriter
 ^
 \family default
-' и '
+ и 
 \family typewriter
 _
 \family default
-' макросами 
+ макросами 
 \family typewriter
 
 \backslash
@@ -3564,9 +3586,9 @@ phi_{4}}
 \begin_layout Standard
 Более общий трюк использует невидимые стрелки, чтобы разместить любой объект
  почти в любом месте диаграммы.
- Создайте невидимую стрелку (как описано в 4.4), укоротите (или продлите)
- ее до цели, добавив десятичный коэффициент сжатия (растяжения), например,
- 
+ Создайте невидимую стрелку (как описано в подразделе 4.4), укоротите (или
+ продлите) ее до цели, добавив десятичный коэффициент сжатия (растяжения),
+ например, 
 \family typewriter
 (0.6)
 \family default
@@ -3583,8 +3605,11 @@ phi_{4}}
 \begin_inset Formula $\varphi$
 \end_inset
 
- на (0.3) пути, могла бы быть получена путем добавления к обычной стрелке
- 
+ на 
+\family typewriter
+(0.3)
+\family default
+ пути, могла бы быть получена путем добавления к обычной стрелке 
 \family typewriter
 
 \backslash
diff --git a/po/ru.po b/po/ru.po
index 1d1cf97..e5c4977 100644
--- a/po/ru.po
+++ b/po/ru.po
@@ -12,7 +12,7 @@ msgstr ""
 "Project-Id-Version: LyX 2.4\n"
 "Report-Msgid-Bugs-To: lyx-devel at lists.lyx.org\n"
 "POT-Creation-Date: 2020-07-30 15:34+0200\n"
-"PO-Revision-Date: 2020-08-01 15:49+0300\n"
+"PO-Revision-Date: 2020-08-07 20:23+0300\n"
 "Last-Translator: Yuriy Skalko <yuriy.skalko at gmail.com>\n"
 "Language-Team: Russian <lyx-docs at lists.lyx.org>\n"
 "Language: ru\n"
@@ -142,7 +142,7 @@ msgstr "Стиль ссылок biblatex:"
 
 #: src/frontends/qt/ui/BiblioUi.ui:164
 msgid "The style that determines the layout of the citations"
-msgstr "Стиль, который определяет компоновку библиографических ссылок"
+msgstr "Стиль, задающий формат библиографических ссылок"
 
 #: src/frontends/qt/ui/BiblioUi.ui:180 src/frontends/qt/ui/BiblioUi.ui:241
 #: src/frontends/qt/ui/BiblioUi.ui:291
@@ -164,8 +164,7 @@ msgstr "Стиль биб&лиографии biblatex:"
 #: src/frontends/qt/ui/BiblioUi.ui:231
 msgid ""
 "The style that determines the layout of the biblatex-generated bibliography"
-msgstr ""
-"Стиль, который определяет компоновку библиографии, сгенерированной biblatex"
+msgstr "Стиль, задающий формат библиографии, сгенерированной biblatex"
 
 #: src/frontends/qt/ui/BiblioUi.ui:244 src/frontends/qt/ui/ColorUi.ui:73
 #: src/frontends/qt/ui/ColorUi.ui:134 src/frontends/qt/ui/ColorUi.ui:211
@@ -199,11 +198,11 @@ msgstr "С&бросить"
 
 #: src/frontends/qt/ui/BiblioUi.ui:305
 msgid "Select this if you want to split your bibliography into sections"
-msgstr "Выберите, если хотите разнести библиографию по разделам"
+msgstr "Выберите, если хотите разделить библиографию по разделам"
 
 #: src/frontends/qt/ui/BiblioUi.ui:308
 msgid "Subdivided bibli&ography"
-msgstr "Библиография по разделам"
+msgstr "Разделённая библиография"
 
 #: src/frontends/qt/ui/BiblioUi.ui:328
 msgid "Rescan style files"
@@ -215,11 +214,11 @@ msgstr "&Обновить"
 
 #: src/frontends/qt/ui/BiblioUi.ui:342
 msgid "&Multiple bibliographies:"
-msgstr "Несколько библиографий:"
+msgstr "Отдельные библиографии:"
 
 #: src/frontends/qt/ui/BiblioUi.ui:358
 msgid "Generate a bibliography per defined unit."
-msgstr "Генерировать отдельную библиографию для определённой рубрики"
+msgstr "Генерировать отдельную библиографию для заданного уровня"
 
 #: src/frontends/qt/ui/BiblioUi.ui:376
 msgid ""
@@ -928,7 +927,7 @@ msgstr "Размер шрифта"
 #: src/frontends/qt/ui/CharacterUi.ui:159
 #: src/frontends/qt/ui/CharacterUi.ui:178
 msgid "Font color"
-msgstr "Цвет шрифта"
+msgstr "Цвет текста"
 
 #: src/frontends/qt/ui/CharacterUi.ui:162
 msgid "&Color:"
@@ -1842,7 +1841,8 @@ msgstr "Масштаб (%):"
 
 #: src/frontends/qt/ui/FontUi.ui:247
 msgid "Scale the Sans Serif font to match the base font's dimensions"
-msgstr "Масштабировать шрифт без засечек до размеров основного шрифта"
+msgstr ""
+"Отмасштабируйте шрифт без засечек для соответствия размеру основного шрифта"
 
 #: src/frontends/qt/ui/FontUi.ui:267
 msgid "Use old st&yle figures"
@@ -1866,7 +1866,8 @@ msgstr "Масштаб (%):"
 
 #: src/frontends/qt/ui/FontUi.ui:355
 msgid "Scale the Typewriter font to match the base font's dimensions"
-msgstr "Масштабировать машинописный шрифт до размеров основного шрифта"
+msgstr ""
+"Отмасштабируйте машинописный шрифт для соответствия размеру основного шрифта"
 
 #: src/frontends/qt/ui/FontUi.ui:375
 msgid "Use old style &figures"
@@ -2734,7 +2735,7 @@ msgstr ""
 
 #: src/frontends/qt/ui/LocalLayoutUi.ui:20
 msgid "Document-specific layout information"
-msgstr "Информация о макете текущего документа"
+msgstr "Локальный макет текущего документа"
 
 #: src/frontends/qt/ui/LocalLayoutUi.ui:38
 msgid "&Validate"
@@ -7730,11 +7731,11 @@ msgstr "Дата"
 
 #: lib/layouts/aa.layout:239
 msgid "institutemark"
-msgstr "метка института"
+msgstr "пометка института"
 
 #: lib/layouts/aa.layout:243 lib/layouts/beamer.layout:1094
 msgid "Institute Mark"
-msgstr "Метка института"
+msgstr "Пометка института"
 
 #: lib/layouts/aa.layout:262
 msgid "Abstract (unstructured)"
@@ -7969,7 +7970,7 @@ msgstr "Заметка редактору:"
 #: lib/layouts/aastex.layout:474 lib/layouts/aastex6.layout:102
 #: lib/layouts/aastex62.layout:113
 msgid "TableRefs"
-msgstr "TableRefs"
+msgstr "Табличные ссылки"
 
 #: lib/layouts/aastex.layout:486
 msgid "References. ---"
@@ -7994,11 +7995,11 @@ msgstr "Табличная заметка:"
 
 #: lib/layouts/aastex.layout:529
 msgid "tablenotemark"
-msgstr "tablenotemark"
+msgstr "пометка табличной заметки"
 
 #: lib/layouts/aastex.layout:533
 msgid "tablenote mark"
-msgstr "пометка примечания к таблице"
+msgstr "пометка табличной заметки"
 
 #: lib/layouts/aastex.layout:551
 msgid "FigCaption"
@@ -8022,7 +8023,7 @@ msgstr "Учреждение:"
 
 #: lib/layouts/aastex.layout:599
 msgid "Objectname"
-msgstr "НазваниеОбъекта"
+msgstr "Имя объекта"
 
 #: lib/layouts/aastex.layout:611
 msgid "Obj:"
@@ -8034,7 +8035,7 @@ msgstr "Распознанное имя"
 
 #: lib/layouts/aastex.layout:614
 msgid "Separate the recognized name of an object from text"
-msgstr "Отделить название объекта от текста"
+msgstr "Отделить распознанное имя объекта от текста"
 
 #: lib/layouts/aastex.layout:629
 msgid "Dataset"
@@ -8119,15 +8120,15 @@ msgstr "Сотрудничество:"
 
 #: lib/layouts/aastex62.layout:193
 msgid "Nocollaboration"
-msgstr "Nocollaboration"
+msgstr "Без сотрудничества"
 
 #: lib/layouts/aastex62.layout:200
 msgid "No collaboration"
-msgstr "No collaboration"
+msgstr "Без сотрудничества"
 
 #: lib/layouts/aastex62.layout:231 lib/layouts/copernicus.layout:248
 msgid "Section Appendix"
-msgstr "Section Appendix"
+msgstr "Раздел приложения"
 
 #: lib/layouts/aastex62.layout:235
 msgid "\\Alph{appendix}."
@@ -8139,7 +8140,7 @@ msgstr "Подприложение"
 
 #: lib/layouts/aastex62.layout:247 lib/layouts/copernicus.layout:260
 msgid "Subsection Appendix"
-msgstr "Subsection Appendix"
+msgstr "Подраздел приложения"
 
 #: lib/layouts/aastex62.layout:251
 msgid "\\Alph{appendix}\\arabic{subappendix}."
@@ -8151,7 +8152,7 @@ msgstr "Подподприложение"
 
 #: lib/layouts/aastex62.layout:263 lib/layouts/copernicus.layout:272
 msgid "Subsubsection Appendix"
-msgstr "Subsubsection Appendix"
+msgstr "Подподраздел приложения"
 
 #: lib/layouts/aastex62.layout:267
 msgid "\\Alph{appendix}\\arabic{subappendix}.\\arabic{subsubappendix}."
@@ -9625,7 +9626,7 @@ msgstr "Мини-шаблон"
 
 #: lib/layouts/beamer.layout:144
 msgid "Mini template for this list (see beamer manual for details)"
-msgstr "Мини-шаблон для этого списка (подробности см. в руководстве beamer)"
+msgstr "Мини-шаблон для этого списка (подробности см. в руководстве по Beamer)"
 
 #: lib/layouts/beamer.layout:198
 msgid "Longest label|s"
@@ -9724,12 +9725,12 @@ msgstr "\\arabic{section}.\\arabic{subsection}.\\arabic{subsubsection}"
 
 #: lib/layouts/beamer.layout:477 lib/layouts/beamer.layout:483
 msgid "Frame"
-msgstr "Кадр"
+msgstr "Фрейм"
 
 #: lib/layouts/beamer.layout:478 lib/layouts/beamer.layout:563
 #: lib/layouts/beamer.layout:610 lib/layouts/beamer.layout:641
 msgid "Frames"
-msgstr "Кадры"
+msgstr "Фреймы"
 
 #: lib/layouts/beamer.layout:500 lib/layouts/beamer.layout:939
 #: lib/layouts/beamer.layout:1305 lib/layouts/beamer.layout:1459
@@ -9743,53 +9744,53 @@ msgstr "Действие"
 
 #: lib/layouts/beamer.layout:502 lib/layouts/beamer.layout:570
 msgid "Overlay specifications for this frame"
-msgstr "Спецификации наложения для этого кадра"
+msgstr "Определение оверлея для этого фрейма"
 
 #: lib/layouts/beamer.layout:508 lib/layouts/beamer.layout:576
 msgid "Default Overlay Specifications"
-msgstr "Спецификации наложения по умолчанию"
+msgstr "Определение оверлея по умолчанию"
 
 #: lib/layouts/beamer.layout:509 lib/layouts/beamer.layout:577
 msgid "Default overlay specifications within this frame"
-msgstr "Спецификации наложения по умолчанию внутри этого кадра"
+msgstr "Определение оверлея по умолчанию внутри этого фрейма"
 
 #: lib/layouts/beamer.layout:515 lib/layouts/beamer.layout:544
 #: lib/layouts/beamer.layout:555 lib/layouts/beamer.layout:583
 msgid "Frame Options"
-msgstr "Параметры кадра"
+msgstr "Параметры фрейма"
 
 #: lib/layouts/beamer.layout:517 lib/layouts/beamer.layout:546
 #: lib/layouts/beamer.layout:557 lib/layouts/beamer.layout:585
 msgid "Frame options (see beamer manual)"
-msgstr "Параметры кадра (см. руководство beamer)"
+msgstr "Параметры фрейма (см. руководство по Beamer)"
 
 #: lib/layouts/beamer.layout:520
 msgid "Frame Title"
-msgstr "Заголовок кадра"
+msgstr "Заголовок фрейма"
 
 #: lib/layouts/beamer.layout:521
 msgid "Enter the frame title here"
-msgstr "Введите здесь название кадра"
+msgstr "Введите здесь заголовок фрейма"
 
 #: lib/layouts/beamer.layout:540
 msgid "PlainFrame"
-msgstr "Простой кадр"
+msgstr "Простой фрейм"
 
 #: lib/layouts/beamer.layout:542
 msgid "Frame (plain)"
-msgstr "Кадр (простой)"
+msgstr "Фрейм (простой)"
 
 #: lib/layouts/beamer.layout:551
 msgid "FragileFrame"
-msgstr "Хрупкий кадр"
+msgstr "Хрупкий фрейм"
 
 #: lib/layouts/beamer.layout:553
 msgid "Frame (fragile)"
-msgstr "Кадр (хрупкий)"
+msgstr "Фрейм (хрупкий)"
 
 #: lib/layouts/beamer.layout:562
 msgid "AgainFrame"
-msgstr "Повторный кадр"
+msgstr "Повторный фрейм"
 
 #: lib/layouts/beamer.layout:568 lib/layouts/powerdot.layout:126
 #: lib/layouts/seminar.layout:111 lib/layouts/slides.layout:91
@@ -9799,11 +9800,11 @@ msgstr "Слайд"
 
 #: lib/layouts/beamer.layout:597
 msgid "Repeat frame with label"
-msgstr "Повтор кадра с меткой"
+msgstr "Повтор фрейма с меткой"
 
 #: lib/layouts/beamer.layout:609
 msgid "FrameTitle"
-msgstr "Заголовок кадра"
+msgstr "Заголовок фрейма"
 
 #: lib/layouts/beamer.layout:628 lib/layouts/beamer.layout:658
 #: lib/layouts/beamer.layout:878 lib/layouts/beamer.layout:907
@@ -9816,19 +9817,19 @@ msgstr "Заголовок кадра"
 #: lib/layouts/beamer.layout:1583 lib/layouts/beamer.layout:1604
 #: lib/layouts/beamer.layout:1625 lib/layouts/beamer.layout:1651
 msgid "Specify the overlay settings (see beamer manual)"
-msgstr "Укажите параметры наложения (см. руководство beamer)"
+msgstr "Укажите параметры оверлея (см. руководство по Beamer)"
 
 #: lib/layouts/beamer.layout:634
 msgid "Short Frame Title|S"
-msgstr "Краткое заглавие кадра"
+msgstr "Краткое заглавие фрейма"
 
 #: lib/layouts/beamer.layout:635
 msgid "A short form of the frame title used in some themes"
-msgstr "Короткая форма заголовка кадра, используемая в некоторых темах"
+msgstr "Короткая форма заголовка фрейма, используемая в некоторых темах"
 
 #: lib/layouts/beamer.layout:640
 msgid "FrameSubtitle"
-msgstr "Подзаголовок кадра"
+msgstr "Подзаголовок фрейма"
 
 #: lib/layouts/beamer.layout:670 lib/layouts/moderncv.layout:315
 #: lib/layouts/moderncv.layout:330
@@ -9843,23 +9844,23 @@ msgstr "Колонки"
 
 #: lib/layouts/beamer.layout:683
 msgid "Start column (increase depth!), width:"
-msgstr "Начало колонки (увеличьте глубину!), ширина:"
+msgstr "Начало колонки (увеличьте вложенность!), ширина:"
 
 #: lib/layouts/beamer.layout:686 lib/layouts/powerdot.layout:495
 msgid "Column Options"
-msgstr "Настройки колонки"
+msgstr "Параметры колонки"
 
 #: lib/layouts/beamer.layout:688
 msgid "Column options (see beamer manual)"
-msgstr "Параметры колонок (см. руководство beamer)"
+msgstr "Параметры колонки (см. руководство по Beamer)"
 
 #: lib/layouts/beamer.layout:711
 msgid "Column Placement Options"
-msgstr "Настройки размещения колонки"
+msgstr "Параметры размещения колонки"
 
 #: lib/layouts/beamer.layout:712
 msgid "Column placement options (t, T, c, b)"
-msgstr "Варианты размещения колонки (t ,T, c, b)"
+msgstr "Параметры размещения колонки (t ,T, c, b)"
 
 #: lib/layouts/beamer.layout:729
 msgid "ColumnsCenterAligned"
@@ -9885,7 +9886,7 @@ msgstr "Пауза"
 #: lib/layouts/beamer.layout:825 lib/layouts/beamer.layout:857
 #: lib/layouts/beamer.layout:886 lib/layouts/powerdot.layout:510
 msgid "Overlays"
-msgstr "Наложения"
+msgstr "Оверлеи"
 
 #: lib/layouts/beamer.layout:757 lib/layouts/powerdot.layout:516
 msgid "Pause number"
@@ -9901,7 +9902,7 @@ msgstr "_ _ _ _ _ _ _ _ _ _ _ _ _ _"
 
 #: lib/layouts/beamer.layout:778 lib/layouts/beamer.layout:817
 msgid "Overprint"
-msgstr "Наложение overprint"
+msgstr "Наложение"
 
 #: lib/layouts/beamer.layout:785
 msgid "Overprint Area Width"
@@ -9919,23 +9920,23 @@ msgstr "Ширина области наложения (по умолчанию:
 
 #: lib/layouts/beamer.layout:824
 msgid "OverlayArea"
-msgstr "Область наложения"
+msgstr "Область оверлея"
 
 #: lib/layouts/beamer.layout:834
 msgid "Overlayarea"
-msgstr "Областьналожения"
+msgstr "Область оверлея"
 
 #: lib/layouts/beamer.layout:844
 msgid "Overlay Area Width"
-msgstr "Ширина области наложения"
+msgstr "Ширина области оверлея"
 
 #: lib/layouts/beamer.layout:845
 msgid "The width of the overlay area"
-msgstr "Ширина области наложения"
+msgstr "Ширина области оверлея"
 
 #: lib/layouts/beamer.layout:849
 msgid "Overlay Area Height"
-msgstr "Высота области наложения"
+msgstr "Высота области оверлея"
 
 #: lib/layouts/beamer.layout:850 lib/layouts/graphicboxes.module:56
 #: lib/layouts/moderncv.layout:219 src/frontends/qt/GuiBox.cpp:74
@@ -9944,7 +9945,7 @@ msgstr "Высота"
 
 #: lib/layouts/beamer.layout:851
 msgid "The height of the overlay area"
-msgstr "Высота области наложения"
+msgstr "Высота области оверлея"
 
 #: lib/layouts/beamer.layout:856 lib/layouts/beamer.layout:1551
 #: lib/layouts/beamer.layout:1553 lib/layouts/powerdot.layout:651
@@ -9953,7 +9954,7 @@ msgstr "Раскрыть"
 
 #: lib/layouts/beamer.layout:866
 msgid "Uncovered on slides"
-msgstr "Раскрывается на слайдах"
+msgstr "Раскрыть на слайдах"
 
 #: lib/layouts/beamer.layout:885 lib/layouts/beamer.layout:1530
 #: lib/layouts/beamer.layout:1532 lib/layouts/powerdot.layout:657
@@ -9978,7 +9979,7 @@ msgstr "Блок:"
 
 #: lib/layouts/beamer.layout:940
 msgid "Action Specification|S"
-msgstr "Спецификация действия"
+msgstr "Определение действия"
 
 #: lib/layouts/beamer.layout:947
 msgid "Block Title"
@@ -10016,7 +10017,7 @@ msgstr "Краткое название, которое появляется в
 
 #: lib/layouts/beamer.layout:1011
 msgid "Title (Plain Frame)"
-msgstr "Название (простой кадр)"
+msgstr "Заглавие (простой фрейм)"
 
 #: lib/layouts/beamer.layout:1033
 msgid "Short Subtitle|S"
@@ -10044,7 +10045,7 @@ msgstr "Пометка института"
 
 #: lib/layouts/beamer.layout:1124
 msgid "Short Date|S"
-msgstr "Короткая дата"
+msgstr "Краткая дата"
 
 #: lib/layouts/beamer.layout:1125
 msgid "Short date which appears in the sidebar/header"
@@ -10082,7 +10083,7 @@ msgstr "Следствие."
 #: lib/layouts/beamer.layout:1603 lib/layouts/beamer.layout:1624
 #: lib/layouts/beamer.layout:1650
 msgid "Action Specifications|S"
-msgstr "Спецификации действия"
+msgstr "Описание действия"
 
 #: lib/layouts/beamer.layout:1324 lib/layouts/foils.layout:350
 #: lib/layouts/theorems-starred.inc:162
@@ -10170,7 +10171,7 @@ msgstr "Выделение"
 
 #: lib/layouts/beamer.layout:1472
 msgid "Emph."
-msgstr "Выделительный"
+msgstr "Выделение"
 
 #: lib/layouts/beamer.layout:1490 lib/layouts/beamer.layout:1492
 msgid "Alert"
@@ -10213,7 +10214,7 @@ msgstr "Параметры заметки"
 
 #: lib/layouts/beamer.layout:1658
 msgid "Specifiy note options (see beamer manual)"
-msgstr "Укажите параметры заметки (см. руководство по beamer)"
+msgstr "Укажите параметры заметки (см. руководство по Beamer)"
 
 #: lib/layouts/beamer.layout:1663
 msgid "ArticleMode"
@@ -10239,7 +10240,7 @@ msgstr "Рисунок"
 
 #: lib/layouts/beamerposter.layout:3 lib/examples/Articles:0
 msgid "Beamerposter"
-msgstr "Плакат beamer"
+msgstr "Плакат Beamer"
 
 #: lib/layouts/bicaption.module:2
 msgid "Bilingual Captions"
@@ -16473,11 +16474,11 @@ msgstr "Новый слайд:"
 
 #: lib/layouts/slides.layout:129
 msgid "Overlay"
-msgstr "Наложение"
+msgstr "Оверлей"
 
 #: lib/layouts/slides.layout:144
 msgid "New Overlay:"
-msgstr "Новое наложение:"
+msgstr "Новый оверлей:"
 
 #: lib/layouts/slides.layout:184
 msgid "New Note:"
@@ -20618,7 +20619,7 @@ msgstr "Maple, Evalf|v"
 
 #: lib/ui/stdmenus.inc:339
 msgid "Outline Pane|O"
-msgstr "Панель структуры|с"
+msgstr "Панель навигации|н"
 
 #: lib/ui/stdmenus.inc:340
 msgid "Code Preview Pane|P"
@@ -21286,7 +21287,7 @@ msgstr "Пользовательские вставки"
 
 #: lib/ui/stdtoolbars.inc:102
 msgid "Toggle outline"
-msgstr "Переключить панель структуры"
+msgstr "Переключить панель навигации"
 
 #: lib/ui/stdtoolbars.inc:103
 msgid "Toggle math toolbar"
@@ -33667,7 +33668,7 @@ msgstr "Нет тезауруса для этого языка!"
 
 #: src/frontends/qt/GuiToc.cpp:36
 msgid "Outline"
-msgstr "Структура"
+msgstr "Навигация"
 
 #: src/frontends/qt/GuiToolbar.cpp:397
 msgid "&Reset to default"
@@ -34448,7 +34449,7 @@ msgstr "(Пустое содержание)"
 
 #: src/frontends/qt/Menus.cpp:1389
 msgid "Open Outliner..."
-msgstr "Показать на панели структуры..."
+msgstr "Показать на панели навигации..."
 
 #: src/frontends/qt/Menus.cpp:1426
 msgid "Other Toolbars"

commit a436171b2cb783440e3dd4d675c89ef30851462d
Author: Stephan Witt <switt at lyx.org>
Date:   Fri Aug 7 22:53:19 2020 +0200

    #9376 prepare use of Length in lyxrc - amend commit 0fa4b7e736 - catch wrong include of Length.h

diff --git a/src/tests/check_Length.cpp b/src/tests/check_Length.cpp
index 3ee9f95..cfd449c 100644
--- a/src/tests/check_Length.cpp
+++ b/src/tests/check_Length.cpp
@@ -1,8 +1,8 @@
 #include <config.h>
 
-#include "../Length.h"
-#include "../LyXRC.h"
-#include "../support/debug.h"
+#include "LyXRC.h"
+#include "support/debug.h"
+#include "support/Length.h"
 
 #include <iostream>
 

commit d0ca7a383d569c03196bbab4b4c5fe32cd72fea2
Author: Stephan Witt <switt at lyx.org>
Date:   Fri Aug 7 12:27:27 2020 +0200

    Amend commit 3af8ff39fc - make it work with Qt 4.x - don't activate it there

diff --git a/src/frontends/qt/GuiView.cpp b/src/frontends/qt/GuiView.cpp
index a316fe5..1b9f0ef 100644
--- a/src/frontends/qt/GuiView.cpp
+++ b/src/frontends/qt/GuiView.cpp
@@ -4789,7 +4789,7 @@ void GuiView::resetDialogs()
 
 void GuiView::flatGroupBoxes(const QObject * widget, bool flag)
 {
-	for (const QObject * child: qAsConst(widget->children())) {
+	for (QObject * child: widget->children()) {
 		if (child->inherits("QGroupBox")) {
 			QGroupBox * box = (QGroupBox*) child;
 			box->setFlat(flag);
@@ -4815,9 +4815,11 @@ Dialog * GuiView::findOrBuild(string const & name, bool hide_it)
 
 	Dialog * dialog = build(name);
 	d.dialogs_[name].reset(dialog);
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
 	// Force a uniform style for group boxes
 	// On Mac non-flat works better, on Linux flat is standard
 	flatGroupBoxes(dialog->asQWidget(), guiApp->platformName() != "cocoa");
+#endif
 	if (lyxrc.allow_geometry_session)
 		dialog->restoreSession();
 	if (hide_it)

commit 3af8ff39fc07831539cc594531d1400f789328ff
Author: Stephan Witt <switt at lyx.org>
Date:   Fri Aug 7 10:54:12 2020 +0200

    Force a uniform style for group boxes, on Mac non-flat works better, on Linux flat is standard

diff --git a/src/frontends/qt/GuiView.cpp b/src/frontends/qt/GuiView.cpp
index 3160a1f..a316fe5 100644
--- a/src/frontends/qt/GuiView.cpp
+++ b/src/frontends/qt/GuiView.cpp
@@ -95,6 +95,7 @@
 #include <QDropEvent>
 #include <QFuture>
 #include <QFutureWatcher>
+#include <QGroupBox>
 #include <QLabel>
 #include <QList>
 #include <QMenu>
@@ -4786,6 +4787,19 @@ void GuiView::resetDialogs()
 }
 
 
+void GuiView::flatGroupBoxes(const QObject * widget, bool flag)
+{
+	for (const QObject * child: qAsConst(widget->children())) {
+		if (child->inherits("QGroupBox")) {
+			QGroupBox * box = (QGroupBox*) child;
+			box->setFlat(flag);
+		} else {
+			flatGroupBoxes(child, flag);
+		}
+	}
+}
+
+
 Dialog * GuiView::findOrBuild(string const & name, bool hide_it)
 {
 	if (!isValidName(name))
@@ -4801,6 +4815,9 @@ Dialog * GuiView::findOrBuild(string const & name, bool hide_it)
 
 	Dialog * dialog = build(name);
 	d.dialogs_[name].reset(dialog);
+	// Force a uniform style for group boxes
+	// On Mac non-flat works better, on Linux flat is standard
+	flatGroupBoxes(dialog->asQWidget(), guiApp->platformName() != "cocoa");
 	if (lyxrc.allow_geometry_session)
 		dialog->restoreSession();
 	if (hide_it)
diff --git a/src/frontends/qt/GuiView.h b/src/frontends/qt/GuiView.h
index ab60098..d611b39 100644
--- a/src/frontends/qt/GuiView.h
+++ b/src/frontends/qt/GuiView.h
@@ -236,6 +236,8 @@ private Q_SLOTS:
 	///
 	void resetWindowTitle();
 
+	void flatGroupBoxes(const QObject * object, bool flag);
+
 	///
 	void checkCancelBackground();
 	///

commit 0fa4b7e736a6cc9c22620dcebbab457c219f79c8
Author: Stephan Witt <switt at lyx.org>
Date:   Mon Aug 3 14:15:09 2020 +0200

    #9376 prepare use of Length in lyxrc - move the class Length to support

diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp
index f678e73..6e0d9f9 100644
--- a/src/BufferParams.cpp
+++ b/src/BufferParams.cpp
@@ -32,7 +32,6 @@
 #include "Language.h"
 #include "LaTeXFeatures.h"
 #include "LaTeXFonts.h"
-#include "Length.h"
 #include "ModuleList.h"
 #include "Font.h"
 #include "Lexer.h"
@@ -54,6 +53,7 @@
 #include "support/FileName.h"
 #include "support/filetools.h"
 #include "support/gettext.h"
+#include "support/Length.h"
 #include "support/Messages.h"
 #include "support/mutex.h"
 #include "support/Package.h"
diff --git a/src/BufferView.cpp b/src/BufferView.cpp
index fe02be5..e316aab 100644
--- a/src/BufferView.cpp
+++ b/src/BufferView.cpp
@@ -35,7 +35,6 @@
 #include "Language.h"
 #include "LaTeXFeatures.h"
 #include "LayoutFile.h"
-#include "Length.h"
 #include "Lexer.h"
 #include "LyX.h"
 #include "LyXAction.h"
@@ -81,6 +80,7 @@
 #include "support/filetools.h"
 #include "support/gettext.h"
 #include "support/lassert.h"
+#include "support/Length.h"
 #include "support/lstrings.h"
 #include "support/lyxlib.h"
 #include "support/Package.h"
diff --git a/src/LyXRC.h b/src/LyXRC.h
index ed7511a..955826b 100644
--- a/src/LyXRC.h
+++ b/src/LyXRC.h
@@ -18,9 +18,9 @@
 #ifndef LYXRC_H
 #define LYXRC_H
 
-#include "Length.h"
 #include "LyX.h"
 
+#include "support/Length.h"
 #include "support/strfwd.h"
 #include "support/userinfo.h"
 
diff --git a/src/Makefile.am b/src/Makefile.am
index 4a74c6e..be8e478 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -147,8 +147,6 @@ SOURCEFILESCORE = \
 	LaTeXPackages.cpp \
 	LayoutFile.cpp \
 	LayoutModuleList.cpp \
-	Length.cpp \
-	lengthcommon.cpp \
 	Lexer.cpp \
 	LyX.cpp \
 	LyXAction.cpp \
@@ -251,7 +249,6 @@ HEADERFILESCORE = \
 	LayoutEnums.h \
 	LayoutFile.h \
 	LayoutModuleList.h \
-	Length.h \
 	Lexer.h \
 	LyXAction.h \
 	lyxfind.h \
@@ -733,20 +730,15 @@ check_ExternalTransforms_SOURCES = \
 	tests/boost.cpp
 check_ExternalTransforms_LYX_OBJS = \
 	graphics/GraphicsParams.o \
-	insets/ExternalTransforms.o \
-	Length.o \
-	lengthcommon.o
+	insets/ExternalTransforms.o
 
 check_Length_CPPFLAGS = $(AM_CPPFLAGS)
-check_Length_LDADD = $(check_Length_LYX_OBJS) $(TESTS_LIBS)
+check_Length_LDADD = $(TESTS_LIBS)
 check_Length_LDFLAGS = $(QT_LDFLAGS) $(ADD_FRAMEWORKS)
 check_Length_SOURCES = \
 	tests/check_Length.cpp \
 	tests/dummy_functions.cpp \
 	tests/boost.cpp
-check_Length_LYX_OBJS = \
-	Length.o \
-	lengthcommon.o
 
 check_ListingsCaption_CPPFLAGS = $(AM_CPPFLAGS)
 check_ListingsCaption_LDADD = $(check_ListingsCaption_LYX_OBJS) $(TESTS_LIBS)
diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index 1c8f030..133ddd1 100644
--- a/src/Paragraph.cpp
+++ b/src/Paragraph.cpp
@@ -30,7 +30,6 @@
 #include "Language.h"
 #include "LaTeXFeatures.h"
 #include "Layout.h"
-#include "Length.h"
 #include "Font.h"
 #include "FontList.h"
 #include "LyXRC.h"
@@ -62,6 +61,7 @@
 #include "support/ExceptionMessage.h"
 #include "support/gettext.h"
 #include "support/lassert.h"
+#include "support/Length.h"
 #include "support/lstrings.h"
 #include "support/textutils.h"
 #include "output_docbook.h"
diff --git a/src/ParagraphParameters.h b/src/ParagraphParameters.h
index ccb131c..b4608e0 100644
--- a/src/ParagraphParameters.h
+++ b/src/ParagraphParameters.h
@@ -15,12 +15,12 @@
 #define PARAGRAPHPARAMETERS_H
 
 #include "LayoutEnums.h"
-#include "Length.h"
 #include "Spacing.h"
 
 #include "support/debug.h"
 #include "support/types.h"
 #include "support/docstring.h"
+#include "support/Length.h"
 
 
 namespace lyx {
diff --git a/src/Text.cpp b/src/Text.cpp
index 60705c0..e03c2cb 100644
--- a/src/Text.cpp
+++ b/src/Text.cpp
@@ -37,7 +37,6 @@
 #include "InsetList.h"
 #include "Language.h"
 #include "Layout.h"
-#include "Length.h"
 #include "Lexer.h"
 #include "lyxfind.h"
 #include "LyXRC.h"
@@ -65,6 +64,7 @@
 #include "support/docstream.h"
 #include "support/gettext.h"
 #include "support/lassert.h"
+#include "support/Length.h"
 #include "support/lstrings.h"
 #include "support/lyxalgo.h"
 #include "support/lyxtime.h"
diff --git a/src/VSpace.cpp b/src/VSpace.cpp
index a2d4a3d..d176850 100644
--- a/src/VSpace.cpp
+++ b/src/VSpace.cpp
@@ -16,11 +16,11 @@
 #include "BufferParams.h"
 #include "BufferView.h"
 #include "support/gettext.h"
-#include "Length.h"
 #include "Text.h"
 #include "TextMetrics.h" // for defaultRowHeight()
 
 #include "support/convert.h"
+#include "support/Length.h"
 #include "support/lstrings.h"
 
 #include "support/lassert.h"
diff --git a/src/VSpace.h b/src/VSpace.h
index 2bce154..7cd1a2b 100644
--- a/src/VSpace.h
+++ b/src/VSpace.h
@@ -12,7 +12,7 @@
 #ifndef VSPACE_H
 #define VSPACE_H
 
-#include "Length.h"
+#include "support/Length.h"
 
 
 namespace lyx {
diff --git a/src/frontends/qt/GuiBox.cpp b/src/frontends/qt/GuiBox.cpp
index 67a1b0c..5b504dd 100644
--- a/src/frontends/qt/GuiBox.cpp
+++ b/src/frontends/qt/GuiBox.cpp
@@ -19,13 +19,13 @@
 #include "ColorCache.h"
 #include "ColorSet.h"
 #include "LengthCombo.h"
-#include "Length.h"
 #include "qt_helpers.h"
 #include "Validator.h"
 
 #include "insets/InsetBox.h"
 
 #include "support/gettext.h"
+#include "support/Length.h"
 #include "support/lstrings.h"
 
 #include <QComboBox>
diff --git a/src/frontends/qt/GuiExternal.cpp b/src/frontends/qt/GuiExternal.cpp
index d850c2d..eb71aad 100644
--- a/src/frontends/qt/GuiExternal.cpp
+++ b/src/frontends/qt/GuiExternal.cpp
@@ -17,7 +17,6 @@
 #include "Buffer.h"
 #include "FuncRequest.h"
 #include "support/gettext.h"
-#include "Length.h"
 #include "LyXRC.h"
 
 #include "insets/ExternalSupport.h"
@@ -31,6 +30,7 @@
 
 #include "support/convert.h"
 #include "support/filetools.h"
+#include "support/Length.h"
 #include "support/lstrings.h"
 #include "support/lyxlib.h"
 #include "support/os.h"
diff --git a/src/frontends/qt/GuiGraphics.cpp b/src/frontends/qt/GuiGraphics.cpp
index e0a1b20..142f433 100644
--- a/src/frontends/qt/GuiGraphics.cpp
+++ b/src/frontends/qt/GuiGraphics.cpp
@@ -22,7 +22,6 @@
 #include "Buffer.h"
 #include "FuncRequest.h"
 #include "LengthCombo.h"
-#include "Length.h"
 #include "LyXRC.h"
 
 #include "graphics/epstools.h"
@@ -36,6 +35,7 @@
 #include "support/debug.h"
 #include "support/filetools.h"
 #include "support/gettext.h"
+#include "support/Length.h"
 #include "support/lstrings.h"
 #include "support/os.h"
 #include "support/Package.h"
diff --git a/src/frontends/qt/LengthCombo.h b/src/frontends/qt/LengthCombo.h
index 2545a96..eb1a387 100644
--- a/src/frontends/qt/LengthCombo.h
+++ b/src/frontends/qt/LengthCombo.h
@@ -14,7 +14,7 @@
 
 #include <QComboBox>
 
-#include "Length.h"
+#include "support/Length.h"
 
 
 namespace lyx {
diff --git a/src/frontends/qt/Validator.h b/src/frontends/qt/Validator.h
index bf77795..cce7cf5 100644
--- a/src/frontends/qt/Validator.h
+++ b/src/frontends/qt/Validator.h
@@ -25,9 +25,10 @@
 #ifndef VALIDATOR_H
 #define VALIDATOR_H
 
-#include "Length.h"
 #include "Dialog.h" // KernelDocType
 
+#include "support/Length.h"
+
 #include <QValidator>
 
 class QWidget;
diff --git a/src/frontends/qt/qt_helpers.cpp b/src/frontends/qt/qt_helpers.cpp
index 26c0df0..d3da0ee 100644
--- a/src/frontends/qt/qt_helpers.cpp
+++ b/src/frontends/qt/qt_helpers.cpp
@@ -22,12 +22,12 @@
 #include "BufferParams.h"
 #include "FloatList.h"
 #include "Language.h"
-#include "Length.h"
 #include "TextClass.h"
 
 #include "support/convert.h"
 #include "support/debug.h"
 #include "support/gettext.h"
+#include "support/Length.h"
 #include "support/lstrings.h"
 #include "support/lyxalgo.h"
 #include "support/os.h"
diff --git a/src/frontends/qt/qt_helpers.h b/src/frontends/qt/qt_helpers.h
index 754b6bf..92872e0 100644
--- a/src/frontends/qt/qt_helpers.h
+++ b/src/frontends/qt/qt_helpers.h
@@ -14,7 +14,7 @@
 #define QTHELPERS_H
 
 #include "ColorSet.h"
-#include "Length.h"
+#include "support/Length.h"
 #include "support/qstring_helpers.h"
 #include "support/filetools.h"
 #include "qt_i18n.h"
diff --git a/src/graphics/GraphicsParams.h b/src/graphics/GraphicsParams.h
index 052b006..e05bb67 100644
--- a/src/graphics/GraphicsParams.h
+++ b/src/graphics/GraphicsParams.h
@@ -14,9 +14,8 @@
 #ifndef GRAPHICSPARAMS_H
 #define GRAPHICSPARAMS_H
 
-#include "Length.h"
-
 #include "support/FileName.h"
+#include "support/Length.h"
 
 #include <string>
 #include <iosfwd>
diff --git a/src/insets/ExternalTransforms.h b/src/insets/ExternalTransforms.h
index d6735b6..6d0f9af 100644
--- a/src/insets/ExternalTransforms.h
+++ b/src/insets/ExternalTransforms.h
@@ -12,10 +12,9 @@
 #ifndef EXTERNALTRANSFORMS_H
 #define EXTERNALTRANSFORMS_H
 
-#include "Length.h"
-
 #include "graphics/GraphicsParams.h"
 
+#include "support/Length.h"
 #include "support/unique_ptr.h"
 
 #include <boost/any.hpp>
diff --git a/src/insets/InsetBox.h b/src/insets/InsetBox.h
index 418a242..3398a52 100644
--- a/src/insets/InsetBox.h
+++ b/src/insets/InsetBox.h
@@ -15,7 +15,8 @@
 #define INSETBOX_H
 
 #include "InsetCollapsible.h"
-#include "Length.h"
+
+#include "support/Length.h"
 
 
 namespace lyx {
diff --git a/src/insets/InsetGraphics.cpp b/src/insets/InsetGraphics.cpp
index 62efa84..99fcf3d 100644
--- a/src/insets/InsetGraphics.cpp
+++ b/src/insets/InsetGraphics.cpp
@@ -62,7 +62,6 @@ TODO
 #include "FuncStatus.h"
 #include "InsetIterator.h"
 #include "LaTeXFeatures.h"
-#include "Length.h"
 #include "Lexer.h"
 #include "MetricsInfo.h"
 #include "Mover.h"
@@ -86,6 +85,7 @@ TODO
 #include "support/ExceptionMessage.h"
 #include "support/filetools.h"
 #include "support/gettext.h"
+#include "support/Length.h"
 #include "support/lyxlib.h"
 #include "support/lstrings.h"
 #include "support/os.h"
diff --git a/src/insets/InsetInfo.cpp b/src/insets/InsetInfo.cpp
index 699d878..4edf0eb 100644
--- a/src/insets/InsetInfo.cpp
+++ b/src/insets/InsetInfo.cpp
@@ -25,7 +25,6 @@
 #include "LaTeXFeatures.h"
 #include "Language.h"
 #include "LayoutFile.h"
-#include "Length.h"
 #include "LyXAction.h"
 #include "LyXRC.h"
 #include "LyXVC.h"
@@ -45,6 +44,7 @@
 #include "support/FileName.h"
 #include "support/filetools.h"
 #include "support/gettext.h"
+#include "support/Length.h"
 #include "support/Messages.h"
 #include "support/lstrings.h"
 #include "support/qstring_helpers.h"
diff --git a/src/insets/InsetLine.cpp b/src/insets/InsetLine.cpp
index e6964aa..8d6a4ad 100644
--- a/src/insets/InsetLine.cpp
+++ b/src/insets/InsetLine.cpp
@@ -21,7 +21,6 @@
 #include "FuncRequest.h"
 #include "FuncStatus.h"
 #include "LaTeXFeatures.h"
-#include "Length.h"
 #include "MetricsInfo.h"
 #include "OutputParams.h"
 #include "output_docbook.h"
@@ -35,6 +34,7 @@
 #include "support/debug.h"
 #include "support/docstream.h"
 #include "support/gettext.h"
+#include "support/Length.h"
 #include "support/lstrings.h"
 
 #include <cstdlib>
diff --git a/src/insets/InsetListingsParams.cpp b/src/insets/InsetListingsParams.cpp
index 2e2f4c6..9c87a58 100644
--- a/src/insets/InsetListingsParams.cpp
+++ b/src/insets/InsetListingsParams.cpp
@@ -13,7 +13,7 @@
 
 #include "InsetListingsParams.h"
 
-#include "Length.h"
+#include "support/Length.h"
 #include "Lexer.h"
 
 #include "support/convert.h"
diff --git a/src/insets/InsetNomencl.cpp b/src/insets/InsetNomencl.cpp
index e7fc8a7..c762e33 100644
--- a/src/insets/InsetNomencl.cpp
+++ b/src/insets/InsetNomencl.cpp
@@ -26,7 +26,6 @@
 #include "InsetList.h"
 #include "Language.h"
 #include "LaTeXFeatures.h"
-#include "Length.h"
 #include "LyX.h"
 #include "OutputParams.h"
 #include "xml.h"
@@ -38,6 +37,7 @@
 #include "support/debug.h"
 #include "support/docstream.h"
 #include "support/gettext.h"
+#include "support/Length.h"
 #include "support/lstrings.h"
 
 using namespace std;
diff --git a/src/insets/InsetSpace.cpp b/src/insets/InsetSpace.cpp
index 04b515c..5a4f468 100644
--- a/src/insets/InsetSpace.cpp
+++ b/src/insets/InsetSpace.cpp
@@ -22,7 +22,6 @@
 #include "FuncStatus.h"
 #include "Language.h"
 #include "LaTeXFeatures.h"
-#include "Length.h"
 #include "Lexer.h"
 #include "MetricsInfo.h"
 #include "OutputParams.h"
@@ -33,6 +32,7 @@
 #include "support/docstream.h"
 #include "support/gettext.h"
 #include "support/lassert.h"
+#include "support/Length.h"
 #include "support/lstrings.h"
 
 #include "frontends/Application.h"
diff --git a/src/insets/InsetSpace.h b/src/insets/InsetSpace.h
index 1111aa1..0ebcec1 100644
--- a/src/insets/InsetSpace.h
+++ b/src/insets/InsetSpace.h
@@ -16,7 +16,8 @@
 #define INSET_SPACE_H
 
 #include "Inset.h"
-#include "Length.h"
+
+#include "support/Length.h"
 
 
 namespace lyx {
diff --git a/src/insets/InsetTabular.h b/src/insets/InsetTabular.h
index d917ab8..028da97 100644
--- a/src/insets/InsetTabular.h
+++ b/src/insets/InsetTabular.h
@@ -25,7 +25,8 @@
 #define INSET_TABULAR_H
 
 #include "InsetText.h"
-#include "Length.h"
+
+#include "support/Length.h"
 
 #include <climits>
 #include <iosfwd>
diff --git a/src/insets/InsetWrap.h b/src/insets/InsetWrap.h
index 934e3bd..5619dc0 100644
--- a/src/insets/InsetWrap.h
+++ b/src/insets/InsetWrap.h
@@ -13,7 +13,8 @@
 #define INSETWRAP_H
 
 #include "InsetCaptionable.h"
-#include "Length.h"
+
+#include "support/Length.h"
 
 
 namespace lyx {
diff --git a/src/mathed/InsetMathGrid.h b/src/mathed/InsetMathGrid.h
index 1c8efd1..fa7c2f2 100644
--- a/src/mathed/InsetMathGrid.h
+++ b/src/mathed/InsetMathGrid.h
@@ -13,7 +13,8 @@
 #define MATH_GRID_H
 
 #include "InsetMathNest.h"
-#include "Length.h"
+
+#include "support/Length.h"
 
 #include <map>
 
diff --git a/src/mathed/InsetMathKern.h b/src/mathed/InsetMathKern.h
index e985ad4..58d540d 100644
--- a/src/mathed/InsetMathKern.h
+++ b/src/mathed/InsetMathKern.h
@@ -13,7 +13,8 @@
 #define MATH_CHEATINSET_H
 
 #include "InsetMath.h"
-#include "Length.h"
+
+#include "support/Length.h"
 
 
 namespace lyx {
diff --git a/src/mathed/InsetMathSpace.h b/src/mathed/InsetMathSpace.h
index 4f16f16..32147db 100644
--- a/src/mathed/InsetMathSpace.h
+++ b/src/mathed/InsetMathSpace.h
@@ -13,7 +13,8 @@
 #define MATH_SPACEINSET_H
 
 #include "InsetMath.h"
-#include "Length.h"
+
+#include "support/Length.h"
 
 
 namespace lyx {
diff --git a/src/mathed/InsetMathXYMatrix.h b/src/mathed/InsetMathXYMatrix.h
index a5be7c0..68de028 100644
--- a/src/mathed/InsetMathXYMatrix.h
+++ b/src/mathed/InsetMathXYMatrix.h
@@ -12,9 +12,10 @@
 #ifndef MATH_XYMATRIX_H
 #define MATH_XYMATRIX_H
 
-#include "Length.h"
 #include "InsetMathGrid.h"
 
+#include "support/Length.h"
+
 
 namespace lyx {
 
diff --git a/src/mathed/MathSupport.cpp b/src/mathed/MathSupport.cpp
index 45ca429..ef93cb0 100644
--- a/src/mathed/MathSupport.cpp
+++ b/src/mathed/MathSupport.cpp
@@ -15,7 +15,6 @@
 
 #include "InsetMathFont.h"
 #include "InsetMathSymbol.h"
-#include "Length.h"
 #include "MathData.h"
 #include "MathFactory.h"
 #include "MathParser.h"
@@ -31,6 +30,7 @@
 #include "support/debug.h"
 #include "support/docstream.h"
 #include "support/lassert.h"
+#include "support/Length.h"
 #include "support/lyxlib.h"
 
 #include <map>
diff --git a/src/Length.cpp b/src/support/Length.cpp
similarity index 99%
rename from src/Length.cpp
rename to src/support/Length.cpp
index d286882..d23ea9b 100644
--- a/src/Length.cpp
+++ b/src/support/Length.cpp
@@ -15,11 +15,11 @@
 
 #include <config.h>
 
-#include "Length.h"
 #include "LyXRC.h"
 
 #include "support/debug.h"
 #include "support/docstream.h"
+#include "support/Length.h"
 #include "support/lstrings.h"
 #include "support/lyxlib.h"
 
diff --git a/src/Length.h b/src/support/Length.h
similarity index 100%
rename from src/Length.h
rename to src/support/Length.h
diff --git a/src/support/Makefile.am b/src/support/Makefile.am
index 3d92b62..8b7d211 100644
--- a/src/support/Makefile.am
+++ b/src/support/Makefile.am
@@ -71,6 +71,9 @@ liblyxsupport_a_SOURCES = \
 	kill.cpp \
 	lassert.h \
 	lassert.cpp \
+	Length.cpp \
+	Length.h \
+	lengthcommon.cpp \
 	limited_stack.h \
 	lstrings.cpp \
 	lstrings.h \
diff --git a/src/lengthcommon.cpp b/src/support/lengthcommon.cpp
similarity index 99%
rename from src/lengthcommon.cpp
rename to src/support/lengthcommon.cpp
index 4478d84..303dbcb 100644
--- a/src/lengthcommon.cpp
+++ b/src/support/lengthcommon.cpp
@@ -12,11 +12,10 @@
 
 #include <config.h>
 
-#include "Length.h"
-
 #include "support/convert.h"
 #include "support/gettext.h"
 #include "support/lassert.h"
+#include "support/Length.h"
 #include "support/lstrings.h"
 
 using namespace std;
diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt
index df83d04..957e4c0 100644
--- a/src/tests/CMakeLists.txt
+++ b/src/tests/CMakeLists.txt
@@ -66,7 +66,7 @@ endforeach()
 
 set(check_ExternalTransforms_SOURCES)
 foreach(_f graphics/GraphicsParams.cpp insets/ExternalTransforms.cpp
-	Length.cpp lengthcommon.cpp tests/check_ExternalTransforms.cpp
+	tests/check_ExternalTransforms.cpp
 	tests/boost.cpp tests/dummy_functions.cpp)
     list(APPEND check_ExternalTransforms_SOURCES ${TOP_SRC_DIR}/src/${_f})
 endforeach()
@@ -90,7 +90,7 @@ add_test(NAME "check_ExternalTransforms"
 add_dependencies(lyx_run_tests check_ExternalTransforms)
 
 set(check_Length_SOURCES)
-foreach(_f Length.cpp lengthcommon.cpp tests/check_Length.cpp tests/boost.cpp tests/dummy_functions.cpp)
+foreach(_f tests/check_Length.cpp tests/boost.cpp tests/dummy_functions.cpp)
   list(APPEND check_Length_SOURCES ${TOP_SRC_DIR}/src/${_f})
 endforeach()
 add_executable(check_Length ${check_Length_SOURCES})
diff --git a/src/tex2lyx/CMakeLists.txt b/src/tex2lyx/CMakeLists.txt
index cb129af..2a68e71 100644
--- a/src/tex2lyx/CMakeLists.txt
+++ b/src/tex2lyx/CMakeLists.txt
@@ -7,14 +7,13 @@
 
 project(${_tex2lyx})
 
-# There is no header file lengthcommon.h
-set(LINKED_sources ${TOP_SRC_DIR}/src/lengthcommon.cpp)
+set(LINKED_sources)
 set(LINKED_headers)
 
 foreach(_src graphics/GraphicsParams insets/ExternalTemplate
 	insets/ExternalTransforms insets/InsetLayout Author CiteEnginesList Color Counters
 	Encoding FloatList Floating FontInfo LaTeXPackages Layout
-	LayoutFile LayoutModuleList Length Lexer ModuleList TextClass
+	LayoutFile LayoutModuleList Lexer ModuleList TextClass
 	Spacing version)
 	list(APPEND LINKED_sources ${TOP_SRC_DIR}/src/${_src}.cpp)
 	list(APPEND LINKED_headers ${TOP_SRC_DIR}/src/${_src}.h)
diff --git a/src/tex2lyx/Makefile.am b/src/tex2lyx/Makefile.am
index 87bb335..05a3efc 100644
--- a/src/tex2lyx/Makefile.am
+++ b/src/tex2lyx/Makefile.am
@@ -102,8 +102,6 @@ LYX_OBJS = \
 	../Layout.o \
 	../LayoutFile.o \
 	../LayoutModuleList.o \
-	../Length.o \
-	../lengthcommon.o \
 	../Lexer.o \
 	../ModuleList.o \
 	../Spacing.o \
diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp
index fdcab63..6744d78 100644
--- a/src/tex2lyx/text.cpp
+++ b/src/tex2lyx/text.cpp
@@ -21,7 +21,6 @@
 #include "FloatList.h"
 #include "LaTeXPackages.h"
 #include "Layout.h"
-#include "Length.h"
 #include "Preamble.h"
 
 #include "insets/ExternalTemplate.h"
@@ -30,6 +29,7 @@
 #include "support/convert.h"
 #include "support/FileName.h"
 #include "support/filetools.h"
+#include "support/Length.h"
 #include "support/lstrings.h"
 #include "support/lyxtime.h"
 

commit 582296d79a143d918f30c14971c428d830f3752d
Author: Enrico Forestieri <forenr at lyx.org>
Date:   Thu Aug 6 15:34:54 2020 +0200

    Correctly compute metrics for single-char non-math fonts
    
    As evidenced by the comment, this corrects a thinko.

diff --git a/src/frontends/qt/GuiFontMetrics.cpp b/src/frontends/qt/GuiFontMetrics.cpp
index efd8463..9ff027e 100644
--- a/src/frontends/qt/GuiFontMetrics.cpp
+++ b/src/frontends/qt/GuiFontMetrics.cpp
@@ -241,7 +241,7 @@ int GuiFontMetrics::width(docstring const & s) const
 	int w = 0;
 	// is the string a single character from a math font ?
 #if QT_VERSION >= 0x040800
-	bool const math_char = s.length() == 1 || font_.styleName() == "LyX";
+	bool const math_char = s.length() == 1 && font_.styleName() == "LyX";
 #else
 	bool const math_char = s.length() == 1;
 #endif

commit 7bbc4270ad14bf1d30dd819290ec4719bfe6be9f
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Wed Aug 5 19:14:13 2020 +0200

    Add new Russian example files to Makefile

diff --git a/lib/Makefile.am b/lib/Makefile.am
index 010ef6f..da5c488 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -298,9 +298,15 @@ dist_roexamples_DATA = \
 ruexamplesdir = $(pkgdatadir)/examples/ru
 dist_ruexamples_DATA = \
 	examples/ru/Example_%28LyXified%29.lyx \
-	examples/ru/Example_%28raw%29.lyx
+	examples/ru/Example_%28raw%29.lyx \
 	examples/ru/Welcome.lyx
 
+ruinsetexamplesdir = $(pkgdatadir)/examples/ru/Graphics_and_Insets
+dist_ruinsetexamples_DATA = \
+	examples/ru/Graphics_and_Insets/XY-Figure.lyx \
+	examples/ru/Graphics_and_Insets/xyfigure.png \
+	examples/ru/Graphics_and_Insets/XY-Pic.lyx
+
 slexamplesdir = $(pkgdatadir)/examples/sl
 dist_slexamples_DATA = \
 	examples/sl/Example_%28LyXified%29.lyx \
@@ -2754,6 +2760,7 @@ exampleandtemplate_files = \
 			   $(dist_ptexamples_DATA) \
 			   $(dist_roexamples_DATA) \
 			   $(dist_ruexamples_DATA) \
+			   $(dist_ruinsetexamples_DATA) \
 			   $(dist_scriptexamples_DATA) \
 			   $(dist_scriptstemplates_DATA) \
 			   $(dist_slexamples_DATA) \

commit 067a39ee9736993aca253f29b003d10edba51b2e
Author: Yuriy Skalko <yuriy.skalko at gmail.com>
Date:   Wed Aug 5 16:08:27 2020 +0300

    Update Russian XY-Pic manual

diff --git a/lib/examples/ru/Graphics_and_Insets/XY-Figure.lyx b/lib/examples/ru/Graphics_and_Insets/XY-Figure.lyx
new file mode 100644
index 0000000..d091574
--- /dev/null
+++ b/lib/examples/ru/Graphics_and_Insets/XY-Figure.lyx
@@ -0,0 +1,147 @@
+#LyX 2.4 created this file. For more info see https://www.lyx.org/
+\lyxformat 598
+\begin_document
+\begin_header
+\save_transient_properties false
+\origin unavailable
+\textclass article
+\use_default_options true
+\maintain_unincluded_children no
+\language russian
+\language_package default
+\inputencoding utf8
+\fontencoding auto
+\font_roman "default" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
+\font_math "auto" "auto"
+\font_default_family default
+\use_non_tex_fonts false
+\font_sc false
+\font_roman_osf false
+\font_sans_osf false
+\font_typewriter_osf false
+\font_sf_scale 100 100
+\font_tt_scale 100 100
+\use_microtype true
+\use_dash_ligatures true
+\graphics default
+\default_output_format default
+\output_sync 0
+\bibtex_command default
+\index_command default
+\float_placement class
+\float_alignment center
+\paperfontsize default
+\spacing single
+\use_hyperref false
+\papersize a4
+\use_geometry false
+\use_package amsmath 1
+\use_package amssymb 1
+\use_package cancel 1
+\use_package esint 1
+\use_package mathdots 1
+\use_package mathtools 1
+\use_package mhchem 1
+\use_package stackrel 1
+\use_package stmaryrd 1
+\use_package undertilde 1
+\cite_engine basic
+\cite_engine_type default
+\biblio_style plain
+\use_bibtopic false
+\use_indices false
+\paperorientation portrait
+\suppress_date true
+\justification false
+\use_refstyle 1
+\use_minted 0
+\use_lineno 0
+\index Index
+\shortcut idx
+\color #008000
+\end_index
+\secnumdepth 3
+\tocdepth 3
+\paragraph_separation skip
+\defskip halfline
+\is_math_indent 0
+\math_numbering_side default
+\quotes_style russian
+\dynamic_quotes 0
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\tablestyle default
+\tracking_changes false
+\output_changes false
+\change_bars false
+\postpone_fragile_content true
+\html_math_output 0
+\html_css_as_file 0
+\html_be_strict false
+\docbook_table_output 0
+\end_header
+
+\begin_body
+
+\begin_layout Subsection*
+Редактирование диаграмм 
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+Xy
+\end_layout
+
+\end_inset
+
+-pic в \SpecialChar LyX
+
+\end_layout
+
+\begin_layout Standard
+Ниже слева вы видите диаграмму 
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+Xy
+\end_layout
+
+\end_inset
+
+-pic при редактировании, а справа — как она выглядит после того, как курсор
+ покинет область редактирования.
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula $\xymatrix{A\ar[d]\ar[r] & B\ar[d]\ar@{-->}[dl]\\
+C\ar@{_{(}->}[r] & D\ar@/{}_{1pc}/[u]
+}
+$
+\end_inset
+
+ 
+\begin_inset space \hfill{}
+\end_inset
+
+
+\begin_inset Formula $\xymatrix{\, & \, & \mbox{}A\ar[r]\ar[d] & B\ar[d]\ar@{-->}[dl]\\
+\, &  & C\ar@{_{(}->}[r] & D\ar@/_{1pc}/[u]
+}
+$
+\end_inset
+
+
+\end_layout
+
+\end_body
+\end_document
diff --git a/lib/examples/ru/Graphics_and_Insets/XY-Pic.lyx b/lib/examples/ru/Graphics_and_Insets/XY-Pic.lyx
index 18d32c1..083f698 100644
--- a/lib/examples/ru/Graphics_and_Insets/XY-Pic.lyx
+++ b/lib/examples/ru/Graphics_and_Insets/XY-Pic.lyx
@@ -158,13 +158,26 @@ Xy
 \begin_layout Author
 автор: H.
  Peter Gumm
+\begin_inset Foot
+status collapsed
+
+\begin_layout Plain Layout
+Перевод: Геннадий Чернышев, редактирование: Юрий Скалько.
+\end_layout
+
+\end_inset
+
+
 \end_layout
 
 \begin_layout Abstract
 В последних версиях \SpecialChar LyX
- стало удобно использовать установленный в системе \SpecialChar LaTeX
-
- стиль предварительного просмотра для пакета создания диаграмм 
+ при установленном пакете 
+\series bold
+preview
+\series default
+ в системе \SpecialChar LaTeX
+ стало удобно использовать пакет создания диаграмм 
 \begin_inset ERT
 status collapsed
 
@@ -178,7 +191,8 @@ Xy
 \end_inset
 
 -pic.
- Диаграммы стало возможно редактировать и отображать в главном окне \SpecialChar LyX
+ Появилась возможность редактировать и отображать диаграммы в главном окне
+ \SpecialChar LyX
 .
  Здесь мы покажем, как использовать команду 
 \family typewriter
@@ -190,7 +204,7 @@ xymatrix
 \series bold
 xypic
 \series default
- внутри \SpecialChar LyX
+ в \SpecialChar LyX
  для создания, редактирования и предварительного просмотра диаграмм,
  которые обычно используются в теории категорий, алгебре и смежных областях.
 \end_layout
@@ -213,7 +227,7 @@ LatexCommand tableofcontents
 \series bold
 xypic
 \series default
- долгое время служил в качестве удобного инструмента для построения графиков
+ долгое время служил в качестве удобного инструмента для построения графов
  и диаграмм в \SpecialChar LaTeX
 .
  К сожалению, его использование в \SpecialChar LyX
@@ -222,10 +236,13 @@ xypic
 , а это означает, что редактор \SpecialChar LyX
  мог отображать
  только исходный код \SpecialChar LaTeX
-, а не готовой диаграммы.
- Новый стиль предварительного просмотра \SpecialChar LaTeX
-, который является частью проекта
- AUC\SpecialChar TeX
+, а не готовую диаграмму.
+ Новый пакет 
+\series bold
+preview
+\series default
+ для \SpecialChar LaTeX
+, который является частью проекта AUC\SpecialChar TeX
  
 \begin_inset CommandInset citation
 LatexCommand cite
@@ -254,6 +271,7 @@ xypic
 \align center
 \begin_inset Graphics
 	filename xyfigure.png
+	lyxscale 75
 	width 75col%
 
 \end_inset
@@ -269,7 +287,7 @@ xypic
 \end_layout
 
 \begin_layout Standard
-В этом руководстве мы расскажем, как 
+В этом руководстве мы расскажем, как можно использовать 
 \begin_inset ERT
 status collapsed
 
@@ -282,9 +300,8 @@ Xy
 
 \end_inset
 
--pic может быть использован в \SpecialChar LyX
-, как могут создаваться и редактироваться
- диаграммы.
+-pic в \SpecialChar LyX
+, как можно создавать и редактировать диаграммы.
 \end_layout
 
 \begin_layout Standard
@@ -306,11 +323,11 @@ Xy
 , выделить его и преобразовать далее в графическое представление,
  нажав 
 \family sans
-Ctrl+m
+Ctrl+M
 \family default
  или 
 \family sans
-Ctrl+M
+Ctrl+Shift+M
 \family default
 .
  Если же вы используете 
@@ -326,8 +343,8 @@ Xy
 
 \end_inset
 
--pic регулярно, или если желаете изменить исходное изображение, вам нужно
- будет изменить каждое изображение с помощью редактора формул \SpecialChar LyX
+-pic регулярно, или если желаете изменить исходную диаграмму, вам нужно
+ будет менять ее с помощью редактора формул \SpecialChar LyX
 .
 \end_layout
 
@@ -341,7 +358,7 @@ Xy
 \begin_layout Standard
 Далее, в первых двух разделах объясняется, как использовать \SpecialChar LyX
  в первом упомянутом
- режиме, вводятся все 
+ режиме, вводятся все функции 
 \begin_inset ERT
 status collapsed
 
@@ -354,8 +371,8 @@ Xy
 
 \end_inset
 
--pic функции, которые могут быть использованы для построения коммутативных
- диаграмм, графиков или автоматных схем.
+-pic, которые могут быть использованы для построения коммутативных диаграмм,
+ графов или конечных автоматов.
  В разделе 
 \begin_inset CommandInset ref
 LatexCommand ref
@@ -380,7 +397,7 @@ Xy
 \end_layout
 
 \begin_layout Standard
-В наши намерения не входит написание введения в 
+В наши намерения не входит написание еще одного введения в 
 \begin_inset ERT
 status collapsed
 
@@ -393,10 +410,10 @@ Xy
 
 \end_inset
 
--pic, но мотивация заключается в предоставлении информации по использованию
- наиболее важных команд при работе внутри \SpecialChar LyX
-, так как использование клавиш,
- описанное в руководстве по 
+-pic.
+ Мы хотим показать, как наиболее важные команды пакета работают в \SpecialChar LyX
+, так
+ как использование клавиш, описанное в руководстве по 
 \begin_inset ERT
 status collapsed
 
@@ -440,21 +457,21 @@ preview
  в 
 \begin_inset CommandInset citation
 LatexCommand cite
-key "instant-preview"
+key "xypic"
 literal "true"
 
 \end_inset
 
-, соответственно в 
+ и 
 \begin_inset CommandInset citation
 LatexCommand cite
-key "xypic"
+key "instant-preview"
 literal "true"
 
 \end_inset
 
 .
- После их установки может понадобиться запустить 
+ После их установки может понадобиться выполнить 
 \family sans
 Инструменты\SpecialChar menuseparator
 Обновить конфигурацию
@@ -495,7 +512,7 @@ preview
 \family default
  значение 
 \shape italic
-Вкл
+Вкл.
 \end_layout
 
 \begin_layout Enumerate
@@ -565,8 +582,8 @@ Ctrl+M
 \end_layout
 
 \begin_layout Enumerate
-Переместите курсор вне области редактирования и подождите немного, чтобы
- увитеть появление стрелки: 
+Установите курсор вне области редактирования и подождите немного, чтобы
+ увидеть появление стрелки: 
 \begin_inset Formula $\xymatrix{A\ar[r] & B}
 $
 \end_inset
@@ -673,7 +690,7 @@ xymatrix{
 \family typewriter
 }
 \family default
- и превратите его в математический вид, как описано выше.
+ и превратите его в формулу, как описано выше.
  После покидания курсором математической области, вы должны увидеть диаграмму
  в ее полном графическом великолепии:
 \end_layout
@@ -700,9 +717,12 @@ $
 \backslash
 xymatrix
 \family default
- использует матрицу для определения структуры вершин диаграммы.
- Для примера, приведенного выше, необходима матрица элементов, 5 из которых
- используются для вершин 
+ использует матрицу, чтобы задать расположение вершин диаграммы.
+ Для примера, приведенного выше, необходима матрица 
+\begin_inset Formula $3\times3$
+\end_inset
+
+, в которой 5 элементов используются для вершин 
 \begin_inset Formula $U$
 \end_inset
 
@@ -913,8 +933,8 @@ $
 \end_layout
 
 \begin_layout Standard
-Метки прикрепляют к стрелкам, путем нанесения их в качестве верхнего или
- нижнего индексов 
+Метки прикрепляют к стрелкам, путем задания их в качестве верхнего или нижнего
+ индексов 
 \family typewriter
 
 \backslash
@@ -999,7 +1019,7 @@ $
 
  в середине стрелки, а не посередине между двумя объектами, которые она
  соединяет.
- Это достигается с помощью знака минус перед префиксом метки, то есть: 
+ Это достигается с помощью знака минус перед текстом метки, то есть: 
 \family typewriter
 
 \backslash
@@ -1078,8 +1098,8 @@ Xy
 
 \end_inset
 
--pic обычно позволяет смещать метки в сторону наконечника или к началу стрелки
- с помощью префикса метки с отношением, как, например, 
+-pic обычно позволяет смещать метки к концу или началу стрелки с помощью
+ префикса метки с отношением, как, например, 
 \family typewriter
 (.3)
 \family default
@@ -1139,8 +1159,8 @@ psi
 \end_layout
 
 \begin_layout Standard
-Модификация вида, формы или позиционирования стрелок производится с использовани
-ем символа 
+Изменение вида, формы или расположения стрелок производится с использованием
+ символа 
 \family typewriter
 @
 \family default
@@ -1167,29 +1187,57 @@ psi
 \end_layout
 
 \begin_layout Standard
-Различные шаблоны отрезка линии, такие как сплошной, пунктирный, штриховой
- или двойной, применимы для изображения стрелки.
- Их можно комбинировать с различными видами начала и наконечников стрелок.
- В целом, дизайн для стрелок описывается командой 
+Для линии стрелки применимы различные шаблоны, такие как 
+\emph on
+сплошной
+\emph default
+, 
+\emph on
+пунктирный
+\emph default
+, 
+\emph on
+штриховой
+\emph default
+ или 
+\emph on
+двойной
+\emph default
+.
+ Их можно комбинировать с различными видами начала и конца стрелок.
+ В целом, внешний вид стрелок описывается командой 
+\family typewriter
+
 \backslash
-ar, за которой следуют знак 
+ar
+\family default
+, за которой следуют знак 
 \family typewriter
 @
 \family default
- и фигурные скобки {\SpecialChar ldots
-}, содержащие символы, описывающие типы начала, оси
- и наконечника стрелки.
- Эти символы должны быть выбраны так, чтобы придать той или иной форме ASCII-пре
-доставления близость к реальному изображению.
+ и фигурные скобки 
+\family typewriter
+{
+\family default
+\SpecialChar ldots
+
+\family typewriter
+}
+\family default
+, содержащие символы, описывающие вид начала, линии и конца стрелки.
+ Эти символы были выбраны так, чтобы придать текстовому представлению сходство
+ с реальным изображением.
  Например, 
 \family typewriter
 
 \backslash
-ar@{>..>>}
+ar@{>..>\SpecialChar ligaturebreak
+>}
 \family default
- кодирует стрелку с разветвленным началом, осью из точек и двойным наконечником.
- Ряд других образцов для стрелок приведен в таблице ниже.
- Обратите внимание, что начало стрелок, указывающих вложения, например,
+ кодирует стрелку с разветвленным началом, пунктирной линией и двойным наконечни
+ком.
+ Ряд других вариантов для стрелок приведен в таблице ниже.
+ Обратите внимание, что начала стрелок, указывающих вложения, например,
  
 \begin_inset Formula $\xymatrix{A\ar@{^{(}->}[r] & B}
 $
@@ -1526,10 +1574,10 @@ ar@{|-|}
 \family typewriter
 @
 \family default
- один из символов: 2, 3, _ либо ^, можно создавать стрелки, соответственно,
- с удвоенной, утроенной осью, без верхней части начала стрелки или наконечника
- стрелки без нижней такой части; стрелки также не обязательно могут иметь
- наконечники.
+ один из символов: 2, 3, _ либо ^, можно создавать стрелки, соответственно
+ с двойной, тройной линией, без верхней\SpecialChar breakableslash
+нижней части начала или конца стрелки;
+ стрелки также не обязательно могут иметь наконечники.
  Вот некоторые примеры подобных ситуаций:
 \end_layout
 
@@ -1902,30 +1950,20 @@ $
 , как приведено выше, выделите его и выполните,
  либо 
 \family sans
-Ctrl+m —
+Ctrl+M —
 \family default
  для обычной формулы, либо 
 \family sans
-Ctrl+M —
+Ctrl+Shift+M —
 \family default
  для выделенной формулы.
  Диаграммы, созданные для размещения внутри строки, в дальнейшем могут быть
  расположены отдельно по центру, или, наоборот, центрированные диаграммы
  могут быть переведены во внутритекстовый формат, используя 
 \family sans
-Вставка\SpecialChar menuseparator
+Правка\SpecialChar menuseparator
 Математика\SpecialChar menuseparator
-Выделенная формула
-\family default
- или 
-\family sans
-Вставка\SpecialChar menuseparator
-Математика
-\family default
- 
-\family sans
-\SpecialChar menuseparator
-Формула
+Изменить вид формулы
 \family default
 .
 \end_layout
@@ -1948,11 +1986,19 @@ Ctrl+M —
 \end_layout
 
 \begin_layout Standard
-Для задания изгиба стрелок используется модификатор @/
+Для задания изгиба стрелок используется модификатор 
+\family typewriter
+@/
+\family default
+
 \begin_inset Formula $\ldots$
 \end_inset
 
-/.
+
+\family typewriter
+/
+\family default
+.
  Многоточие означает величину изгиба, которая должна быть введена в нижний
  или верхний индекс.
  В качестве примера ниже приведен код для получения двух противоположных
@@ -1999,11 +2045,44 @@ ar@/_{.5pc}/[l]}
 \end_layout
 
 \begin_layout Standard
-Альтернативой для указания изгиба стрелок является указание их "азимутальных
- углов", под которыми они покидают вершины-источники, и их направления к
- вершинам-целям.
- Но, вместо использования терминов "север", "северо-восток", "восток" и
- т.д., направления названы 
+Альтернативой для указания изгиба стрелок является указание их 
+\begin_inset Quotes rld
+\end_inset
+
+азимутальных углов
+\begin_inset Quotes rrd
+\end_inset
+
+, под которыми они покидают вершины-источники, и их направления к вершинам-целям.
+ Но, вместо использования терминов 
+\begin_inset Quotes rld
+\end_inset
+
+север
+\begin_inset Quotes rrd
+\end_inset
+
+, 
+\begin_inset Quotes rld
+\end_inset
+
+северо-восток
+\begin_inset Quotes rrd
+\end_inset
+
+, 
+\begin_inset Quotes rld
+\end_inset
+
+восток
+\begin_inset Quotes rrd
+\end_inset
+
+ и т.
+\begin_inset space \thinspace{}
+\end_inset
+
+д., направления названы 
 \family typewriter
 u
 \family default
@@ -2036,24 +2115,34 @@ l
 ul
 \family default
 , обозначающие, соответственно, вверх, вверх-вправо, вправо, вниз-вправо,
- и т.д.
- Направление задается как @(
+ и т.
+\begin_inset space \thinspace{}
+\end_inset
+
+д.
+ Направление задается как 
+\family typewriter
+@(
+\family default
 \emph on
 out
 \emph default
 ,
 \emph on
 in
+\family typewriter
 \emph default
-), где 
+)
+\family default
+, где 
 \emph on
 out
 \emph default
- задает направление от первого объекта слева, а 
+ задает направление выхода из первого объекта, а 
 \emph on
 in
 \emph default
- обозначает направление, откуда происходит вход в целевой объект.
+ обозначает направление входа в целевой объект.
  В качестве примера, показаны некоторые изгибы стрелок и отдельная замыкающаяся
  стрелка, которая получается, когда для стрелки не указывается цель, а только
  ее входящее и исходящее направления:
@@ -2103,7 +2192,7 @@ ar@(ul,ur)}
 \end_layout
 
 \begin_layout Standard
-Приведенный выше пример напоминает автоматную диаграмму, за исключением
+Приведенный выше пример напоминает диаграмму конечного автомата, за исключением
  того, что в такой диаграмме состояния будут заключаться в небольшие окружности,
  а двойными окружностями будут обозначаться конечные состояния.
 \end_layout
@@ -2238,8 +2327,8 @@ entrymodifiers={
 \family typewriter
 }
 \family default
- делает определенный стиль оформления элемента принимаемым по умолчанию,
- что, конечно, может быть отменено для отдельных элементов.
+ задает определенный стиль оформления элемента стилем по умолчанию, что,
+ конечно, может быть отменено для отдельных элементов.
  Таким образом, после 
 \family typewriter
 
@@ -2305,8 +2394,8 @@ restore
 \noun default
 \color inherit
  значений, обозначающих верхний левый и нижний правый углы прямоугольника.
- Каждая точка, в свою очередь, определяется двумя значениями в кавычках,
- разделенных запятой, "
+ Каждая точка, в свою очередь, определяется двумя значениями, разделенными
+ запятой и в кавычках "
 \family roman
 \series medium
 \shape up
@@ -2373,7 +2462,7 @@ restore
 \noun default
 \color inherit
 .
- За ними следуют команды обрамления для создания фигур, наподобие следующей:
+ За ними следуют команды обрамления для создания диаграмм, наподобие следующей:
 \family roman
 \series medium
 \shape up
@@ -2467,7 +2556,7 @@ xymatrix
 \end_layout
 
 \begin_layout Section
-Использование математического редактора