diff --git a/autotests/export/docbook/LFUNs.lyx b/autotests/export/docbook/LFUNs.lyx new file mode 100644 index 0000000000..2cf3f5f917 --- /dev/null +++ b/autotests/export/docbook/LFUNs.lyx @@ -0,0 +1,129 @@ +#LyX 2.4 created this file. For more info see https://www.lyx.org/ +\lyxformat 599 +\begin_document +\begin_header +\save_transient_properties true +\origin unavailable +\textclass article +\begin_preamble +\renewcommand{\descriptionlabel}[1]{\hspace\labelsep\upshape\bfseries #1:} +\renewenvironment{description}{\list{}{% + \setlength{\itemsep}{-2pt} + \advance\leftmargini6\p@ \itemindent-12\p@ + \labelwidth\z@ \let\makelabel\descriptionlabel}% +}{ + \endlist +} +\end_preamble +\use_default_options false +\maintain_unincluded_children no +\begin_local_layout +Style Description +LabelIndent MM +LeftMargin MMMMMxx +End +\end_local_layout +\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 true +\use_package amsmath 1 +\use_package amssymb 1 +\use_package cancel 0 +\use_package esint 1 +\use_package mathdots 0 +\use_package mathtools 0 +\use_package mhchem 1 +\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 +\use_minted 0 +\use_lineno 0 +\index Index +\shortcut idx +\color #008000 +\end_index +\leftmargin 2.5cm +\topmargin 2cm +\rightmargin 3cm +\bottommargin 2.5cm +\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 +\SpecialChar LyX + Functions +\end_layout + +\begin_layout Section* +About this manual +\end_layout + +\begin_layout Standard +This manual documents +\end_layout + +\begin_layout Section +Layout Functions +\end_layout + +\begin_layout Standard +LFUNs are also +\end_layout + +\end_body +\end_document diff --git a/autotests/export/docbook/LFUNs.xml b/autotests/export/docbook/LFUNs.xml new file mode 100644 index 0000000000..18abd58575 --- /dev/null +++ b/autotests/export/docbook/LFUNs.xml @@ -0,0 +1,12 @@ + + +
+LyX Functions +About this manual +This manual documents +
+Layout Functions +LFUNs are also +
+
\ No newline at end of file diff --git a/autotests/export/docbook/svmult.xml b/autotests/export/docbook/svmult.xml new file mode 100644 index 0000000000..0a21ad7f72 --- /dev/null +++ b/autotests/export/docbook/svmult.xml @@ -0,0 +1,582 @@ + + + +Untitled Document + +A quotation or a dedicationdedication at the very beginning of your book. + + + +The foreword covers introductory remarks preceding the text of a book that are written by a person other than the author or editor of the book. If applicable, the foreword precedes the preface which is written by the author or editor of the book. + + +Place, month year +Firstname Surname + + + +A prefacepreface is a book's preliminary statement, usually written by the author or editor of a work, which states its origin, scope, purpose, plan, and intended audience, and which sometimes includes afterthoughts and acknowledgments of assistance. +When written by a person other than the author, it is called a foreword. The preface or foreword is distinct from the introduction, which deals with the subject of the work. +Customarily acknowledgments are included as last part of the preface. + + +Place(s), +Firstname Surname +month year +Firstname Surname +Acknowledgements +Optional section; if you prefer to set your acknowledgement section as a separate chapter instead of including it as last part of your preface. + + + +Firstname Surname + ABC Institute, 123 Prime Street, Daisy Town, NA 01234, USA, smith@smith.edu + Firstname Surname + XYZ Institute, Technical University, Albert-Schweitzer-Str. 34, 1000 Berlin, Germany, meier@tu.edu +Acronyms +List(s) of abbreviations or symbols +Lists of abbreviationsacronyms, list of, symbolssymbols, list of and the like are easily formatted with the help of the Springer-enhanced description environment. + + +CABR +ABC + +Spelled-out abbreviation and definition + + + +BABI + +Spelled-out abbreviation and definition + + + +CABR + +Spelled-out abbreviation and definition + + + + + +Part Title + Part title page and, if desired, a short introductory text (maximum one page) on its verso page +Contribution Title +Short form of title + +Name of First Author and Name of Second Author +Short form of author list + +Name of First Author +Name, Address of Institute, name@email.address +Name of Second Author +Name, Address of Institute name@email.address + + +Each chapter should be preceded by an abstract (10–15 lines long) that summarizes the content. The abstract will appear online at www.SpringerLink.com and be available with unrestricted access. This allows unregistered users to read the abstract as a teaser for the complete chapter. As a general rule the abstracts will not appear in the printed version of your book unless it is the style of your particular book or that of the series to which your book belongs. + Please use the 'starred' version of the abstract environment for typesetting the text of the online abstracts. Use the plain abstract if the abstract is also to appear in the printed version of the book. + + +Each chapter should be preceded by an abstract (10–15 lines long) that summarizes the content. The abstract will appear online at www.SpringerLink.com and be available with unrestricted access. This allows unregistered users to read the abstract as a teaser for the complete chapter. As a general rule the abstracts will not appear in the printed version of your book unless it is the style of your particular book or that of the series to which your book belongs. + Please use the 'starred' version of the abstract environment for typesetting the text of the online abstracts. Use the plain abstract if the abstract is also to appear in the printed version of the book. + +
+Section Heading +Instead of simply listing headings of different levels we recommend to let every heading be followed by at least a short passage of text. +
+
+Section Heading +Short form of section title +Use the standard equation environment to typeset your equations, e. g. + +a\times b=c\;, + + + + a×b=c, + + + + + however, for multiline equations we recommend to use the eqnarray environment +In physics texts please activate the class option vecphys to depict your vectors in boldface-italic type - as is customary for a wide range of physical subjects +. + +a\times b & = & c\nonumber \\ +\vec{a}\cdot\vec{b} & = & c\label{eq:01} + + + + + + + a×b + + + = + + c + + + + + + + a + + + + b + + + + + = + + c + + + + + + +
+Subsection Heading +Instead of simply listing headings of different levels we recommend to let every heading be followed by at least a short passage of text. Further on please use the LyX automatism for all your cross-referencescross-references and citationscitations as has already been described in Sect. . +
+Please do not use quotation marks when quoting texts! Simply use the quotation environment – it will automatically render Springer's preferred layout. +
+
+Subsubsection Heading +Instead of simply listing headings of different levels we recommend to let every heading be followed by at least a short passage of text. Further on please use the LyX automatism for all your cross-references and citations as has already been described in Sect. , see also Fig.  +If you copy text passages, figures, or tables from other works, you must obtain permission from the copyright holder (usually the original publisher). Please enclose the signed permission with the manuscript. The sourcespermission to print must be acknowledged either in the captions, as footnotes or in a separate section of the book. + +Please note that the first line of text that follows a heading is not indented, whereas the first lines of all subsequent paragraphs are. + +If the width of the figure is less than 7.8 cm use the sidecapion command to flush the caption on the left side of the page. If the figure is positioned at the top of the page, align the sidecaption with the top of the figure – to achieve this you simply need to use the optional argument [t] with the sidecaption command +Error: no float found in the box. To use subfigures in DocBook, elements must be wrapped in a float inset and have a title/caption. + +replace this box by an image + + +
+Paragraph Heading +Instead of simply listing headings of different levels we recommend to let every heading be followed by at least a short passage of text. +For typesetting numbered lists we recommend to use the enumerate environment – it will automatically render Springer's preferred layout. + + +Livelihood and survival mobility are oftentimes coutcomes of uneven socioeconomic development. + + +Livelihood and survival mobility are oftentimes coutcomes of uneven socioeconomic development. + + +Livelihood and survival mobility are oftentimes coutcomes of uneven socioeconomic development. + + + + +Livelihood and survival mobility are oftentimes coutcomes of uneven socioeconomic development. + + +
+
+Subparagraph Heading +In order to avoid simply listing headings of different levels we recommend to let every heading be followed by at least a short passage of text. Use the LyX automatism for all your cross-references and citations as has already been described in Sect. , see also Fig. . +For unnumbered list we recommend to use the itemize environment – it will automatically render Springer's preferred layout. + + +Livelihood and survival mobility are oftentimes coutcomes of uneven socioeconomic development, cf. Table . + + +Livelihood and survival mobility are oftentimes coutcomes of uneven socioeconomic development. + + +Livelihood and survival mobility are oftentimes coutcomes of uneven socioeconomic development. + + + + +Livelihood and survival mobility are oftentimes coutcomes of uneven socioeconomic development. + + + + Please write your figure caption here +Error: no float found in the box. To use subfigures in DocBook, elements must be wrapped in a float inset and have a title/caption. + +replace this box by an image + + + + +Run-in Heading Boldface Version + +Use the LyX automatism for all your cross-references and citations as has already been described in Sect. . + +Run-in Heading Italic Version + +Use the LyX automatism for all your cross-refer­ences and citations as has already been described in Sect. paragraph. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +^{a} + + + + + a + + + + + Table foot note (with superscript)
Please write your table caption here
Classes Subclass Length Action Mechanism
+ Translation mRNA +^{a} + + + + + a + + + + + 22 (19–25) Translation repression, mRNA cleavage
Translation mRNA cleavage 21 mRNA cleavage
Translation mRNA 21–22 mRNA cleavage
Translation mRNA 24–26 Histone and DNA Modification
+
+
+
+
+
+
+Section Heading +Instead of simply listing headings of different levels we recommend to let every heading be followed by at least a short passage of text. +Please note that the first line of text that follows a heading is not indented, whereas the first lines of all subsequent paragraphs are. +If you want to list definitions or the like we recommend to use the Springer-enhanced description environment – it will automatically render Springer's preferred layout. + + +Type 1 +Type 1 + +That addresses central themes pertainng to migration, health, and disease. In Sect. , Wilson discusses the role of human migration in infectious disease distributions and patterns. + + + +Type 2 + +That addresses central themes pertainng to migration, health, and disease. In Sect. , Wilson discusses the role of human migration in infectious disease distributions and patterns. + + + +
+Subsection Heading +In order to avoid simply listing headings of different levels we recommend to let every heading be followed by at least a short passage of text. +Please note that the first line of text that follows a heading is not indented, whereas the first lines of all subsequent paragraphs are. + +If you want to emphasize complete paragraphs of texts we recommend to use the newly defined Springer class option graybox and the newly defined environment svgraybox. This will produce a 15 percent screened box 'behind' your text. + + +If you want to emphasize complete paragraphs of texts we recommend to use the newly defined Springer class option graybox and the newly defined environment svgraybox. This will produce a 15 percent screened box 'behind' your text. + +
+Subsubsection Heading +Instead of simply listing headings of different levels we recommend to let every heading be followed by at least a short passage of text. +Please note that the first line of text that follows a heading is not indented, whereas the first lines of all subsequent paragraphs are. +Name/Title (optional) +Theorem text goes here. +Definition text goes here. + +Proof text goes here. + + +“qed layout” Proof text goes here. + +
+Paragraph Heading +Instead of simply listing headings of different levels we recommend to let every heading be followed by at least a short passage of text. +Note that the first line of text that follows a heading is not indented, whereas the first lines of all subsequent paragraphs are. +Theorem text goes here. +Definition text goes here. + +“smartqed layout” Proof text goes here. + + +If you want to include acknowledgments of assistance and the like at the end of an individual chapter please use the acknowledgement environment – it will automatically render Springer's preferred layout. + +Appendix + +Appendix + When placed at the end of a chapter or contribution (as opposed to at the end of the book), the numbering of tables, figures, and equations in the appendix section continues on from that in the main text. Hence please do not use the appendix command when writing an appendix at the end of your chapter or contribution. If there is only one the appendix is designated “Appendix”, or “Appendix 1”, or “Appendix 2”, etc. if there is more than one. + +a\times b=c + + + + a×b=c + + + + + + +In view of the parallel print and (chapter-wise) online publication of your book at www.springerlink.com it has been decided that – as a general rule – references should be sorted chapter-wise and placed at the end of the individual chapters. However, upon agreement with your contact at Springer you may list your references in a single separate chapter at the end of your book. Deactivate the class option sectrefs and the thebibliography environment will be put out as a chapter of its own. + + References may be cited in the text either by number (preferred) or by author/year. +Make sure that all references from the list are cited in the text. Those not cited should be moved to a separate Further Reading section or chapter. + The reference list should ideally be sorted in alphabetical order – even if reference numbers are used for the their citation in the text. If there are several works by the same author, the following order should be used: + + +all works by the author alone, ordered chronologically by year of publication + + +all works by the author with a coauthor, ordered alphabetically by coauthor + + +all works by the author with several coauthors, ordered chronologically by year of publication. + + +The styling of references +Always use the standard abbreviation of a journal's name according to the ISSN List of Title Word Abbreviations, see http://www.issn.org/en/node/344 + depends on the subject of your book: + + +The two recommended styles for references in books on mathematical, physical, statistical and computer sciences are depicted in  , , , , and  , , , , . + + +Examples of the most commonly used reference style in books on Psychology, Social Sciences are , , , , . + + +Examples for references in books on Humanities, Linguistics, Philosophy are , , , , . + + +Examples of the basic Springer style used in publications on a wide range of subjects such as Computer Science, Economics, Engineering, Geosciences, Life Sciences, Medicine, Biomedicine are  , , , , . + + + + +
+
+
+
+
+ + Broy, M.: Software engineering — from auxiliary to key technologies. In: Broy, M., Dener, E. (eds.) Software Pioneers, pp. 10-13. Springer, Heidelberg (2002) + Dod, J.: Effective substances. In: The Dictionary of Substances and Their Effects. Royal Society of Chemistry (1999) Available via DIALOG. http://www.rsc.org/dose/title of subordinate document. Cited 15 Jan 1999 + Geddes, K.O., Czapor, S.R., Labahn, G.: Algorithms for Computer Algebra. Kluwer, Boston (1992) + Hamburger, C.: Quasimonotonicity, regularity and duality for nonlinear systems of partial differential equations. Ann. Mat. Pura. Appl. 169, 321–354 (1995) + Slifka, M.K., Whitton, J.L.: Clinical implications of dysregulated cytokine production. J. Mol. Med. (2000) doi: 10.1007/s001090000086 + + + + J. Dod, in The Dictionary of Substances and Their Effects, Royal Society of Chemistry. (Available via DIALOG, 1999), http://www.rsc.org/dose/title of subordinate document. Cited 15 Jan 1999 + H. Ibach, H. Lüth, Solid-State Physics, 2nd edn. (Springer, New York, 1996), pp. 45-56 + S. Preuss, A. Demchuk Jr., M. Stuke, Appl. Phys. A 61 + M.K. Slifka, J.L. Whitton, J. Mol. Med., doi: 10.1007/s001090000086 + S.E. Smith, in Neuromuscular Junction, ed. by E. Zaimis. Handbook of Experimental Pharmacology, vol 42 (Springer, Heidelberg, 1976), p. 593 + + Calfee, R. C., & Valencia, R. R. (1991). APA guide to preparing manuscripts for journal publication. Washington, DC: American Psychological Association. + Dod, J. (1999). Effective substances. In: The dictionary of substances and their effects. Royal Society of Chemistry. Available via DIALOG. http://www.rsc.org/dose/Effective substances. Cited 15 Jan 1999. + Harris, M., Karper, E., Stacks, G., Hoffman, D., DeNiro, R., Cruz, P., et al. (2001). Writing labs and the Hollywood connection. J Film Writing, 44(3), 213–245. + O'Neil, J. M., & Egan, J. (1992). Men's and women's gender role journeys: Metaphor for healing, transition, and transformation. In B. R. Wainrig (Ed.), Gender issues across the life cycle (pp. 107–123). New York: Springer. +Kreger, M., Brindis, C.D., Manuel, D.M., Sassoubre, L. (2007). Lessons learned in systems change initiatives: benchmarks and indicators. American Journal of Community Psychology, doi: 10.1007/s10464-007-9108-14. + + Alber John, Daniel C. O'Connell, and Sabine Kowal. 2002. Personal perspective in TV interviews. Pragmatics 12:257–271 + Cameron, Deborah. 1997. Theoretical debates in feminist linguistics: Questions of sex and gender. In Gender and discourse, ed. Ruth Wodak, 99–119. London: Sage Publications. + Cameron, Deborah. 1985. Feminism and linguistic theory. New York: St. Martin's Press. + Dod, Jake. 1999. Effective substances. In: The dictionary of substances and their effects. Royal Society of Chemistry. Available via DIALOG. http://www.rsc.org/dose/title of subordinate document. Cited 15 Jan 1999 + Suleiman, Camelia, Daniel C. O'Connell, and Sabine Kowal. 2002. `If you and I, if we, in this later day, lose that sacred fire...´': Perspective in political interviews. Journal of Psycholinguistic Research. doi: 10.1023/A:1015592129296. + + Brown B, Aaron M (2001) The politics of nature. In: Smith J (ed) The rise of modern genomics, 3rd edn. Wiley, New York + Dod J (1999) Effective Substances. In: The dictionary of substances and their effects. Royal Society of Chemistry. Available via DIALOG. http://www.rsc.org/dose/title of subordinate document. Cited 15 Jan 1999 + Slifka MK, Whitton JL (2000) Clinical implications of dysregulated cytokine production. J Mol Med, doi: 10.1007/s001090000086 + Smith J, Jones M Jr, Houghton L et al (1999) Future of health insurance. N Engl J Med 965:325–329 + South J, Blass B (2001) The future of modern genomics. Blackwell, London + + +All's well that ends well + +Chapter Heading<anchor xml:id="chap.introA" /> +chapter heading in the running head +
+Section Heading +section heading in the running head +bla +
+Section Heading 2 +For multiline equations we recommend to use the eqnarray environment. + +a\times b & = & c\nonumber \\ +\vec{a}\cdot\vec{b} & = & c\label{eq:A01} + + + + + + + a×b + + + = + + c + + + + + + + a + + + + b + + + + + = + + c + + + + + + +
+Subsubsection Heading + + Please write your figure caption here +Error: no float found in the box. To use subfigures in DocBook, elements must be wrapped in a float inset and have a title/caption. + +replace this box by an image + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +^{a} + + + + + a + + + + + Table foot note (with superscript)
Please write your table caption here
Classes Subclass Length Action Mechanism
+ Translation mRNA +^{a} + + + + + a + + + + + 22 (19–25) Translation repression, mRNA cleavage
Translation mRNA cleavage 21 mRNA cleavage
Translation mRNA 21–22 mRNA cleavage
Translation mRNA 24–26 Histone and DNA Modification
+ +Glossary +Here comes the glossaryglossary + +glossary term + +Write here the description of the glossary term. Write here the description of the glossary term. Write here the description of the glossary term. + +glossary term + +Write here the description of the glossary term. Write here the description of the glossary term. Write here the description of the glossary term. + +glossary term + +Write here the description of the glossary term. Write here the description of the glossary term. Write here the description of the glossary term. + +glossary term + +Write here the description of the glossary term. Write here the description of the glossary term. Write here the description of the glossary term. + +glossary term + +Write here the description of the glossary term. Write here the description of the glossary term. Write here the description of the glossary term. +
+
+
+
\ No newline at end of file diff --git a/src/output_docbook.cpp b/src/output_docbook.cpp index a843a40f38..2c9c4883b3 100644 --- a/src/output_docbook.cpp +++ b/src/output_docbook.cpp @@ -727,12 +727,18 @@ bool isLayoutSectioning(Layout const & lay) { if (lay.docbooksection()) // Special case: some DocBook styles must be handled as sections. return true; - else if (lay.category() == from_utf8("Sectioning")) // Generic case. + else if (lay.category() == from_utf8("Sectioning") || lay.docbooktag() == "section") // Generic case. return lay.toclevel != Layout::NOT_IN_TOC; return false; } +bool isLayoutSectioningOrSimilar(Layout const & lay) +{ + return isLayoutSectioning(lay) || lay.docbooktag() == "bridgehead"; +} + + using DocBookDocumentSectioning = tuple; @@ -757,7 +763,7 @@ DocBookDocumentSectioning hasDocumentSectioning(ParagraphList const ¶graphs, while (bpit < epit) { Layout const &style = paragraphs[bpit].layout(); - documentHasSections |= isLayoutSectioning(style); + documentHasSections |= isLayoutSectioningOrSimilar(style); if (documentHasSections) break; @@ -823,7 +829,7 @@ DocBookInfoTag getParagraphsWithInfo(ParagraphList const ¶graphs, // There should never be any section here, except for the first paragraph (a title can be part of ). // (Just a sanity check: if this fails, this function could end up processing the whole document.) - if (cpit != bpit && isLayoutSectioning(par.layout())) { + if (cpit != bpit && isLayoutSectioningOrSimilar(par.layout())) { LYXERR0("Assertion failed: section found in potential paragraphs."); break; }