Attached a patch to make the title section of agu-dtd be surrounded 
by <header>...</header>, as it should.

This makes use of a LaTeX feature originally for elsart... which now
serves both back-ends ;-)

Also contains a little work on AGU's title environments. Not even
close to a full and correct implementation yet.

- Martin

-- 
Martin Vermeer  [EMAIL PROTECTED]
Helsinki University of Technology 
Dept. of Surveying, Inst. of Geodesy
P.O. Box 1200, FIN-02015 HUT, Finland
:wq
Index: src/output_docbook.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/output_docbook.C,v
retrieving revision 1.3
diff -u -p -r1.3 output_docbook.C
--- src/output_docbook.C        25 Nov 2003 17:23:34 -0000      1.3
+++ src/output_docbook.C        16 Dec 2003 18:53:16 -0000
@@ -16,6 +16,7 @@
 #include "buffer.h"
 #include "bufferparams.h"
 #include "counters.h"
+#include "debug.h"
 #include "lyxtext.h"
 #include "paragraph.h"
 #include "paragraph_funcs.h"
@@ -66,11 +67,34 @@ void docbookParagraphs(Buffer const & bu
        ParagraphList::iterator par = const_cast<ParagraphList&>(paragraphs).begin();
        ParagraphList::iterator pend = const_cast<ParagraphList&>(paragraphs).end();
 
-    Counters & counters = buf.params().getLyXTextClass().counters();
+       LyXTextClass const & tclass = buf.params().getLyXTextClass();
+       Counters & counters = tclass.counters();
+
+       bool was_title = false;
+       bool already_title = false;
        
        for (; par != pend; ++par) {
 
                LyXLayout_ptr const & style = par->layout();
+
+               if (style->intitle) {
+                       if (already_title) {
+                               lyxerr <<"Error in latexParagraphs: You"
+                                       " should not mix title layouts"
+                                       " with normal ones." << endl;
+                       } else if (!was_title) {
+                               was_title = true;
+                               if (tclass.titletype() == TITLE_ENVIRONMENT) {
+                                       os << "<" << tclass.titlename() << ">\n";
+                               }
+                       }
+               } else if (was_title && !already_title) {
+                       if (tclass.titletype() == TITLE_ENVIRONMENT) {
+                               os << "</" << tclass.titlename() << ">\n";
+                       }
+                       already_title = true;
+                       was_title = false;
+               }
 
                // environment tag closing
                for (; depth > par->params().depth(); --depth) {
Index: lib/layouts/agu_stdclass.inc
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/layouts/agu_stdclass.inc,v
retrieving revision 1.3
diff -u -p -r1.3 agu_stdclass.inc
--- lib/layouts/agu_stdclass.inc        6 Dec 2003 09:31:29 -0000       1.3
+++ lib/layouts/agu_stdclass.inc        16 Dec 2003 18:53:16 -0000
@@ -18,6 +18,11 @@ ClassOptions
        Header              "<!DOCTYPE # PUBLIC &quot;-//AGU//DTD article American 
Geophysical Union DTD version 3.42//EN&quot; &quot;AGU-Article-3.42.dtd&quot; "
 End
 
+
+TitleLatexType Environment
+TitleLatexName header
+
+
 Style Standard
        Margin                Static
        LatexType             Paragraph
@@ -31,6 +36,10 @@ Style Standard
 End
 
 
+Style Abstract
+       InTitle               1
+End
+
 CharStyle Firstname
        LatexType             Command
        LatexName             firstname
@@ -100,7 +109,7 @@ End
 Input agu_stdlists.inc
 Input agu_stdsections.inc
 Input db_stdstarsections.inc
-Input db_stdtitle.inc
+Input agu_stdtitle.inc
 Input db_stdstruct.inc
 Input db_lyxmacros.inc
 Input db_stdlayouts.inc
Index: lib/layouts/agu_stdtitle.inc
===================================================================
RCS file: lib/layouts/agu_stdtitle.inc
diff -N lib/layouts/agu_stdtitle.inc
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ lib/layouts/agu_stdtitle.inc        16 Dec 2003 18:53:16 -0000
@@ -0,0 +1,82 @@
+# Textclass definition file for agu-dtd.
+# Author : José Abílio Oliveira Matos <[EMAIL PROTECTED]>
+# Modified Martin Vermeer <[EMAIL PROTECTED]> 
+#
+# This file is the counterpart of stdstyle.inc
+# It is desirable, as far as possible, to have the same look and feel for
+# related layouts in latex and docbook.
+
+Input stdtitle.inc
+
+
+Style Title
+       LatexType             Environment
+       LatexName             special-section
+       KeepEmpty             1
+End
+
+
+Style Author
+       LatexType             Environment
+       LatexName             author
+       KeepEmpty             1
+End
+
+
+Style Journal
+       LatexType             Environment
+       LatexName             AGU-journal
+       KeepEmpty             1
+End
+
+
+Style Volume
+       LatexType             Environment
+       LatexName             AGU-volume
+       KeepEmpty             1
+End
+
+
+Style Issue
+       LatexType             Environment
+       LatexName             AGU-issue
+       KeepEmpty             1
+End
+
+
+Style Received
+       LatexType             Environment
+       LatexName             received
+       KeepEmpty             1
+End
+
+
+Style Revised
+       LatexType             Environment
+       LatexName             revised
+       KeepEmpty             1
+End
+
+
+Style Accepted
+       LatexType             Environment
+       LatexName             accepted
+       KeepEmpty             1
+End
+
+
+Style Online
+       LatexType             Environment
+       LatexName             published-online
+       KeepEmpty             1
+End
+
+
+Style Date
+       LatexType             Paragraph
+       LatexName             date
+       Align                 Left
+       AlignPossible         Left,Center
+End
+
+

Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to