From 8d115413c1165c917337db5d840896d330b5df64 Mon Sep 17 00:00:00 2001 From: Thibaut Cuvelier Date: Sun, 2 Aug 2020 03:14:16 +0200 Subject: [PATCH] DocBook: fix delimitation of bibliographies. --- .../docbook/bibliography_precooked_aastex.xml | 11 +++++------ lib/layouts/aastex6.layout | 4 ++-- lib/layouts/aastex62.layout | 3 ++- src/output_docbook.cpp | 14 +++++++++++--- 4 files changed, 20 insertions(+), 12 deletions(-) diff --git a/autotests/export/docbook/bibliography_precooked_aastex.xml b/autotests/export/docbook/bibliography_precooked_aastex.xml index baadbc0792..bc1016804d 100644 --- a/autotests/export/docbook/bibliography_precooked_aastex.xml +++ b/autotests/export/docbook/bibliography_precooked_aastex.xml @@ -948,7 +948,7 @@ v(p,\lambda)_{\pm} & = & \pm\lambda(E\mp\lambda|{\textbf{p}}|)^{1/2}\chi of the electronically submitted abstracts for AAS meetings are error-free. We are grateful to V. Barger, T. Han, and R. J. N. Phillips for doing the math in section . More information on the AASTeX macros package are available at http://www.aas.org/publications/aastex or the AAS ftp site. -IRAF, AIPS, Astropy, ... +IRAF, AIPS, Astropy, ... Aurière, M. 1982, , 109, 301 @@ -966,9 +966,10 @@ v(p,\lambda)_{\pm} & = & \pm\lambda(E\mp\lambda|{\textbf{p}}|)^{1/2}\chi Ortolani, S., Rosino, L., and Sandage, A. 1985, , 90, 473 Peterson, C. J. 1976, , 81, 617 Spitzer, L. 1985, Dynamics of Star Clusters, J. Goodman and P. Hut, Dordrecht: Reidel, 109 - - - + + + +
@@ -1208,10 +1209,8 @@ v(p,\lambda)_{\pm} & = & \pm\lambda(E\mp\lambda|{\textbf{p}}|)^{1/2}\chi We can also attach a long-ish paragraph of explanatory material to a table. Use \tablerefs to append a list of references. The following references were from a different table: I've patched them in here to show how they look, but don't take them too seriously—I certainly have not.(1) Barbuy, Spite, & Spite 1985; (2) Bond 1980; (3) Carbon et al. 1987; (4) Hobbs & Duncan 1987; (5) Gilroy et al. 1988: (6) Gratton & Ortolani 1986; (7) Gratton & Sneden 1987; (8) Gratton & Sneden (1988); (9) Gratton & Sneden 1991; (10) Kraft et al. 1982; (11) LCL, or Laird, 1990; (12) Leep & Wallerstein 1981; (13) Luck & Bond 1981; (14) Luck & Bond 1985; (15) Magain 1987; (16) Magain 1989; (17) Peterson 1981; (18) Peterson, Kurucz, & Carney 1990; (19) RMB; (20) Schuster & Nissen 1988; (21) Schuster & Nissen 1989b; (22) Spite et al. 1984; (23) Spite & Spite 1986; (24) Hobbs & Thorburn 1991; (25) Hobbs et al. 1991; (26) Olsen 1983.
Terribly relevant tabular information.
-
-
\ No newline at end of file diff --git a/lib/layouts/aastex6.layout b/lib/layouts/aastex6.layout index 52c38be126..03d585ef8a 100644 --- a/lib/layouts/aastex6.layout +++ b/lib/layouts/aastex6.layout @@ -67,8 +67,8 @@ Style Software LabelFont Shape Italic EndFont - DocBookWrapperTag para - DocBookTag application + DocBookWrapperTag para + DocBookTag application End # other new commands are mainly for the user preamble diff --git a/lib/layouts/aastex62.layout b/lib/layouts/aastex62.layout index 16173d45ed..3eb7dcc44c 100644 --- a/lib/layouts/aastex62.layout +++ b/lib/layouts/aastex62.layout @@ -78,7 +78,8 @@ Style Software LabelFont Shape Italic EndFont - + DocBookWrapperTag para + DocBookTag application End # other new commands are mainly for the user preamble diff --git a/src/output_docbook.cpp b/src/output_docbook.cpp index 1a2bb41094..94aac878bd 100644 --- a/src/output_docbook.cpp +++ b/src/output_docbook.cpp @@ -274,6 +274,14 @@ ParagraphList::const_iterator findLastParagraph( return p; } +ParagraphList::const_iterator findLastBibliographyParagraph( + ParagraphList::const_iterator p, + ParagraphList::const_iterator const & pend) { + for (++p; p != pend && p->layout().latextype == LATEX_BIB_ENVIRONMENT; ++p); + + return p; +} + ParagraphList::const_iterator findEndOfEnvironment( ParagraphList::const_iterator const & pstart, @@ -339,7 +347,7 @@ ParagraphList::const_iterator makeParagraphBibliography( xs << xml::CR(); } - // Generate the required paragraphs. + // 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! @@ -628,7 +636,7 @@ ParagraphList::const_iterator makeEnvironment( par = makeParagraphs(buf, xs, runparams, text, par, send); break; case LATEX_BIB_ENVIRONMENT: - send = findLastParagraph(par, pend); + send = findLastBibliographyParagraph(par, pend); par = makeParagraphBibliography(buf, xs, runparams, text, par, send); break; case LATEX_COMMAND: @@ -705,7 +713,7 @@ pair makeAny( break; } case LATEX_BIB_ENVIRONMENT: { - send = findLastParagraph(par, pend); + send = findLastBibliographyParagraph(par, pend); par = makeParagraphBibliography(buf, xs, ourparams, text, par, send); break; }