]> git.lyx.org Git - features.git/commitdiff
New framework for declaring generic features in textclasses.
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 6 Apr 2007 09:02:23 +0000 (09:02 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 6 Apr 2007 09:02:23 +0000 (09:02 +0000)
* src/LaTeXFeatures.C (mustProvide): new method; returns true when
isRequired is true and the feature is not provided by the
textclass.
(getPackages, getLyXSGMLEntities): use mustProvide when relevant.

* src/bufferparams.C (getEngine):
* src/buffer.C (validate): adapt to change below.

* src/lyxtextclass.C (read): replace tags ProvidesNatbib,
ProvidesMakeidx, ProvidesUrl and ProvidesAmsmath by a generic
"Provides".
(provides): take a string as argument.

* lib/scripts/layout2layout.py (convert): convert "ProvidesXxx" tags
to "Provides xxx".

* lib/layouts/*: update to format 4.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17740 a592a061-630c-0410-9148-cb99ea01b6c8

119 files changed:
lib/layouts/IEEEtran.layout
lib/layouts/aa.layout
lib/layouts/aapaper.inc
lib/layouts/aapaper.layout
lib/layouts/aastex.layout
lib/layouts/agu-dtd.layout
lib/layouts/agu_stdclass.inc
lib/layouts/agu_stdcounters.inc
lib/layouts/agu_stdlists.inc
lib/layouts/agu_stdsections.inc
lib/layouts/agu_stdtitle.inc
lib/layouts/agums.layout
lib/layouts/aguplus.inc
lib/layouts/amsart-plain.layout
lib/layouts/amsart-seq.layout
lib/layouts/amsart.layout
lib/layouts/amsbook.layout
lib/layouts/amsdefs.inc
lib/layouts/amsmaths-plain.inc
lib/layouts/amsmaths-seq.inc
lib/layouts/amsmaths.inc
lib/layouts/apa.layout
lib/layouts/arab-article.layout
lib/layouts/article.layout
lib/layouts/beamer.layout
lib/layouts/book.layout
lib/layouts/broadway.layout
lib/layouts/chess.layout
lib/layouts/cl2emult.layout
lib/layouts/cv.layout
lib/layouts/db_lyxmacros.inc
lib/layouts/db_stdcharstyles.inc
lib/layouts/db_stdclass.inc
lib/layouts/db_stdcounters.inc
lib/layouts/db_stdlayouts.inc
lib/layouts/db_stdlists.inc
lib/layouts/db_stdsections.inc
lib/layouts/db_stdstarsections.inc
lib/layouts/db_stdstruct.inc
lib/layouts/db_stdtitle.inc
lib/layouts/dinbrief.layout
lib/layouts/docbook-book.layout
lib/layouts/docbook-chapter.layout
lib/layouts/docbook-section.layout
lib/layouts/docbook.layout
lib/layouts/dtk.layout
lib/layouts/egs.layout
lib/layouts/elsart.layout
lib/layouts/entcs.layout
lib/layouts/europecv.layout
lib/layouts/extarticle.layout
lib/layouts/extbook.layout
lib/layouts/extletter.layout
lib/layouts/extreport.layout
lib/layouts/foils.layout
lib/layouts/g-brief-de.layout
lib/layouts/g-brief-en.layout
lib/layouts/g-brief2.layout
lib/layouts/heb-article.layout
lib/layouts/heb-letter.layout
lib/layouts/hollywood.layout
lib/layouts/ijmpc.layout
lib/layouts/ijmpd.layout
lib/layouts/isprs.layout
lib/layouts/jgrga.layout
lib/layouts/kluwer.layout
lib/layouts/latex8.layout
lib/layouts/letter.layout
lib/layouts/literate-article.layout
lib/layouts/literate-book.layout
lib/layouts/literate-report.layout
lib/layouts/literate-scrap.inc
lib/layouts/llncs.layout
lib/layouts/ltugboat.layout
lib/layouts/lyxmacros.inc
lib/layouts/manpage.layout
lib/layouts/memoir.layout
lib/layouts/moderncv.layout
lib/layouts/mwart.layout
lib/layouts/mwbk.layout
lib/layouts/mwrep.layout
lib/layouts/numarticle.inc
lib/layouts/numreport.inc
lib/layouts/numrevtex.inc
lib/layouts/paper.layout
lib/layouts/report.layout
lib/layouts/revtex.layout
lib/layouts/revtex4.layout
lib/layouts/scrartcl.layout
lib/layouts/scrbook.layout
lib/layouts/scrclass.inc
lib/layouts/scrlettr.layout
lib/layouts/scrlttr2.layout
lib/layouts/scrreprt.layout
lib/layouts/seminar.layout
lib/layouts/siamltex.layout
lib/layouts/slides.layout
lib/layouts/spie.layout
lib/layouts/stdclass.inc
lib/layouts/stdcounters.inc
lib/layouts/stdfloats.inc
lib/layouts/stdlayouts.inc
lib/layouts/stdletter.inc
lib/layouts/stdlists.inc
lib/layouts/stdsections.inc
lib/layouts/stdstarsections.inc
lib/layouts/stdstruct.inc
lib/layouts/stdtitle.inc
lib/layouts/svglobal.layout
lib/layouts/svjog.layout
lib/layouts/svjour.inc
lib/layouts/svprobth.layout
lib/scripts/layout2layout.py
src/LaTeXFeatures.C
src/LaTeXFeatures.h
src/buffer.C
src/bufferparams.C
src/lyxtextclass.C
src/lyxtextclass.h

index 464eb12570033b64e469f352dfa2fd7bb4ae7ded..07822c27e25e87b99d30bfcbb8747eda0d8f1284 100644 (file)
@@ -14,7 +14,7 @@
 # the author information area.  There is a LaTeX 2.09 IEEEtran.sty available
 # also but LyX doesn't support 2.09 stuff so don't get that one.
 
-Format 3
+Format 4
 Style Standard
        Margin                Static
        LatexType             Paragraph
index fbc036e8c7374481162171c36bdf0c16adc7c08a..42961b063912fabff9fee3f3c764a9178836cf4f 100644 (file)
@@ -11,7 +11,7 @@
 #             abstract is command
 
 
-Format 3
+Format 4
 Columns                 2
 Sides                   2
 SecNumDepth             3
index 2d37abb6cdac847c7ce3493745771040929e7e1e..3df2ac1b37dd1d85f5cbcf4a99173b53da921d78 100644 (file)
@@ -5,7 +5,7 @@
 # Author: Peter Sütterlin <pit@uni-sw.gwdg.de>
 
 
-Format 3
+Format 4
 Style Subtitle
        Margin                Static
        LatexType             Command
index 39e17320d1080158b509fd02ba01dc079075d658..c1dee816d0b21aa93abc4cc921acae5c0d3a5ec6 100644 (file)
@@ -14,7 +14,7 @@
 # and reconfigure LyX (after running texhash, of course).
 
 
-Format 3
+Format 4
 Columns                 2
 Sides                   2
 SecNumDepth             3
index 572c545ed4f4956d0aa45385026a64dfe2b988e9..9112cb754eea44eb6f3858bb13aa1d60b3505e4f 100644 (file)
 # Version 1.3   5/7/04  - Updated for AASTeX 5.2
 
 
-Format 3
+Format 4
 Columns                 1
 Sides                   1
 #SecNumDepth            3
 TocDepth                0
 PageStyle               Plain
-ProvidesAmsmath         1
-ProvidesNatbib          1
-ProvidesUrl             1
+Provides amsmath         1
+Provides natbib          1
+Provides url             1
 
 
 ClassOptions
index 1e548cef54bdb31608f1c285c7d8fdeacc4ee4b2..17c74f5a877dbb386e0302cf1d1fe79483a79cbd 100644 (file)
@@ -5,7 +5,7 @@
 #           Martin Vermeer <martin.vermeer@hut.fi>
 
 
-Format 3
+Format 4
 Input agu_stdclass.inc
 
 # Exclude higher, or equal, sections:
index e8be680003461076d56104b2d06b66b8bf4d202a..344feb03cee1027c0385e8986057ee0f7607d733 100644 (file)
@@ -6,7 +6,7 @@
 # It is desirable, as far as possible, to have the same look and feel for
 # related layouts in latex and docbook.
 
-Format 3
+Format 4
 OutputType              docbook
 
 Columns                 1
index d5e5c80382d8e54a82d5cab92962d8c31e785dc6..5ad2b74694b6b5992e2ae90a3fe1420553379e26 100644 (file)
@@ -4,7 +4,7 @@
 # This include file contains all the counters that are defined as standard
 # in AGU-Article LyX layouts.
 
-Format 3
+Format 4
 Counter
        Name                 sect1
        Within               section
index f28e3a71f085e3ea074ff8cbf5ebaa2eb36931d0..2e1e5ae0c6d081516090215edc1db5ec445152bd 100644 (file)
@@ -6,7 +6,7 @@
 # It is desirable, as far as possible, to have the same look and feel for
 # related layouts in latex and docbook.
 
-Format 3
+Format 4
 Input stdlists.inc
 
 
index 0cdcb0dc4770c5bcb9bf3e337944e08bca77a9b1..ec14a35112ff1782aeb372801cec571d0a1241ff 100644 (file)
@@ -6,7 +6,7 @@
 # It is desirable, as far as possible, to have the same look and feel for
 # related layouts in latex and docbook.
 
-Format 3
+Format 4
 Input stdsections.inc
 
 Style Part
index 1e971155c8056a3e08affdafcc97c08915ed8423..df53984944e0719f6756ec26b1e75c954186f3a1 100644 (file)
@@ -6,7 +6,7 @@
 # It is desirable, as far as possible, to have the same look and feel for
 # related layouts in latex and docbook.
 
-Format 3
+Format 4
 Input stdtitle.inc
 
 
index 21d9f8b8441c2660c8ec369f04db4aeafbf3978c..779d7dfe5fd8e9f66ef5bee83a31514b45604635 100644 (file)
@@ -4,7 +4,7 @@
 # Author: Martin Vermeer <martin.vermeer@hut.fi>
 
 
-Format 3
+Format 4
 Input aguplus.inc
 
 ClassOptions
index 1296fcc2eb87d025b1f44077c5bf872815216839..9751ff108bee5907a59b8869c16679a6572b2a09 100644 (file)
@@ -6,7 +6,7 @@
 # ftp://ftp.agu.org/journals/latex/journals
 
 
-Format 3
+Format 4
 Input stdclass.inc
 
 SecNumDepth             4
index 8220e4b066e4925a4e806152ca0d4cff0fd1b412..39f4b5fd06ea4ef6e06d9d99e0b96f5be328f378 100644 (file)
@@ -8,7 +8,7 @@
 # Probably broken by Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
 # modified and modularized by Emmanuel GUREGHIAN <gureghia@boston.bertin.fr>
 
-Format 3
+Format 4
 Input amsart.layout
 
 # Change the definitions of the theorem-like environments to get unnumbered
index c076b8fbcfec79d70aa4dc4e351149d1d1b0aff0..31eee4e4da07f64ad162c3c10d7ad353bb59f399 100644 (file)
@@ -12,7 +12,7 @@
 # Probably broken by Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
 # modified and modularized by Emmanuel GUREGHIAN <gureghia@boston.bertin.fr>
 
-Format 3
+Format 4
 Input amsart.layout
 
 # Change the definitions of the theorem-like environments to get a
index 2d5e7b3918a215aa768c6362fc207716cb832f9d..78e8b287a654940bf0f595c9ef990233eeb53a34 100644 (file)
@@ -7,7 +7,7 @@
 # Probably broken by Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
 # modified and modularized by Emmanuel GUREGHIAN <gureghia@boston.bertin.fr>
 
-Format 3
+Format 4
 Columns                 1
 Sides                   2
 PageStyle               Headers
index 4eb2ff4a89939178e3dc03bebd4feb9ba5d1bda6..211a8917c15ffa7c1550db3b8443b6325728e54f 100644 (file)
@@ -8,7 +8,7 @@
 # modified and modularized by Emmanuel GUREGHIAN <gureghia@boston.bertin.fr>
 
 
-Format 3
+Format 4
 Columns                 1
 Sides                   2
 PageStyle               Headers
index 19bbb288e6415aaf3d4d80a6799c850eac8004ea..993bd4777a54ca7b9983be14aaa66873e8a9d6ea 100644 (file)
@@ -3,13 +3,13 @@
 # modified and modularized by Emmanuel GUREGHIAN <gureghia@boston.bertin.fr>
 
 # Including the maths stuff
-Format 3
+Format 4
 Input amsmaths.inc
 
 # The AMS documentclasses use the package amsmath and provide the
 # functionality of makeidx.sty.
-ProvidesAmsmath         1
-ProvidesMakeidx         1
+Provides amsmath         1
+Provides makeidx         1
 
 
 # the environments copied from the old amsart.layout are:
index 3e704e7708a423cc1d8ecab55acfca8698e5ad2e..1728a84907d67336f823e7e77a6336c490eadb54 100644 (file)
@@ -29,7 +29,7 @@
 # - Conclusion
 
 
-Format 3
+Format 4
 Style Theorem
        LatexName             thm*
        LabelString           "Theorem."
index 4188c07b99e042ebc07f4d31dd19de4ec66a9495..2da1000936d4bfbbe33ac01d5409cee0dc8cc958 100644 (file)
@@ -28,7 +28,7 @@
 # - Conclusion
 
 
-Format 3
+Format 4
 Style Theorem
        Preamble
          \theoremstyle{plain}
index 0c6675c54efa9a962311f54b9adee36a1bb3000b..7083b6ea0a6a6b4863ee78970de8438da328186f 100644 (file)
@@ -47,7 +47,7 @@
 # - Fact
 # - Fact*
 
-Format 3
+Format 4
 Preamble
   \theoremstyle{plain}
        \newtheorem{thm}{Theorem}[section]
index f575929bd49f0615e63407b858f4e6f3cc0f9b79..8b716d8027e2e98b4d44a14cc9f44a41317e8933 100644 (file)
@@ -2,7 +2,7 @@
 #  \DeclareLaTeXClass[apa,apacite.sty]{article (APA)}
 # Author: Randy Gobbel <gobbel@andrew.cmu.edu>
 
-Format 3
+Format 4
 Columns                 1
 Sides                   1
 PageStyle               Headers
index 789a3ca77e0bcfe59f2312027cd98df7ba4f0579..3c4da498b5de2e207eab36e18d51aac2bc716a6a 100644 (file)
@@ -3,5 +3,5 @@
 # Arabic article textclass definition file.
 # Author: Dekel Tsur <dekel@math.tau.ac.il>
 
-Format 3
+Format 4
 Input article
index 37bb41b3b10edcf30406a96ffa511d8a047d7bb9..07379571b5d73668e59f7342dc78852a3e8005aa 100644 (file)
@@ -5,7 +5,7 @@
 # Transposed by Pascal André <andre@via.ecp.fr>
 # Heavily modifed and enhanced by serveral developers.
 
-Format 3
+Format 4
 Input stdclass.inc
 
 SecNumDepth             3
index 1842726bd5d6cf81682fdf6689785356698ff27e..b2e1746755bef5b472992735fa197def027b2d34 100644 (file)
@@ -5,7 +5,7 @@
 # $Header: /cvsroot/latex-beamer/latex-beamer/lyx/layouts/beamer.layout,v 1.16 2004/10/07 20:53:07 tantau Exp $
 
 # Includes
-Format 3
+Format 4
 Input stdcounters.inc
 
 # General textclass parameters
index 5587a4ed60eb4860bb4ce30f2a0d94a4356e9aae..22e9d4dadd427891dc9fc21066555ac6c962a1ac 100644 (file)
@@ -6,7 +6,7 @@
 # Heavily modifed and enhanced by serveral developers.
 
 
-Format 3
+Format 4
 Input stdclass.inc
 Input numreport.inc
 
index 8cd3cea32da37fe7dc0e5a91a775119f2a55a72a..36ad5183ae7df934664ce21a41673fe9c58f51c9 100644 (file)
@@ -3,7 +3,7 @@
 
 # For theater plays
 
-Format 3
+Format 4
 Columns                 1
 Sides                   1
 SecNumDepth             2
index 55cdfc4f68b2adc2974a9900905d6f34ea3fa5ba..177ce39a761066d2c04de9a438b486192db44ccb 100644 (file)
@@ -16,7 +16,7 @@
 # \vspace*{-0.5in})
 #
 
-Format 3
+Format 4
 Preamble
        \usepackage[ps,mover]{lyxskak}
        %%% initialize board
index 61fb0ab2b43bb0710909b78d40fdaf2d49c57591..0c8139ae8ce0ba10f229e6254f11c50bbbd3b3fa 100644 (file)
@@ -3,7 +3,7 @@
 # Springer's cl2emult textclass definition file.
 # Author : André Poenitz
 
-Format 3
+Format 4
 Columns                   1
 Sides                     1
 SecNumDepth               2
index 85c3ac9b312962459450568000ab308cbacb4f6c..fad150bf0c76597f664a2a84672b59c8d5200bfc 100644 (file)
@@ -4,7 +4,7 @@
 # Author : Jean-Marc Lasgouttes (Jean-Marc.Lasgouttes@inria.fr)
 
 
-Format 3
+Format 4
 Columns                 1
 Sides                   1
 SecNumDepth             -1
index 2359bda7ec53e6cf651e493ee123805a784a8dae..8fb7235298aa68d759f9a221711f3409feba5d1a 100644 (file)
@@ -5,7 +5,7 @@
 # It is desirable, as far as possible, to have the same look and feel for
 # related layouts in latex and docbook.
 
-Format 3
+Format 4
 Input lyxmacros.inc
 
 Style Code
index fce08e82b95067de6c5de32c09b7ea5423f278d0..0868afc4aff288cfceb5b967977ea58902e8b5b8 100644 (file)
@@ -2,7 +2,7 @@
 # Author : José Abílio Oliveira Matos <jamatos@lyx.org>
 # Character Styles definition
 
-Format 3
+Format 4
 CharStyle Filename
        LatexType             Command
        LatexName             filename
index 9a4257ab67ea2bddcf5d9c45ad56e32a43531af1..a96f0b0009c4de52b207ef6570a7c3a8f3aa1d5c 100644 (file)
@@ -5,7 +5,7 @@
 # It is desirable, as far as possible, to have the same look and feel for
 # related layouts in latex and docbook.
 
-Format 3
+Format 4
 OutputType              docbook
 
 Columns                 1
index 7f3fce04d98166d718a3b86aff0e90061e5fad84..f6b14d0a165e5bea5f74fe8064f428154d0ffde4 100644 (file)
@@ -4,7 +4,7 @@
 # This include file contains all the counters that are defined as standard
 # in Docbook LyX layouts.
 
-Format 3
+Format 4
 Counter
        Name                 sect1
        Within               chapter
index 6ade253732019f365e257c5a009eb7f129e002b6..163e3462f3577643bdb35dd924238d4cfd162f68 100644 (file)
@@ -5,7 +5,7 @@
 # It is desirable, as far as possible, to have the same look and feel for
 # related layouts in latex and docbook.
 
-Format 3
+Format 4
 Input stdlayouts.inc
 
 Style Literal
index ec42a1724be44686b122bf111e1abf3d915cfb41..c4744853a360b6af26ece183bd7d1839a0f5b934 100644 (file)
@@ -5,7 +5,7 @@
 # It is desirable, as far as possible, to have the same look and feel for
 # related layouts in latex and docbook.
 
-Format 3
+Format 4
 Input stdlists.inc
 
 
index c2a878562f12a52c666328119afc05db593e06f4..b607349d887e9d17a069758d45fc15bb1b63a48a 100644 (file)
@@ -6,7 +6,7 @@
 # It is desirable, as far as possible, to have the same look and feel for
 # related layouts in latex and docbook.
 
-Format 3
+Format 4
 Input stdsections.inc
 
 Style Part
index 075420499cb8ba40b4f753a06358ab0b57f07d0f..c7dc399171ebef8d24d495f8a98aaa91eb6bbbd5 100644 (file)
@@ -9,7 +9,7 @@
 # modifying the style of the regular sectioning layouts.
 
 
-Format 3
+Format 4
 Style Part*
        CopyStyle             Part
        Margin                Static
index 5defd7a70719f98ef333ce9072d5b4b2b7a59118..cd8a360aac260af1ef2266d935c671e68bc7cd8c 100644 (file)
@@ -5,7 +5,7 @@
 # It is desirable, as far as possible, to have the same look and feel for
 # related layouts in latex and docbook.
 
-Format 3
+Format 4
 Input stdstruct.inc
 
 Style Abstract
index 66c04977e4f44137f20aa3c55bae84676fbdde12..f170e38b5ba9e05136573a0801880d2b7ec5c8a0 100644 (file)
@@ -6,7 +6,7 @@
 # It is desirable, as far as possible, to have the same look and feel for
 # related layouts in latex and docbook.
 
-Format 3
+Format 4
 Input stdtitle.inc
 
 
index 75bfa718c0e770fc7bbfef55d6600f64177e27dd..e79942afb0ad4b15dbb45e46723986a370e8628c 100644 (file)
@@ -6,7 +6,7 @@
 # Modifies only some things from letter.layout
 
 
-Format 3
+Format 4
 Input letter.layout
 
 
index 45969ba4752d41d35c1a5f1e5967805aec59ff26..009e7cea6022d2695108221fba835fde0bd91be8 100644 (file)
@@ -4,7 +4,7 @@
 # Author : Jose' Matos <jamatos@lyx.org>
 # hacked for books: Luc Abom <luc@abom.com>
 
-Format 3
+Format 4
 Input report
 Input db_stdclass.inc
 
index e1ac61bebe9f7d1144d1c6c56fad575c2d904f54..d5c5c72d93c4eb1b7e9c4416d3bc4fe3b0fb100d 100644 (file)
@@ -3,7 +3,7 @@
 # DocBook textclass definition file.
 # Author : Jose' Matos <jamatos@lyx.org>
 
-Format 3
+Format 4
 Input db_stdclass.inc
 
 Style Title
index 22323de59d9d6fea916a40881463b4cb5416a030..916b638026801a990cb3b3a831dbca6053f9382b 100644 (file)
@@ -3,7 +3,7 @@
 # DocBook textclass definition file.
 # Author : Jose' Matos <jamatos@lyx.org>
 
-Format 3
+Format 4
 Input db_stdclass.inc
 
 Style Title
index 9e5403310b023e511508bec887b6a20d7ab99005..0225bc05f6d48f076f67ef64d590d8f2b1fba979 100644 (file)
@@ -3,7 +3,7 @@
 # DocBook textclass definition file.
 # Author : Jose' Matos <jamatos@lyx.org>
 
-Format 3
+Format 4
 Input db_stdclass.inc
 
 # Exclude higher, or equal, sections:
index ab942a790573290a48a50974d17a610d7431b320..5f7aa99c7420d0b60f698baca7346c30e8244971 100644 (file)
@@ -6,7 +6,7 @@
 # Author : Herbert Voss <voss@lyx.org> 2001/08/13
 
 
-Format 3
+Format 4
 Columns                 1
 Sides                   2
 SecNumDepth             -1              # no counting
index 3595b123d86e94d999edc38e9c3c1241709cb0cb..dbc671deaa9efd7504565ba21379c7e3b15181d7 100644 (file)
@@ -8,11 +8,11 @@
 # Converted article -> egs Martin Vermeer
 
 
-Format 3
+Format 4
 Columns                 2
 Sides                   1
 PageStyle               Plain
-ProvidesNatbib          1
+Provides natbib          1
 
 
 Style Standard
index 268c521cb469248398b534e27ea0dc1e61c5d8e5..49f78ebed40a5ec8031900b7c10947771181de1a 100644 (file)
@@ -22,7 +22,7 @@
 #       numbered sections, as does the class file.
 
 
-Format 3
+Format 4
 Columns                 1
 Sides                   2
 PageStyle               headings
index 2073b52af664859f6894530a772490d442f24db1..41da3ce21f42c5731e477fafac5a886f5b6433bb 100644 (file)
@@ -3,7 +3,7 @@
 # Based on LyX article class; modified to support ENTCS class
 # Reuben Thomas (rrt@sc3d.org)   27/5-2/6/01
 
-Format 3
+Format 4
 Input article.layout
 
 # only font size 11pt is really available
index c2dbedd58d7d2d666783d5378657adb5b5cc1f70..f85b4e738d40eea7a941e46c5621350e9f65df58 100644 (file)
@@ -5,7 +5,7 @@
 
 
 # General textclass parameters
-       Format 3
+Format 4
        Columns                 1
        Sides                   1
        SecNumDepth             -1
index c060ffc1fe2f7f9f8a411a4e616c6c0670fa8e50..bf082c9018cdcb83205abdf778e4267357a464b9 100644 (file)
@@ -2,7 +2,7 @@
 #  \DeclareLaTeXClass{extarticle}
 # Herbert Voss <voss@lyx.org>
 
-Format 3
+Format 4
 Input article.layout
 
 # change available fontsizes
index c4858d14129b48ad827807ff32e31ef65f9c0f80..aae78a4230b41dc5337eace0e5f18aeed0d583a7 100644 (file)
@@ -3,7 +3,7 @@
 # Extended book textclass definition file.
 # Herbert Voss <voss@lyx.org>
 
-Format 3
+Format 4
 Input book.layout
 
 # change available fontsizes
index 73ff00adfced518b1df639d6cf20d907972cebc0..38419916d585c36ed47c1ccf7eff57eef610269f 100644 (file)
@@ -3,7 +3,7 @@
 # Extended article textclass definition file.
 # Herbert Voss <voss@lyx.org>
 
-Format 3
+Format 4
 Input letter.layout
 
 # change available fontsizes
index 6ea344498cf53d8eb26a273153af44cf50151d2a..ada2aec88474b7d9bf84ffe053e316d42b357fdf 100644 (file)
@@ -3,7 +3,7 @@
 # Extented report textclass definition file.
 # Herbert Voss <voss@lyx.org>
 
-Format 3
+Format 4
 Input report.layout
 
 # change available fontsizes
index 8f6021fa5d9c6888f47081a653cd4becafbbae61..3362f0784044b41aad0aeeae46e54d4452b8b081 100644 (file)
@@ -6,7 +6,7 @@
 # To do: Define class specific options.
 
 
-Format 3
+Format 4
 Columns                 1
 Sides                   1
 
index c4401c4a18e57c6380e8b4fc82b477441cfc21ea..1317ba7dc67066be37b3b65e849288e4feab2bb5 100644 (file)
@@ -3,7 +3,7 @@
 # Letter textclass definition file.
 # Author : Thomas Hartkens <thomas@hartkens.de>
 
-Format 3
+Format 4
 Input stdfloats.inc
 Input stdcounters.inc
 
index 83ba564dc0cda8afe15ddff590fde00786b53454..64159a6fb7d5bd355022aac9bc4cd41a79c8aa5f 100644 (file)
@@ -3,7 +3,7 @@
 # Letter textclass definition file.
 # Author : Thomas Hartkens <thomas@hartkens.de>
 
-Format 3
+Format 4
 Input stdfloats.inc
 Input stdcounters.inc
 
index 7fa990b4512735507301b03654a37d2983635f51..0b8691a2c2fb555944bcbec9b6352a12ab84118b 100644 (file)
@@ -10,7 +10,7 @@
 
 
 # General textclass parameters
-Format 3
+Format 4
 Columns                        1
 Sides                  1
 PageStyle              Empty
index cde8326519b485e5ac499d560ac6258b8e7d7c65..601cb86c613b3cfc84527f8c07fe9ef5cd9a6e1c 100644 (file)
@@ -4,7 +4,7 @@
 # Author: Dekel Tsur <dekel@math.tau.ac.il>
 # Few changes by Baruch Even <baruch.even@writeme.com>
 
-Format 3
+Format 4
 Input article
 
 Preamble
index 4b7b4fa684877381e46a878d263bb54ab2853abb..945b5d380b37ba6c51f7f470e9fd75ddfb023be4 100644 (file)
@@ -3,7 +3,7 @@
 # Hebrew letter textclass definition file.
 # Author: Dekel Tsur <dekel@math.tau.ac.il>
 
-Format 3
+Format 4
 Input letter
 
 
index 4542b310c476d5a3f516fbb36612f4378bff3eef..1f943cd19dc54636483145a02364bff0f45957df 100644 (file)
@@ -15,7 +15,7 @@
 # Based on course given by Lars Davidson
 
 
-Format 3
+Format 4
 Columns                 1
 Sides                   1
 SecNumDepth             2
index 4c42e6d78ea946e8f70d9e9ead225928d62c90fa..a4e6f7be61890335a966441b950734fc87cbf465 100644 (file)
@@ -9,7 +9,7 @@
 #
 # Version 1  2006-04-09  -  First version, for LyX 1.4.0.
 
-Format 3
+Format 4
 
 Input stdclass.inc
 Input numarticle.inc
index fc6eacb6f0d1f578c26a24e7529a3e309830f6b9..66a34400aba5c518de1c638e442bc36e8c902c47 100644 (file)
@@ -12,7 +12,7 @@
 # Version 3  2006-04-09  -  Updated for LyX 1.4.0; all environments defined by
 #                           ijmpd are now supported by LyX.
 
-Format 3
+Format 4
 
 Input stdclass.inc
 Input numarticle.inc
index 6da39c2241cfdb37b5643f101b0dfa30b79707c8..4267647d9c21c70bdaa9acc3abfe09092f4e06d4 100644 (file)
@@ -8,7 +8,7 @@
 # Heavily modifed and enhanced by serveral developers.
 
 # Input general definitions
-Format 3
+Format 4
 Input stdclass.inc
 Sides                  2
 Columns                        2
index 01baf1b12137ac834c80bb87119c4ca240d8824e..7352dc4360e39a176e9af88a2f38a71544b9997c 100644 (file)
@@ -3,7 +3,7 @@
 # AGUplus JGR textclass definition file.
 # Author: Martin Vermeer <martin.vermeer@hut.fi>
 
-Format 3
+Format 4
 Input aguplus.inc
 
 ClassOptions
index a00dd9d1b35a381cf904840683c4ebde85899004..00870feccf613a9af5f8e3fdff50ff07759cc228 100644 (file)
@@ -14,7 +14,7 @@
 # 2003-03-03  Updated for lyx 1.3.0.
 
 
-Format 3
+Format 4
 Columns                 1
 Sides                   2
 SecNumDepth             4
index 35cf053e433b7fd4178be04fb3e43c30684d3424..320f61ff3b0a8d0996d37364a46e79cd953ca873 100644 (file)
@@ -3,7 +3,7 @@
 # Latex8 textclass definition file.
 # Author : Allan Rae <rae@elec.uq.edu.au>
 
-Format 3
+Format 4
 Preamble
        \usepackage{latex8}
        \usepackage{times}
index 8fd2ca0ede2afad39fc43ea5ed0602458f4a2a0c..e585dc47b77daa0f14abc1c93a53c0e08d4c7947 100644 (file)
@@ -4,7 +4,7 @@
 # Author : Matthias Ettrich <ettrich@informatik.uni-tuebingen.de>
 # Heavily modifed and enhanced by serveral developers.
 
-Format 3
+Format 4
 Input stdletter.inc
 Input stdlists.inc
 Input lyxmacros.inc
index e8312c8c5c78c92c22b3b407432d96e699c27709..ac7d8f92e60a9fc526e55429884928415ac2c2ba 100644 (file)
@@ -3,7 +3,7 @@
 # literate-article textclass definition file.
 # Author : Edmar Wienskoski Jr. <edmar-w-jr@technologist.com>
 
-Format 3
+Format 4
 Preamble
        \usepackage{noweb}
 EndPreamble
index e3c3bb248cd90048eac61f1c9cafcc7b5a68023b..db40f8a8a673265d9802a5bb56323c7507c120e9 100644 (file)
@@ -3,7 +3,7 @@
 # literate-book textclass definition file.
 # Author : Edmar Wienskoski Jr. <edmar-w-jr@technologist.com>
 
-Format 3
+Format 4
 Preamble
        \usepackage{noweb}
 EndPreamble
index d6ca9dcd8d4f0888a580896b67078222441d470d..8a287f58d7bb5c3416754c60e50aa53b2621e348 100644 (file)
@@ -3,7 +3,7 @@
 # literate-report textclass definition file.
 # Author : Edmar Wienskoski Jr. <edmar-w-jr@technologist.com>
 
-Format 3
+Format 4
 Preamble
        \usepackage{noweb}
 EndPreamble
index 3ba3d2e2f62a1654678b4b204c54b18321885cdd..1515cf4a52c5ea74b49b2cf6d1fbeb12edd66e23 100644 (file)
@@ -6,7 +6,7 @@
 #                   resembles more closely the produced paper doc (more WYSIWYG)
 #
 
-Format 3
+Format 4
 OutputType              literate
 
 Style Scrap
index 1616ce8b81acb40725adfb9943377b5be55fb417..ac438070af1f7d80dfd8d9c7a2ecd8c593bbff12 100644 (file)
@@ -14,7 +14,7 @@
 # Modified for LyX 12 by Jean-Marc Lasgouttes and MV.
 
 
-Format 3
+Format 4
 Columns                 1
 Sides                   1
 PageStyle               Plain
index 83ba65117f3f6f9606dbd2ec6ae96b20f5bc787f..74b634bb79c2fb0a21bf4cc2bb44d00f81de46bd 100644 (file)
@@ -5,7 +5,7 @@
 # Author : Herbert Voss <voss@perce.de> 2001/08/13
 
 
-Format 3
+Format 4
 Columns                 2
 Sides                   2
 #SecNumDepth                            # no counting
index 5f3587eb6422e3096dbfe84f771c6f24ddac7139..9cc144c25c5071dab8757b4c8c3ead1805da9ee3 100644 (file)
@@ -8,7 +8,7 @@
 # be removed later.
 
 
-Format 3
+Format 4
 Style LyX-Code
        Margin                Static
        LatexType             Environment
index d9352e643bdb4cd69ace10e497819dbbd1737a85..8b2650b6b337de643238722c5bd4a4dc7af01778 100644 (file)
@@ -4,7 +4,7 @@
 # Author : José Matos <jamatos@novalis.fc.up.pt>
 
 
-Format 3
+Format 4
 Columns                 1
 Sides                   1
 PageStyle               Plain
index 1dc5f1841a1131c34291ba516f621186a57a093f..53242ffdabdc23a35dcb222bb6b6ef8836753b67 100644 (file)
@@ -6,14 +6,14 @@
 # feel free to contribute missing features!
 
 
-Format 3
+Format 4
 Columns            1
 Sides              2
 SecNumDepth        2
 TocDepth           2
 DefaultStyle       Standard
 PageStyle          Headings
-ProvidesMakeidx    1
+Provides makeidx    1
 
 
 ClassOptions
index 1d4ff1e2ac92cc29338958ebaae3137369fd06c9..79ec97d3f0b50a7744061b924230dce1fc871ae2 100644 (file)
@@ -5,7 +5,7 @@
 
 
 # General textclass parameters
-       Format 3
+Format 4
        Columns                 1
        Sides                   1
        SecNumDepth             -1
index 05f097d7c0c41317932cc22bb531413553f4ea85..6fc7c881ebe7a34efb8526eb818170a0f3a84383 100644 (file)
@@ -5,7 +5,7 @@
 # Transposed by Tomasz Â£uczak <tlu@technodat.com.pl>
 # Heavily modifed and enhanced by several developers.
 
-Format 3
+Format 4
 Input stdclass.inc
 
 NoStyle Chapter
index 54b14b6be44065819017e8910a5f7d215c571a91..3248770291f0e6f6bd70792ebcbb72567dd50fac 100644 (file)
@@ -5,7 +5,7 @@
 # Transposed by Tomasz Â£uczak <tlu@technodat.com.pl>
 # Heavily modifed and enhanced by serveral developers.
 
-Format 3
+Format 4
 Input stdclass.inc
 
 Sides                   2
index 7a1f6881c5ac3f3e8d8d0c002aad458118c631b4..29e8cc0dbcb53e7043ee86adbc6e63c200ec543b 100644 (file)
@@ -5,7 +5,7 @@
 # Transposed by Tomasz Â£uczak <tlu@technodat.com.pl>
 # Heavily modifed and enhanced by serveral developers.
 
-Format 3
+Format 4
 Input stdclass.inc
 
 
index be496d22513cd50cc67e565e890fb56668e9ce0e..482b41bbb7a9d7f1620a60156179f2d4b7fd8bea 100644 (file)
@@ -1,7 +1,7 @@
 # Author : André Pönitz
 # This include file contains label definitions for an article-like numbering.
 
-Format 3
+Format 4
 Style Part
        LabelType             Counter
        LabelCounter          part
index c793ab485ddf8765fa1c8462b61ac0fa1e8969a6..f44d83040a4874188a1068bc5e14c74593b6d02f 100644 (file)
@@ -1,7 +1,7 @@
 # Author : André Pönitz
 # This include file contains label definitions for a report-like numbering.
 
-Format 3
+Format 4
 Input numarticle.inc
 
 Style Part
index 9fb2dfc915acd401ccf3d98c3b5917b830871cde..673c672ca4dc1051691181a8d5708180a7ae7c93 100644 (file)
@@ -2,7 +2,7 @@
 # This include files contains label definitions for a article-like numbering.
 
 
-Format 3
+Format 4
 Style Section
        LabelType             Counter
        LabelCounter          section
index 8b09751733140577cbc0d8a97115894702f88933..523788771a4847b3d915dbe1f6e6f0f62e0d8129 100644 (file)
@@ -4,7 +4,7 @@
 # Created by Jean-Marc Lasgouttes (Jean-Marc.Lasgouttes@inria.fr)
 
 
-Format 3
+Format 4
 Columns                 1
 Sides                   1
 SecNumDepth             3
index c7a069565d37d807c37063a27e529e3ee0fce2ac..687f962a714e0b39505a4c8bb1b4ffc2c340ac4a 100644 (file)
@@ -5,7 +5,7 @@
 # Transposed by Pascal André <andre@via.ecp.fr>
 # Heavily modifed and enhanced by serveral developers.
 
-Format 3
+Format 4
 Input stdclass.inc
 Input numreport.inc
 
index c149be9082533c43c3db3792f2dd6baf0055c31f..6280076dd8f0d8f2e7965afa831ba8fe22567011 100644 (file)
@@ -9,7 +9,7 @@
 #          Amir Karger (LyX v11.34 style modifications - using changes
 #                       made by Jean-Marc Lasgouttes to amsart.layout)
 
-Format 3
+Format 4
 Columns                 1
 Sides                   1
 PageStyle               Headers
index 38224dcc0aeb11d012e8be3d7bfe8fd48b70152f..82640a8741bdaa38428f3e37214a16a718dcb978 100644 (file)
 #          Amir Karger (RevTeX 4 beta) 9/1999, 7/2000
 
 
-Format 3
+Format 4
 Columns                 1
 Sides                   1
 PageStyle               Headers
-ProvidesNatbib         1
-ProvidesUrl            1
+Provides natbib                1
+Provides url           1
 
 # Default textclass options. The user may need to modify this.
 ClassOptions
index d80716fbbc18d37b7be9699f902d0619a0807257..ba0f0afa7aac9117e4c09a0e597af474a3f7f350 100644 (file)
@@ -3,7 +3,7 @@
 # KOMA scrartcl textclass definition file.
 # Bernd Rellermeyer <100.41728@germanynet.de>, 1998/7/11.
 
-Format 3
+Format 4
 Input scrclass.inc
 
 SecNumDepth             3
index 9d599db388c434346bf7e67986ae4121b3f377e6..b8149fee3642df1ff020762e9f6a2fcf8ebb1e90 100644 (file)
@@ -3,7 +3,7 @@
 # KOMA scrbook textclass definition file.
 # Bernd Rellermeyer <100.41728@germanynet.de>, 1998/7/11.
 
-Format 3
+Format 4
 Input scrclass.inc
 Input numreport.inc
 
index 5cd1a71e765399e555137c4038dc8b392e9d1a4c..34b54f09952b163454a3bdbc550bcb1129710b64 100644 (file)
@@ -7,7 +7,7 @@
 # Guenter Milde <g.milde web.de>
 
 
-Format 3
+Format 4
 SecNumDepth             2
 TocDepth                2
 DefaultStyle            Standard
index 94d62c088026a5931c79287557c97cb547b6f855..3359fefbca76ef3148cfca2979bc1c9b05ddfb6a 100644 (file)
@@ -3,7 +3,7 @@
 # KOMA scrlettr textclass definition file.
 # Bernd Rellermeyer <100.41728@germanynet.de>, 1999/2/17.
 
-Format 3
+Format 4
 Style Standard
        LatexName             dummy
        ParSep                0.4
index fe6c08575adc757ff8b3b3f549043755b49ca73f..923441488e1e359ce61ab9a98e6f66cbd36c8f86 100644 (file)
@@ -3,7 +3,7 @@
 # KOMA scrlettr2 textclass definition file.
 # Juergen Spitzmueller <j.spitzmueller@gmx.de>, 2003/2/17.
 
-Format 3
+Format 4
 Style Standard
        LatexName             dummy
        ParSep                0.4
index 8466d1cecb97eaf9bf1d656133bab5ac003e1af1..dbe4aa71cb9422b4790629c89acf58c74bc56741 100644 (file)
@@ -3,7 +3,7 @@
 # KOMA scrreprt textclass definition file.
 # Bernd Rellermeyer <100.41728@germanynet.de>, 1998/7/11.
 
-Format 3
+Format 4
 Input scrclass.inc
 Input numreport.inc
 
index 4741f379753d5853ae73aaf5f2de6495224535e8..1f7088215e405de74c46db0e954c5da30b543737 100644 (file)
@@ -3,7 +3,7 @@
 # Initial attemt at makeing a LyX layout file for the seminar class.
 # Author : Lars Gullik Bjønnes <larsbj@lyx.org>
 
-Format 3
+Format 4
 Input stdclass.inc
 
 NoStyle Chapter
index e21819fe1ce7e75f97c22bb70847cf72d3a88f36..ea163c841943aa949fd0e5d24080e30521552a5c 100644 (file)
@@ -4,7 +4,7 @@
 # Cut & paste from various LyX layouts plus some minor modifications
 # Author : Kornelia Pietsch <pietsch@mathematik.tu-chemnitz.de>
 
-Format 3
+Format 4
 Columns                 1
 Sides                   1
 SecNumDepth             2
index 03198eb9995347e4a691c66e21db4282d0140e0d..dfe05daaed68a1bb3036f8e5a7946bac43827a9a 100644 (file)
@@ -7,7 +7,7 @@
 #
 
 
-Format 3
+Format 4
 Columns        1
 Sides          1
 PageStyle      Plain
index 05cd77ee667147ac836c3e82fe149c88536e1199..2192b93fe90049f0b5203381ae551785d89157ea 100644 (file)
@@ -5,7 +5,7 @@
 # to be used with the spie.cls LaTex-style available at
 # http://public.lanl.gov/kmh/spie/
 
-Format 3
+Format 4
 Input stdclass.inc
 
 NoStyle Chapter
index da85a06ac6f13a43748ff2cce415b73bddd1ebd1..6264ce87ebb9faeabf42078d1dff8066a23316d5 100644 (file)
@@ -7,7 +7,7 @@
 # ``standard'' layouts, like article and friends.
 
 
-Format 3
+Format 4
 Columns                 1
 Sides                   1
 SecNumDepth             2
index 118e6627f187eb7fc2f731f1d96803c87728ad32..f5a41ca8a45a03ecd9514a9a47addb4a2918a42c 100644 (file)
@@ -4,7 +4,7 @@
 # in most LyX layouts.
 
 
-Format 3
+Format 4
 Counter
        Name                 part
 End
index eb3159dd1c29af52ea97673c63d0bfdd3b3dd979..fd36b2f24af713e5357a554d39a48de4a1022585 100644 (file)
@@ -4,7 +4,7 @@
 # in most LyX layouts.
 
 
-Format 3
+Format 4
 Float
        Type                  table
        GuiName               Table
index 4ec18418460deae18db25815500223c15bbcf6fd..dbc01612c635b373b43e38d014e6e27dc9abd11b 100644 (file)
@@ -7,7 +7,7 @@
 # quotations and such.
 
 
-Format 3
+Format 4
 Style Quotation
        Margin                Static
        LatexType             Environment
index a190ac4b8390f0a78af99f2dde05f5f1a0a52985..3ab3603a09591b40f9dc1268d51144f02f4a5ab2 100644 (file)
@@ -3,7 +3,7 @@
 # Heavily modifed and enhanced by several developers.
 
 
-Format 3
+Format 4
 Columns                 1
 Sides                   1
 PageStyle               Empty
index d79fc5de28702d1550e0b913b15f3341728ce2b3..702b996195738a4d2cab82387a7d1363fbfe803f 100644 (file)
@@ -7,7 +7,7 @@
 # This include files contains various standard environments for lists.
 
 
-Format 3
+Format 4
 Style Itemize
        Margin                Static
        LatexType             Item_Environment
index 70e5b514a6dd6648553de295cd81cd718423dbe2..165ebbed454440c4abd16f442a83927724da7d1e 100644 (file)
@@ -7,7 +7,7 @@
 # commands that are useful for article-like document classes, but not
 # for letters.
 
-Format 3
+Format 4
 Style Part
        Margin                Dynamic
        LatexType             Command
index a4a331ee03d635514674dfc67f4ea2b97e03af0c..481f5a47faac0c9998a60a6d9df1b31782a0461f 100644 (file)
@@ -9,7 +9,7 @@
 # modifying the style of the regular sectioning layouts.
 
 
-Format 3
+Format 4
 Style Part*
        CopyStyle             Part
        Margin                Static
index 9e87cc27004496159d81c0a58209567d5dc0947d..8929af6637cc9838b2d13d5a5666683194cc91cd 100644 (file)
@@ -8,7 +8,7 @@
 # a document, like abstract, bibliography and such.
 
 
-Format 3
+Format 4
 Style Abstract
        Margin                Static
        LatexType             Environment
index df73afcb12977404c724634cff18bce9146eeed8..514c18e0f6ece456cde4b8eb13ec2be0c89ff5f2 100644 (file)
@@ -8,7 +8,7 @@
 # a document, like title, author and such.
 
 
-Format 3
+Format 4
 Style Title
        Margin                Static
        LatexType             Command
index 3b43316e98115147a200a32e076cc5115ab38b52..275910687b7a5601f904b14d0b9f3d7e2b919d05 100644 (file)
@@ -18,7 +18,7 @@
 # see www.springer.de/author/tex/help-journals.html for class files
 #
 # The standard Springer Journal sections
-Format 3
+Format 4
 Input svjour.inc
 
 ClassOptions
index 9540e323344e76b0aac9bef2601b515d8a1185ff..ecb664336334022533771d3c30468345a5afc05a 100644 (file)
@@ -22,7 +22,7 @@
 # see www.springer.de/author/tex/help-journals.html for class files
 
 
-Format 3
+Format 4
 Input svjour.inc
 
 
index 8927e1b23b0def8adca6a51675ae9eb90fe56179..0d8439d27ade6606c298d9c8c6cdadb27d6f25ae 100644 (file)
@@ -18,7 +18,7 @@
 # see www.springer.de/author/tex/help-journals.html for class files
 
 
-Format 3
+Format 4
 Columns                 2
 Sides                   1
 PageStyle               Plain
index 750ee132866359b1964fb546156dc3eb2a2887a4..d336b8855f13704186f38fb0583ce928676c4661 100644 (file)
@@ -24,7 +24,7 @@
 # see www.springer.de/author/tex/help-journals.html for class files
 
 
-Format 3
+Format 4
 Input svjour.inc
 
 ClassOptions
index 80fe6906e77d66b9d2c3b095339d0f3f48a6ea3b..97c7066162a28878675c4bf4e2a9ad893e2bb75e 100644 (file)
@@ -79,6 +79,7 @@ def convert(lines):
     re_CopyStyle = re.compile(r'^(\s*)(CopyStyle)(\s+)(\S+)', re.IGNORECASE)
     re_NoStyle = re.compile(r'^(\s*)(NoStyle)(\s+)(\S+)', re.IGNORECASE)
     re_End = re.compile(r'^(\s*)(End)(\s*)$', re.IGNORECASE)
+    re_Provides = re.compile(r'^(\s*)Provides(\S+)(\s+)(\S+)', re.IGNORECASE)
 
     # counters for sectioning styles (hardcoded in 1.3)
     counters = {"part"          : "\\Roman{part}",
@@ -133,10 +134,10 @@ def convert(lines):
                 match = re_Format.match(lines[i])
                 if match:
                         format = int(match.group(4))
-                        if format == 2:
-                            lines[i] = "Format 3"
+                        if format > 1 and format < 4:
+                            lines[i] = "Format %d" % (format + 1)
                             only_comment = 0
-                        elif format == 3:
+                        elif format == 4:
                                 # nothing to do
                                 return format
                         else:
@@ -153,6 +154,17 @@ def convert(lines):
                 i = i + 1
             continue
 
+        if format == 3:
+            # convert 'providesamsmath x',  'providesmakeidx x',  'providesnatbib x',  'providesurl x' to
+            #         'provides amsmath x', 'provides makeidx x', 'provides natbib x', 'provides url x'
+            # x is either 0 or 1
+            match = re_Provides.match(lines[i])
+            if match:
+                lines[i] = "%sProvides %s%s%s" % (match.group(1), match.group(2).lower(),
+                                                  match.group(3), match.group(4))
+            i = i + 1
+            continue
+
         if format == 2:
             caption = []
 
@@ -370,7 +382,7 @@ def main(argv):
     # Do the real work
     lines = read(input)
     format = 1
-    while (format < 3):
+    while (format < 4):
         format = convert(lines)
     write(output, lines)
 
index 42e2a00756f4bb15c4c784e2aa081835e27e1ee8..185ac193a44d0a70522283f61b45096ef48fc26d 100644 (file)
@@ -153,6 +153,12 @@ bool LaTeXFeatures::isRequired(string const & name) const
 }
 
 
+bool LaTeXFeatures::mustProvide(string const & name) const
+{
+       return isRequired(name) && !params_.getLyXTextClass().provides(name);
+}
+
+
 bool LaTeXFeatures::isAvailable(string const & name)
 {
        if (packages_.empty())
@@ -268,7 +274,7 @@ string const LaTeXFeatures::getPackages() const
        //  packages which we just \usepackage{package}
        //
        for (int i = 0; i < nb_simplefeatures; ++i) {
-               if (isRequired(simplefeatures[i]))
+               if (mustProvide(simplefeatures[i]))
                        packages << "\\usepackage{"
                                 << simplefeatures[i] << "}\n";
        }
@@ -278,8 +284,7 @@ string const LaTeXFeatures::getPackages() const
        // than those above.
        //
 
-       if (isRequired("amsmath")
-           && !tclass.provides(LyXTextClass::amsmath)
+       if (mustProvide("amsmath")
            && params_.use_amsmath != BufferParams::package_off) {
                packages << "\\usepackage{amsmath}\n";
        }
@@ -291,12 +296,12 @@ string const LaTeXFeatures::getPackages() const
        // esint is used, since esint redefines all relevant integral
        // symbols from wasysym and amsmath.
        // See http://bugzilla.lyx.org/show_bug.cgi?id=1942
-       if (isRequired("wasysym") && isRequired("esint") &&
+       if (mustProvide("wasysym") && isRequired("esint") &&
            params_.use_esint != BufferParams::package_off)
                packages << "\\usepackage{wasysym}\n";
 
        // color.sty
-       if (isRequired("color")) {
+       if (mustProvide("color")) {
                if (params_.graphicsDriver == "default")
                        packages << "\\usepackage{color}\n";
                else
@@ -307,13 +312,13 @@ string const LaTeXFeatures::getPackages() const
 
        // makeidx.sty
        if (isRequired("makeidx")) {
-               if (!tclass.provides(LyXTextClass::makeidx))
+               if (!tclass.provides("makeidx"))
                        packages << "\\usepackage{makeidx}\n";
                packages << "\\makeindex\n";
        }
 
        // graphicx.sty
-       if (isRequired("graphicx") && params_.graphicsDriver != "none") {
+       if (mustProvide("graphicx") && params_.graphicsDriver != "none") {
                if (params_.graphicsDriver == "default")
                        packages << "\\usepackage{graphicx}\n";
                else
@@ -322,18 +327,14 @@ string const LaTeXFeatures::getPackages() const
                                 << "]{graphicx}\n";
        }
        // shadecolor for shaded
-       if (isRequired("framed")) {
+       if (mustProvide("framed")) {
                RGBColor c = RGBColor(lcolor.getX11Name(LColor::shadedbg));
                packages << "\\definecolor{shadecolor}{rgb}{" 
                        << c.r/255 << ',' << c.g/255 << ',' << c.b/255 << "}\n";
        }
 
-       //if (algorithm) {
-       //      packages << "\\usepackage{algorithm}\n";
-       //}
-
        // lyxskak.sty --- newer chess support based on skak.sty
-       if (isRequired("chess")) {
+       if (mustProvide("chess")) {
                packages << "\\usepackage[ps,mover]{lyxskak}\n";
        }
 
@@ -362,22 +363,23 @@ string const LaTeXFeatures::getPackages() const
        }
 
        // amssymb.sty
-       if (isRequired("amssymb") || params_.use_amsmath == BufferParams::package_on)
+       if (mustProvide("amssymb") 
+           || params_.use_amsmath == BufferParams::package_on)
                packages << "\\usepackage{amssymb}\n";
 
        // esint must be after amsmath and wasysym, since it will redeclare
        // inconsistent integral symbols
-       if (isRequired("esint") && params_.use_esint != BufferParams::package_off)
+       if (mustProvide("esint") 
+           && params_.use_esint != BufferParams::package_off)
                packages << "\\usepackage{esint}\n";
 
        // url.sty
-       if (isRequired("url") && ! tclass.provides(LyXTextClass::url))
+       if (mustProvide("url"))
                packages << "\\IfFileExists{url.sty}{\\usepackage{url}}\n"
                            "                      {\\newcommand{\\url}{\\texttt}}\n";
 
-       // float.sty
        // natbib.sty
-       if (isRequired("natbib") && ! tclass.provides(LyXTextClass::natbib)) {
+       if (mustProvide("natbib")) {
                packages << "\\usepackage[";
                if (params_.getEngine() == biblio::ENGINE_NATBIB_NUMERICAL) {
                        packages << "numbers";
@@ -388,20 +390,20 @@ string const LaTeXFeatures::getPackages() const
        }
 
        // jurabib -- we need version 0.6 at least.
-       if (isRequired("jurabib")) {
+       if (mustProvide("jurabib")) {
                packages << "\\usepackage{jurabib}[2004/01/25]\n";
        }
 
        // bibtopic -- the dot provides the aux file naming which
        // LyX can detect.
-       if (isRequired("bibtopic")) {
+       if (mustProvide("bibtopic")) {
                packages << "\\usepackage[dot]{bibtopic}\n";
        }
 
-       if (isRequired("xy"))
+       if (mustProvide("xy"))
                packages << "\\usepackage[all]{xy}\n";
 
-       if (isRequired("nomencl")) {
+       if (mustProvide("nomencl")) {
                packages << "\\usepackage{nomencl}[2005/09/22]\n"
                         << "\\makenomenclature\n";
        }
@@ -422,55 +424,55 @@ string const LaTeXFeatures::getMacros() const
                macros << *pit << '\n';
        }
 
-       if (isRequired("LyX"))
+       if (mustProvide("LyX"))
                macros << lyx_def << '\n';
 
-       if (isRequired("lyxline"))
+       if (mustProvide("lyxline"))
                macros << lyxline_def << '\n';
 
-       if (isRequired("noun"))
+       if (mustProvide("noun"))
                macros << noun_def << '\n';
 
-       if (isRequired("lyxarrow"))
+       if (mustProvide("lyxarrow"))
                macros << lyxarrow_def << '\n';
 
        // quotes.
-       if (isRequired("quotesinglbase"))
+       if (mustProvide("quotesinglbase"))
                macros << quotesinglbase_def << '\n';
-       if (isRequired("quotedblbase"))
+       if (mustProvide("quotedblbase"))
                macros << quotedblbase_def << '\n';
-       if (isRequired("guilsinglleft"))
+       if (mustProvide("guilsinglleft"))
                macros << guilsinglleft_def << '\n';
-       if (isRequired("guilsinglright"))
+       if (mustProvide("guilsinglright"))
                macros << guilsinglright_def << '\n';
-       if (isRequired("guillemotleft"))
+       if (mustProvide("guillemotleft"))
                macros << guillemotleft_def << '\n';
-       if (isRequired("guillemotright"))
+       if (mustProvide("guillemotright"))
                macros << guillemotright_def << '\n';
 
        // Math mode
-       if (isRequired("boldsymbol") && !isRequired("amsmath"))
+       if (mustProvide("boldsymbol") && !isRequired("amsmath"))
                macros << boldsymbol_def << '\n';
-       if (isRequired("binom") && !isRequired("amsmath"))
+       if (mustProvide("binom") && !isRequired("amsmath"))
                macros << binom_def << '\n';
-       if (isRequired("mathcircumflex"))
+       if (mustProvide("mathcircumflex"))
                macros << mathcircumflex_def << '\n';
 
        // other
-       if (isRequired("ParagraphLeftIndent"))
+       if (mustProvide("ParagraphLeftIndent"))
                macros << paragraphleftindent_def;
-       if (isRequired("NeedLyXFootnoteCode"))
+       if (mustProvide("NeedLyXFootnoteCode"))
                macros << floatingfootnote_def;
 
        // some problems with tex->html converters
-       if (isRequired("NeedTabularnewline"))
+       if (mustProvide("NeedTabularnewline"))
                macros << tabularnewline_def;
 
        // greyedout environment (note inset)
-       if (isRequired("lyxgreyedout"))
+       if (mustProvide("lyxgreyedout"))
                macros << lyxgreyedout_def;
 
-       if (isRequired("lyxdot"))
+       if (mustProvide("lyxdot"))
                macros << lyxdot_def << '\n';
 
        // floats
@@ -526,7 +528,7 @@ docstring const LaTeXFeatures::getLyXSGMLEntities() const
        // Definition of entities used in the document that are LyX related.
        odocstringstream entities;
 
-       if (isRequired("lyxarrow")) {
+       if (mustProvide("lyxarrow")) {
                entities << "<!ENTITY lyxarrow \"-&gt;\">" << '\n';
        }
 
index f18cdd480013c02be9b3173252b65c3b0f1f1870..9de20f3c8a3458a1edb3ea394b07878780295795 100644 (file)
@@ -73,8 +73,13 @@ public:
        static void getAvailable();
        /// Is the (required) package available?
        static bool isAvailable(std::string const & name);
-       /// Is the package required?
+       /// Has the package been required?
        bool isRequired(std::string const & name) const;
+       /* Is it necessary to load the package? This is true is
+          isRequired is true and the feature is not provided by the
+          textclass.
+       */
+       bool mustProvide(std::string const & name) const;
        ///
        void useFloat(std::string const & name);
        ///
index 85b52337a1eb97016f04af5df6ce48cfe9bf26c6..8db2d6f02deefa360017bfd1626219cc9679d3e9 100644 (file)
@@ -1183,7 +1183,7 @@ void Buffer::validate(LaTeXFeatures & features) const
 
        // AMS Style is at document level
        if (params().use_amsmath == BufferParams::package_on
-           || tclass.provides(LyXTextClass::amsmath))
+           || tclass.provides("amsmath"))
                features.require("amsmath");
        if (params().use_esint == BufferParams::package_on)
                features.require("esint");
index 253768affe9a6a4e1f0a4f876c1e24b73937bbc5..2bdcf37fb4faaf696a988cb4fdc08029c97a5c4d 100644 (file)
@@ -1487,7 +1487,7 @@ biblio::CiteEngine BufferParams::getEngine() const
 {
        // FIXME the class should provide the numerical/
        // authoryear choice
-       if (getLyXTextClass().provides(LyXTextClass::natbib)
+       if (getLyXTextClass().provides("natbib")
            && cite_engine_ != biblio::ENGINE_NATBIB_NUMERICAL)
                return biblio::ENGINE_NATBIB_AUTHORYEAR;
        return cite_engine_;
index 1ffe22de246a5c91107f7b385a09536261442da9..52ec9fdce849e06b9bf577893b6354a7a841722c 100644 (file)
@@ -65,7 +65,7 @@ private:
 };
 
 
-int const FORMAT = 3;
+int const FORMAT = 4;
 
 
 bool layout2layout(FileName const & filename, FileName const & tempfile)
@@ -113,7 +113,6 @@ LyXTextClass::LyXTextClass(string const & fn, string const & cln,
        defaultfont_ = LyXFont(LyXFont::ALL_SANE);
        opt_fontsize_ = "10|11|12";
        opt_pagestyle_ = "empty|plain|headings|fancy";
-       provides_ = nothing;
        titletype_ = TITLE_COMMAND_AFTER;
        titlename_ = "maketitle";
        loaded_ = false;
@@ -158,10 +157,7 @@ enum TextClassTags {
        TC_TOCDEPTH,
        TC_CLASSOPTIONS,
        TC_PREAMBLE,
-       TC_PROVIDESAMSMATH,
-       TC_PROVIDESNATBIB,
-       TC_PROVIDESMAKEIDX,
-       TC_PROVIDESURL,
+       TC_PROVIDES,
        TC_LEFTMARGIN,
        TC_RIGHTMARGIN,
        TC_FLOAT,
@@ -199,10 +195,7 @@ bool LyXTextClass::read(FileName const & filename, bool merge)
                { "outputtype",      TC_OUTPUTTYPE },
                { "pagestyle",       TC_PAGESTYLE },
                { "preamble",        TC_PREAMBLE },
-               { "providesamsmath", TC_PROVIDESAMSMATH },
-               { "providesmakeidx", TC_PROVIDESMAKEIDX },
-               { "providesnatbib",  TC_PROVIDESNATBIB },
-               { "providesurl",     TC_PROVIDESURL },
+               { "provides",        TC_PROVIDES },
                { "rightmargin",     TC_RIGHTMARGIN },
                { "secnumdepth",     TC_SECNUMDEPTH },
                { "sides",           TC_SIDES },
@@ -383,25 +376,16 @@ bool LyXTextClass::read(FileName const & filename, bool merge)
                        preamble_ = from_utf8(lexrc.getLongString("EndPreamble"));
                        break;
 
-               case TC_PROVIDESAMSMATH:
-                       if (lexrc.next() && lexrc.getInteger())
-                               provides_ |= amsmath;
-                       break;
-
-               case TC_PROVIDESNATBIB:
-                       if (lexrc.next() && lexrc.getInteger())
-                               provides_ |= natbib;
-                       break;
-
-               case TC_PROVIDESMAKEIDX:
-                       if (lexrc.next() && lexrc.getInteger())
-                               provides_ |= makeidx;
-                       break;
-
-               case TC_PROVIDESURL:
-                       if (lexrc.next() && lexrc.getInteger())
-                               provides_ |= url;
+               case TC_PROVIDES: {
+                       lexrc.next();
+                       string const feature = lexrc.getString();
+                       lexrc.next();
+                       if (lexrc.getInteger())
+                               provides_.insert(feature);
+                       else
+                               provides_.erase(feature);
                        break;
+               }
 
                case TC_LEFTMARGIN:     // left margin type
                        if (lexrc.next())
@@ -1067,9 +1051,9 @@ OutputType LyXTextClass::outputType() const
 }
 
 
-bool LyXTextClass::provides(LyXTextClass::Provides p) const
+bool LyXTextClass::provides(string const & p) const
 {
-       return provides_ & p;
+       return provides_.find(p) != provides_.end();
 }
 
 
index c2e36f3ea4a08bf6c0ca6fbf5d985a82e5468c77..2936b13d24fc436526b2aacdf1f0d6f6f6fba77a 100644 (file)
@@ -16,7 +16,7 @@
 #include <boost/shared_ptr.hpp>
 
 #include <vector>
-
+#include <set>
 
 namespace lyx {
 
@@ -126,21 +126,8 @@ public:
        ///
        docstring const & preamble() const;
 
-       /// Packages that are already loaded by the class
-       enum Provides {
-               ///
-               nothing = 0,
-               ///
-               amsmath = 1,
-               ///
-               makeidx = 2,
-               ///
-               url = 4,
-               ///
-               natbib = 8
-       };
-       ///
-       bool provides(Provides p) const;
+       /// is this feature already provided by the class?
+       bool provides(std::string const & p) const;
 
        ///
        unsigned int columns() const;
@@ -209,7 +196,7 @@ private:
        /// preamble text to support layout styles
        docstring preamble_;
        /// latex packages loaded by document class.
-       Provides provides_;
+       std::set<std::string> provides_;
        ///
        unsigned int columns_;
        ///
@@ -261,14 +248,6 @@ private:
 };
 
 
-/// Merge two different provides flags into one bit field record
-inline
-void operator|=(LyXTextClass::Provides & p1, LyXTextClass::Provides p2)
-{
-       p1 = static_cast<LyXTextClass::Provides>(p1 | p2);
-}
-
-
 /// convert page sides option to text 1 or 2
 std::ostream & operator<<(std::ostream & os, LyXTextClass::PageSides p);