From 9e5eebc14cd06f58000a4bd1903f157b65a3ab19 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrgen=20Spitzm=C3=BCller?= Date: Mon, 7 Jan 2008 16:59:10 +0000 Subject: [PATCH] *** Requires tag for classes, layouts and custom insets *** * src/TextClass{cpp,h}: - implement Requires tag for class and InsetLayout. * src/Layout.{cpp,h}: - implement Requires tag for layouts. - increase layouts format to 6. * src/Paragraph.cpp: - request required features for paragraph layouts. * src/LaTeXFeatures.cpp: - add some packages needed by modules. - remove Preamble method for InsetLayout. This is now done in InsetFlex::validate. * src/BufferParams.cpp (validate): - request required features for the class. * src/insets/InsetLayout.h: - new member "requires". * src/insets/InsetFlex.{cpp,h}: - implement validate method and request required features and preamble snippets. * lib/layouts/*.{layout,module,inc}: - increase layouts format to 6. - use Requires tags in some modules (more can be done later). * lib/doc/Customization.lyx: - document Requires tag. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22414 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/doc/Customization.lyx | 98 ++++++++++++++++++++++- lib/layouts/IEEEtran.layout | 2 +- lib/layouts/aa.layout | 2 +- lib/layouts/aapaper.inc | 2 +- lib/layouts/aapaper.layout | 2 +- lib/layouts/aastex.layout | 2 +- lib/layouts/agu-dtd.layout | 2 +- lib/layouts/agu_stdclass.inc | 2 +- lib/layouts/agu_stdcounters.inc | 2 +- lib/layouts/agu_stdlists.inc | 2 +- lib/layouts/agu_stdsections.inc | 2 +- lib/layouts/agu_stdtitle.inc | 2 +- lib/layouts/agums.layout | 2 +- lib/layouts/aguplus.inc | 2 +- lib/layouts/amsart-plain.layout | 2 +- lib/layouts/amsart-seq.layout | 2 +- lib/layouts/amsart.layout | 2 +- lib/layouts/amsbook.layout | 2 +- lib/layouts/amsdefs.inc | 2 +- lib/layouts/amsmaths-plain.inc | 2 +- lib/layouts/amsmaths-seq.inc | 2 +- lib/layouts/amsmaths.inc | 2 +- lib/layouts/apa.layout | 2 +- lib/layouts/arab-article.layout | 2 +- lib/layouts/armenian-article.layout | 2 +- lib/layouts/article.layout | 2 +- lib/layouts/beamer.layout | 2 +- lib/layouts/book.layout | 2 +- lib/layouts/braille.module | 2 +- lib/layouts/broadway.layout | 2 +- lib/layouts/chess.layout | 2 +- lib/layouts/cl2emult.layout | 2 +- lib/layouts/db_lyxmacros.inc | 2 +- lib/layouts/db_stdcharstyles.inc | 2 +- lib/layouts/db_stdclass.inc | 2 +- lib/layouts/db_stdcounters.inc | 2 +- lib/layouts/db_stdlayouts.inc | 2 +- lib/layouts/db_stdlists.inc | 2 +- lib/layouts/db_stdsections.inc | 2 +- lib/layouts/db_stdstarsections.inc | 2 +- lib/layouts/db_stdstruct.inc | 2 +- lib/layouts/db_stdtitle.inc | 2 +- lib/layouts/dinbrief.layout | 2 +- lib/layouts/docbook-book.layout | 2 +- lib/layouts/docbook-chapter.layout | 2 +- lib/layouts/docbook-section.layout | 2 +- lib/layouts/docbook.layout | 2 +- lib/layouts/dtk.layout | 2 +- lib/layouts/egs.layout | 2 +- lib/layouts/elsart.layout | 2 +- lib/layouts/endnotes.module | 8 +- lib/layouts/entcs.layout | 2 +- lib/layouts/europecv.layout | 2 +- lib/layouts/extarticle.layout | 2 +- lib/layouts/extbook.layout | 2 +- lib/layouts/extletter.layout | 2 +- lib/layouts/extreport.layout | 2 +- lib/layouts/foils.layout | 2 +- lib/layouts/foottoend.module | 7 +- lib/layouts/g-brief-de.layout | 2 +- lib/layouts/g-brief-en.layout | 2 +- lib/layouts/g-brief2.layout | 2 +- lib/layouts/hanging.module | 2 +- lib/layouts/heb-article.layout | 2 +- lib/layouts/heb-letter.layout | 2 +- lib/layouts/hollywood.layout | 2 +- lib/layouts/ijmpc.layout | 2 +- lib/layouts/ijmpd.layout | 2 +- lib/layouts/iopart.layout | 2 +- lib/layouts/isprs.layout | 2 +- lib/layouts/jgrga.layout | 2 +- lib/layouts/kluwer.layout | 2 +- lib/layouts/latex8.layout | 2 +- lib/layouts/letter.layout | 2 +- lib/layouts/linguistics.module | 17 ++-- lib/layouts/literate-article.layout | 2 +- lib/layouts/literate-book.layout | 2 +- lib/layouts/literate-report.layout | 2 +- lib/layouts/literate-scrap.inc | 2 +- lib/layouts/llncs.layout | 2 +- lib/layouts/logicalmkup.module | 6 +- lib/layouts/ltugboat.layout | 2 +- lib/layouts/lyxmacros.inc | 2 +- lib/layouts/manpage.layout | 2 +- lib/layouts/memoir.layout | 2 +- lib/layouts/moderncv.layout | 2 +- lib/layouts/mwart.layout | 2 +- lib/layouts/mwbk.layout | 2 +- lib/layouts/mwrep.layout | 2 +- lib/layouts/numarticle.inc | 2 +- lib/layouts/numreport.inc | 2 +- lib/layouts/numrevtex.inc | 2 +- lib/layouts/paper.layout | 2 +- lib/layouts/powerdot.layout | 2 +- lib/layouts/report.layout | 2 +- lib/layouts/revtex.layout | 2 +- lib/layouts/revtex4.layout | 2 +- lib/layouts/scrartcl.layout | 2 +- lib/layouts/scrbook.layout | 2 +- lib/layouts/scrclass.inc | 2 +- lib/layouts/scrlettr.layout | 2 +- lib/layouts/scrlttr2.layout | 2 +- lib/layouts/scrreprt.layout | 2 +- lib/layouts/seminar.layout | 2 +- lib/layouts/siamltex.layout | 2 +- lib/layouts/simplecv.layout | 2 +- lib/layouts/slides.layout | 2 +- lib/layouts/spie.layout | 2 +- lib/layouts/stdcharstyles.inc | 2 +- lib/layouts/stdclass.inc | 2 +- lib/layouts/stdcounters.inc | 2 +- lib/layouts/stdcustom.inc | 2 +- lib/layouts/stdfloats.inc | 2 +- lib/layouts/stdinsets.inc | 16 ++-- lib/layouts/stdlayouts.inc | 2 +- lib/layouts/stdletter.inc | 2 +- lib/layouts/stdlists.inc | 2 +- lib/layouts/stdsections.inc | 2 +- lib/layouts/stdstarsections.inc | 2 +- lib/layouts/stdstruct.inc | 2 +- lib/layouts/stdtitle.inc | 2 +- lib/layouts/svglobal.layout | 2 +- lib/layouts/svjog.layout | 2 +- lib/layouts/svjour.inc | 2 +- lib/layouts/svprobth.layout | 2 +- lib/layouts/theorems-ams-withinsec.module | 8 +- lib/layouts/theorems-ams.module | 8 +- lib/layouts/theorems-std.module | 2 +- lib/layouts/theorems-withinchap.module | 2 +- lib/layouts/theorems-withinsec.module | 2 +- src/BufferParams.cpp | 8 ++ src/LaTeXFeatures.cpp | 19 ++--- src/Layout.cpp | 8 ++ src/Layout.h | 7 ++ src/Paragraph.cpp | 7 ++ src/TextClass.cpp | 33 ++++++-- src/TextClass.h | 4 + src/insets/InsetFlex.cpp | 16 ++++ src/insets/InsetFlex.h | 6 ++ src/insets/InsetLayout.h | 4 + 140 files changed, 349 insertions(+), 175 deletions(-) diff --git a/lib/doc/Customization.lyx b/lib/doc/Customization.lyx index ab5f20c794..995c6e0890 100644 --- a/lib/doc/Customization.lyx +++ b/lib/doc/Customization.lyx @@ -6367,7 +6367,7 @@ int don't have an explicit file format). The file format that is documented here is \family typewriter -2 +6 \family default . \end_layout @@ -6568,6 +6568,43 @@ ely not documented. \begin_layout Description +\family typewriter +\series medium +Requires +\family default +\series default +[ +\family typewriter +string +\family default +] Whether the class requires the feature +\family typewriter + string +\family default +. + A feature is in general the name of a package (amsmath, makeidx, \SpecialChar \ldots{} +) or a + macro (url, boldsymbol,\SpecialChar \ldots{} +). + Multiple features must be separated by commas. + Note that you can only request supported features; unfortunately, the complete + list of supported features is not documented (however, +\family sans +\bar under +H +\bar default +elp\SpecialChar \menuseparator + +\bar under +L +\bar default +aTeX Configuration +\family default + gives an overview of the supported packages). +\end_layout + +\begin_layout Description + \family typewriter \series medium DefaultFont @@ -8307,6 +8344,43 @@ EndPreamble \begin_layout Description +\family typewriter +\series medium +Requires +\family default +\series default +[ +\family typewriter +string +\family default +] Whether the layout requires the feature +\family typewriter + string +\family default +. + A feature is in general the name of a package (amsmath, makeidx, \SpecialChar \ldots{} +) or a + macro (url, boldsymbol,\SpecialChar \ldots{} +). + Multiple features must be separated by commas. + Note that you can only request supported features; unfortunately, the complete + list of supported features is not documented (however, +\family sans +\bar under +H +\bar default +elp\SpecialChar \menuseparator + +\bar under +L +\bar default +aTeX Configuration +\family default + gives an overview of the supported packages). +\end_layout + +\begin_layout Description + \family typewriter \series medium DependsOn @@ -8972,7 +9046,29 @@ reference "sec:style" \end_inset +. +\end_layout + +\begin_layout Description + +\family typewriter +\series medium +Requires +\family default +\series default +[ +\family typewriter +string +\family default +] See section\InsetSpace ~ + +\begin_inset CommandInset ref +LatexCommand ref +reference "sec:style" +\end_inset + +. \end_layout \begin_layout Subsection diff --git a/lib/layouts/IEEEtran.layout b/lib/layouts/IEEEtran.layout index 20051c2199..29baafbc32 100644 --- a/lib/layouts/IEEEtran.layout +++ b/lib/layouts/IEEEtran.layout @@ -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 5 +Format 6 Style Standard Margin Static LatexType Paragraph diff --git a/lib/layouts/aa.layout b/lib/layouts/aa.layout index 40821e3a05..4b0a114c2a 100644 --- a/lib/layouts/aa.layout +++ b/lib/layouts/aa.layout @@ -11,7 +11,7 @@ # abstract is command -Format 5 +Format 6 Columns 2 Sides 2 SecNumDepth 3 diff --git a/lib/layouts/aapaper.inc b/lib/layouts/aapaper.inc index f724a99831..d675152ea4 100644 --- a/lib/layouts/aapaper.inc +++ b/lib/layouts/aapaper.inc @@ -5,7 +5,7 @@ # Author: Peter Sütterlin -Format 5 +Format 6 Style Subtitle Margin Static LatexType Command diff --git a/lib/layouts/aapaper.layout b/lib/layouts/aapaper.layout index 8823e931c1..d680f88620 100644 --- a/lib/layouts/aapaper.layout +++ b/lib/layouts/aapaper.layout @@ -14,7 +14,7 @@ # and reconfigure LyX (after running texhash, of course). -Format 5 +Format 6 Columns 2 Sides 2 SecNumDepth 3 diff --git a/lib/layouts/aastex.layout b/lib/layouts/aastex.layout index 8af79373ac..5a579414a0 100644 --- a/lib/layouts/aastex.layout +++ b/lib/layouts/aastex.layout @@ -30,7 +30,7 @@ # Version 1.3 5/7/04 - Updated for AASTeX 5.2 -Format 5 +Format 6 Columns 1 Sides 1 #SecNumDepth 3 diff --git a/lib/layouts/agu-dtd.layout b/lib/layouts/agu-dtd.layout index 05f496aa91..93f7ed3c8b 100644 --- a/lib/layouts/agu-dtd.layout +++ b/lib/layouts/agu-dtd.layout @@ -5,7 +5,7 @@ # Martin Vermeer -Format 5 +Format 6 Input agu_stdclass.inc # Exclude higher, or equal, sections: diff --git a/lib/layouts/agu_stdclass.inc b/lib/layouts/agu_stdclass.inc index 1750a6ec0a..eaa1d8e000 100644 --- a/lib/layouts/agu_stdclass.inc +++ b/lib/layouts/agu_stdclass.inc @@ -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 5 +Format 6 OutputType docbook Columns 1 diff --git a/lib/layouts/agu_stdcounters.inc b/lib/layouts/agu_stdcounters.inc index 1655fab6c6..f62f95319e 100644 --- a/lib/layouts/agu_stdcounters.inc +++ b/lib/layouts/agu_stdcounters.inc @@ -4,7 +4,7 @@ # This include file contains all the counters that are defined as standard # in AGU-Article LyX layouts. -Format 5 +Format 6 Counter Name sect1 Within section diff --git a/lib/layouts/agu_stdlists.inc b/lib/layouts/agu_stdlists.inc index 0850c25c86..c76eace0d7 100644 --- a/lib/layouts/agu_stdlists.inc +++ b/lib/layouts/agu_stdlists.inc @@ -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 5 +Format 6 Input stdlists.inc diff --git a/lib/layouts/agu_stdsections.inc b/lib/layouts/agu_stdsections.inc index b10fac3c8b..25cd889111 100644 --- a/lib/layouts/agu_stdsections.inc +++ b/lib/layouts/agu_stdsections.inc @@ -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 5 +Format 6 Input stdsections.inc Style Part diff --git a/lib/layouts/agu_stdtitle.inc b/lib/layouts/agu_stdtitle.inc index 9240c5d036..20c1f3fe0f 100644 --- a/lib/layouts/agu_stdtitle.inc +++ b/lib/layouts/agu_stdtitle.inc @@ -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 5 +Format 6 Input stdtitle.inc diff --git a/lib/layouts/agums.layout b/lib/layouts/agums.layout index 136ba560b4..9a8de3121b 100644 --- a/lib/layouts/agums.layout +++ b/lib/layouts/agums.layout @@ -4,7 +4,7 @@ # Author: Martin Vermeer -Format 5 +Format 6 Input aguplus.inc ClassOptions diff --git a/lib/layouts/aguplus.inc b/lib/layouts/aguplus.inc index 800e071722..c42c3a5d8f 100644 --- a/lib/layouts/aguplus.inc +++ b/lib/layouts/aguplus.inc @@ -6,7 +6,7 @@ # ftp://ftp.agu.org/journals/latex/journals -Format 5 +Format 6 Input stdclass.inc SecNumDepth 4 diff --git a/lib/layouts/amsart-plain.layout b/lib/layouts/amsart-plain.layout index 631f1b29c7..ce23eddd49 100644 --- a/lib/layouts/amsart-plain.layout +++ b/lib/layouts/amsart-plain.layout @@ -9,7 +9,7 @@ # modified and modularized by Emmanuel GUREGHIAN # Tinkered with Sep. '07 by Paul Rubin -Format 5 +Format 6 Input amsart.layout # Change the definitions of the theorem-like environments to get unnumbered diff --git a/lib/layouts/amsart-seq.layout b/lib/layouts/amsart-seq.layout index 23f25606f9..19b8ac28a9 100644 --- a/lib/layouts/amsart-seq.layout +++ b/lib/layouts/amsart-seq.layout @@ -13,7 +13,7 @@ # modified and modularized by Emmanuel GUREGHIAN # Tinkered with Sep. '07 by Paul Rubin -Format 5 +Format 6 Input amsart.layout # Change the definitions of the theorem-like environments to get a diff --git a/lib/layouts/amsart.layout b/lib/layouts/amsart.layout index 71c9348828..43097c464a 100644 --- a/lib/layouts/amsart.layout +++ b/lib/layouts/amsart.layout @@ -8,7 +8,7 @@ # modified and modularized by Emmanuel GUREGHIAN # Tinkered with Sep. '07 by Paul Rubin -Format 5 +Format 6 Columns 1 Sides 2 PageStyle Headers diff --git a/lib/layouts/amsbook.layout b/lib/layouts/amsbook.layout index 0ab548e154..0e5f7e31d6 100644 --- a/lib/layouts/amsbook.layout +++ b/lib/layouts/amsbook.layout @@ -9,7 +9,7 @@ # Tinkered with Sep. '07 by Paul Rubin -Format 5 +Format 6 Columns 1 Sides 2 PageStyle Headers diff --git a/lib/layouts/amsdefs.inc b/lib/layouts/amsdefs.inc index 8d27401e55..8c416e5039 100644 --- a/lib/layouts/amsdefs.inc +++ b/lib/layouts/amsdefs.inc @@ -4,7 +4,7 @@ # Tinkered with Sep. '07 by Paul Rubin # Including the maths stuff -Format 5 +Format 6 Input amsmaths.inc # The AMS documentclasses use the package amsmath and provide the diff --git a/lib/layouts/amsmaths-plain.inc b/lib/layouts/amsmaths-plain.inc index 251f2ed582..56983aa6f7 100644 --- a/lib/layouts/amsmaths-plain.inc +++ b/lib/layouts/amsmaths-plain.inc @@ -33,7 +33,7 @@ # - Case (regular only -- defined as an enumeration) -Format 5 +Format 6 Style Theorem LatexName thm* diff --git a/lib/layouts/amsmaths-seq.inc b/lib/layouts/amsmaths-seq.inc index 4f04aee897..aee217c67a 100644 --- a/lib/layouts/amsmaths-seq.inc +++ b/lib/layouts/amsmaths-seq.inc @@ -29,7 +29,7 @@ # - Assumption # - Case (regular only -- defined as an enumeration) -Format 5 +Format 6 # Use a simpler preamble. diff --git a/lib/layouts/amsmaths.inc b/lib/layouts/amsmaths.inc index 973956f4fc..a2efe1d106 100644 --- a/lib/layouts/amsmaths.inc +++ b/lib/layouts/amsmaths.inc @@ -32,7 +32,7 @@ # - Assumption # - Case (regular only -- defined as an enumeration) -Format 5 +Format 6 Counter diff --git a/lib/layouts/apa.layout b/lib/layouts/apa.layout index 1b1090eaf8..49a85f65f5 100644 --- a/lib/layouts/apa.layout +++ b/lib/layouts/apa.layout @@ -2,7 +2,7 @@ # \DeclareLaTeXClass[apa,apacite.sty]{article (APA)} # Author: Randy Gobbel -Format 5 +Format 6 Columns 1 Sides 1 PageStyle Headers diff --git a/lib/layouts/arab-article.layout b/lib/layouts/arab-article.layout index f2a15c4444..8dc50fd15e 100644 --- a/lib/layouts/arab-article.layout +++ b/lib/layouts/arab-article.layout @@ -3,5 +3,5 @@ # Arabic article textclass definition file. # Author: Dekel Tsur -Format 5 +Format 6 Input article diff --git a/lib/layouts/armenian-article.layout b/lib/layouts/armenian-article.layout index c9f9686fd6..83eb8dae81 100644 --- a/lib/layouts/armenian-article.layout +++ b/lib/layouts/armenian-article.layout @@ -3,7 +3,7 @@ # Arabic article textclass definition file. # Author: Uwe Stöhr (uwestoehr@web.de) -Format 5 +Format 6 Input article Style LatinOn diff --git a/lib/layouts/article.layout b/lib/layouts/article.layout index 5a4cbf7ce2..c898907aea 100644 --- a/lib/layouts/article.layout +++ b/lib/layouts/article.layout @@ -5,7 +5,7 @@ # Transposed by Pascal André # Heavily modifed and enhanced by serveral developers. -Format 5 +Format 6 Input stdclass.inc SecNumDepth 3 diff --git a/lib/layouts/beamer.layout b/lib/layouts/beamer.layout index 964158ec41..127b0747aa 100644 --- a/lib/layouts/beamer.layout +++ b/lib/layouts/beamer.layout @@ -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 5 +Format 6 Input stdcounters.inc Input stdinsets.inc diff --git a/lib/layouts/book.layout b/lib/layouts/book.layout index abca9e2955..a220c102c6 100644 --- a/lib/layouts/book.layout +++ b/lib/layouts/book.layout @@ -6,7 +6,7 @@ # Heavily modifed and enhanced by serveral developers. -Format 5 +Format 6 Input stdclass.inc Input numreport.inc diff --git a/lib/layouts/braille.module b/lib/layouts/braille.module index b11decd65b..193eb96f16 100644 --- a/lib/layouts/braille.module +++ b/lib/layouts/braille.module @@ -2,7 +2,7 @@ # Author: Uwe Stöhr -Format 5 +Format 6 Preamble \usepackage{braille} diff --git a/lib/layouts/broadway.layout b/lib/layouts/broadway.layout index fce4bb02e3..95dbd9fb55 100644 --- a/lib/layouts/broadway.layout +++ b/lib/layouts/broadway.layout @@ -3,7 +3,7 @@ # For theater plays -Format 5 +Format 6 Columns 1 Sides 1 SecNumDepth 2 diff --git a/lib/layouts/chess.layout b/lib/layouts/chess.layout index ea05690c21..4f3d0be6c7 100644 --- a/lib/layouts/chess.layout +++ b/lib/layouts/chess.layout @@ -16,7 +16,7 @@ # \vspace*{-0.5in}) # -Format 5 +Format 6 Preamble \usepackage[ps,mover]{lyxskak} %%% initialize board diff --git a/lib/layouts/cl2emult.layout b/lib/layouts/cl2emult.layout index 832d854271..f5fe8206d4 100644 --- a/lib/layouts/cl2emult.layout +++ b/lib/layouts/cl2emult.layout @@ -3,7 +3,7 @@ # Springer's cl2emult textclass definition file. # Author : André Poenitz -Format 5 +Format 6 Columns 1 Sides 1 SecNumDepth 2 diff --git a/lib/layouts/db_lyxmacros.inc b/lib/layouts/db_lyxmacros.inc index f753bb37f1..7f6c41a880 100644 --- a/lib/layouts/db_lyxmacros.inc +++ b/lib/layouts/db_lyxmacros.inc @@ -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 5 +Format 6 Input lyxmacros.inc Style Code diff --git a/lib/layouts/db_stdcharstyles.inc b/lib/layouts/db_stdcharstyles.inc index b7569bedf3..e5672f7919 100644 --- a/lib/layouts/db_stdcharstyles.inc +++ b/lib/layouts/db_stdcharstyles.inc @@ -2,7 +2,7 @@ # Author : José Abílio Oliveira Matos # Character Styles definition -Format 5 +Format 6 InsetLayout Element:Filename LyXType element LabelString Filename diff --git a/lib/layouts/db_stdclass.inc b/lib/layouts/db_stdclass.inc index 96c724e528..2a22a563dc 100644 --- a/lib/layouts/db_stdclass.inc +++ b/lib/layouts/db_stdclass.inc @@ -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 5 +Format 6 OutputType docbook Columns 1 diff --git a/lib/layouts/db_stdcounters.inc b/lib/layouts/db_stdcounters.inc index c6536d47a2..92f048fdb4 100644 --- a/lib/layouts/db_stdcounters.inc +++ b/lib/layouts/db_stdcounters.inc @@ -4,7 +4,7 @@ # This include file contains all the counters that are defined as standard # in Docbook LyX layouts. -Format 5 +Format 6 Counter Name sect1 Within chapter diff --git a/lib/layouts/db_stdlayouts.inc b/lib/layouts/db_stdlayouts.inc index 1084e67774..900c8978d2 100644 --- a/lib/layouts/db_stdlayouts.inc +++ b/lib/layouts/db_stdlayouts.inc @@ -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 5 +Format 6 Input stdlayouts.inc Style Literal diff --git a/lib/layouts/db_stdlists.inc b/lib/layouts/db_stdlists.inc index f10a3398b5..06afbc1e69 100644 --- a/lib/layouts/db_stdlists.inc +++ b/lib/layouts/db_stdlists.inc @@ -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 5 +Format 6 Input stdlists.inc diff --git a/lib/layouts/db_stdsections.inc b/lib/layouts/db_stdsections.inc index a7b3235534..53e1f22903 100644 --- a/lib/layouts/db_stdsections.inc +++ b/lib/layouts/db_stdsections.inc @@ -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 5 +Format 6 Input stdsections.inc Style Part diff --git a/lib/layouts/db_stdstarsections.inc b/lib/layouts/db_stdstarsections.inc index c8c14893ec..85a3ef7730 100644 --- a/lib/layouts/db_stdstarsections.inc +++ b/lib/layouts/db_stdstarsections.inc @@ -9,7 +9,7 @@ # modifying the style of the regular sectioning layouts. -Format 5 +Format 6 Style Part* CopyStyle Part Margin Static diff --git a/lib/layouts/db_stdstruct.inc b/lib/layouts/db_stdstruct.inc index 8bfe713ada..a7e3e5a1d8 100644 --- a/lib/layouts/db_stdstruct.inc +++ b/lib/layouts/db_stdstruct.inc @@ -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 5 +Format 6 Input stdstruct.inc Style Abstract diff --git a/lib/layouts/db_stdtitle.inc b/lib/layouts/db_stdtitle.inc index 2b9b690a45..3581ea630a 100644 --- a/lib/layouts/db_stdtitle.inc +++ b/lib/layouts/db_stdtitle.inc @@ -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 5 +Format 6 Input stdtitle.inc diff --git a/lib/layouts/dinbrief.layout b/lib/layouts/dinbrief.layout index bca7944666..5b155307a5 100644 --- a/lib/layouts/dinbrief.layout +++ b/lib/layouts/dinbrief.layout @@ -6,7 +6,7 @@ # Modifies only some things from letter.layout -Format 5 +Format 6 Input letter.layout diff --git a/lib/layouts/docbook-book.layout b/lib/layouts/docbook-book.layout index 82a5ecc77a..173eeffb34 100644 --- a/lib/layouts/docbook-book.layout +++ b/lib/layouts/docbook-book.layout @@ -4,7 +4,7 @@ # Author : Jose' Matos # hacked for books: Luc Abom -Format 5 +Format 6 Input report Input db_stdclass.inc diff --git a/lib/layouts/docbook-chapter.layout b/lib/layouts/docbook-chapter.layout index c12fa5d15f..12eeb45b2b 100644 --- a/lib/layouts/docbook-chapter.layout +++ b/lib/layouts/docbook-chapter.layout @@ -3,7 +3,7 @@ # DocBook textclass definition file. # Author : Jose' Matos -Format 5 +Format 6 Input db_stdclass.inc Style Title diff --git a/lib/layouts/docbook-section.layout b/lib/layouts/docbook-section.layout index 13ee8aa80d..d7898bb2d7 100644 --- a/lib/layouts/docbook-section.layout +++ b/lib/layouts/docbook-section.layout @@ -3,7 +3,7 @@ # DocBook textclass definition file. # Author : Jose' Matos -Format 5 +Format 6 Input db_stdclass.inc Style Title diff --git a/lib/layouts/docbook.layout b/lib/layouts/docbook.layout index 553d7fb44b..cba01bcca5 100644 --- a/lib/layouts/docbook.layout +++ b/lib/layouts/docbook.layout @@ -3,7 +3,7 @@ # DocBook textclass definition file. # Author : Jose' Matos -Format 5 +Format 6 Input db_stdclass.inc # Exclude higher, or equal, sections: diff --git a/lib/layouts/dtk.layout b/lib/layouts/dtk.layout index eace3e1a86..c3f7fe2afd 100644 --- a/lib/layouts/dtk.layout +++ b/lib/layouts/dtk.layout @@ -6,7 +6,7 @@ # Author : Herbert Voss 2001/08/13 -Format 5 +Format 6 Columns 1 Sides 2 SecNumDepth -1 # no counting diff --git a/lib/layouts/egs.layout b/lib/layouts/egs.layout index 06e4d6837f..0599bad86e 100644 --- a/lib/layouts/egs.layout +++ b/lib/layouts/egs.layout @@ -8,7 +8,7 @@ # Converted article -> egs Martin Vermeer -Format 5 +Format 6 Columns 2 Sides 1 PageStyle Plain diff --git a/lib/layouts/elsart.layout b/lib/layouts/elsart.layout index b00ce376a0..d1025b6f05 100644 --- a/lib/layouts/elsart.layout +++ b/lib/layouts/elsart.layout @@ -22,7 +22,7 @@ # numbered sections, as does the class file. -Format 5 +Format 6 Columns 1 Sides 2 PageStyle headings diff --git a/lib/layouts/endnotes.module b/lib/layouts/endnotes.module index de8e01c60a..79d8711a82 100644 --- a/lib/layouts/endnotes.module +++ b/lib/layouts/endnotes.module @@ -1,6 +1,6 @@ -#\DeclareLyXModule[endnotes.sty]{Adds an endnote command, in addition to footnotes. You will need to add \theendnotes in ERT where you want the endnotes to appear.}{Endnote} +#\DeclareLyXModule{Adds an endnote command, in addition to footnotes. You will need to add \theendnotes in ERT where you want the endnotes to appear.}{Endnote} -Format 5 +Format 6 InsetLayout Custom:Endnote LyXType custom @@ -11,7 +11,5 @@ InsetLayout Custom:Endnote Size Small EndFont LabelString endnote - Preamble - \usepackage{endnotes} - EndPreamble + Requires endnotes End diff --git a/lib/layouts/entcs.layout b/lib/layouts/entcs.layout index 087b19d098..1bfd23bf16 100644 --- a/lib/layouts/entcs.layout +++ b/lib/layouts/entcs.layout @@ -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 5 +Format 6 Input article.layout # only font size 11pt is really available diff --git a/lib/layouts/europecv.layout b/lib/layouts/europecv.layout index 627d050cf8..776200975d 100644 --- a/lib/layouts/europecv.layout +++ b/lib/layouts/europecv.layout @@ -5,7 +5,7 @@ # General textclass parameters -Format 5 +Format 6 Columns 1 Sides 1 SecNumDepth -1 diff --git a/lib/layouts/extarticle.layout b/lib/layouts/extarticle.layout index f7b34fe253..ad6df021f7 100644 --- a/lib/layouts/extarticle.layout +++ b/lib/layouts/extarticle.layout @@ -2,7 +2,7 @@ # \DeclareLaTeXClass[extarticle]{article (more font sizes)} # Herbert Voss -Format 5 +Format 6 Input article.layout # change available fontsizes diff --git a/lib/layouts/extbook.layout b/lib/layouts/extbook.layout index b4faf63d7a..d587c42e41 100644 --- a/lib/layouts/extbook.layout +++ b/lib/layouts/extbook.layout @@ -3,7 +3,7 @@ # Extended book textclass definition file. # Herbert Voss -Format 5 +Format 6 Input book.layout # change available fontsizes diff --git a/lib/layouts/extletter.layout b/lib/layouts/extletter.layout index d79eb9a8a8..5d773987a5 100644 --- a/lib/layouts/extletter.layout +++ b/lib/layouts/extletter.layout @@ -3,7 +3,7 @@ # Extended article textclass definition file. # Herbert Voss -Format 5 +Format 6 Input letter.layout # change available fontsizes diff --git a/lib/layouts/extreport.layout b/lib/layouts/extreport.layout index 1f68d4304e..bb4f2483f7 100644 --- a/lib/layouts/extreport.layout +++ b/lib/layouts/extreport.layout @@ -3,7 +3,7 @@ # Extented report textclass definition file. # Herbert Voss -Format 5 +Format 6 Input report.layout # change available fontsizes diff --git a/lib/layouts/foils.layout b/lib/layouts/foils.layout index 13fe979124..b8279451d6 100644 --- a/lib/layouts/foils.layout +++ b/lib/layouts/foils.layout @@ -6,7 +6,7 @@ # To do: Define class specific options. -Format 5 +Format 6 Columns 1 Sides 1 diff --git a/lib/layouts/foottoend.module b/lib/layouts/foottoend.module index bc32ef72f5..c6199c0737 100644 --- a/lib/layouts/foottoend.module +++ b/lib/layouts/foottoend.module @@ -1,8 +1,9 @@ -#\DeclareLyXModule[endnotes.sty]{Sets all footnotes as endnotes. You will need to add \theendnotes in ERT where you want the endnotes to appear.}{Foot to End} +#\DeclareLyXModule{Sets all footnotes as endnotes. You will need to add \theendnotes in ERT where you want the endnotes to appear.}{Foot to End} -Format 5 +Format 6 + +Requires endnotes Preamble - \usepackage{endnotes} \let\footnote=\endnote EndPreamble diff --git a/lib/layouts/g-brief-de.layout b/lib/layouts/g-brief-de.layout index 96644dd415..15512ea46b 100644 --- a/lib/layouts/g-brief-de.layout +++ b/lib/layouts/g-brief-de.layout @@ -3,7 +3,7 @@ # Letter textclass definition file. # Author : Thomas Hartkens -Format 5 +Format 6 Input stdinsets.inc Input stdfloats.inc Input stdcounters.inc diff --git a/lib/layouts/g-brief-en.layout b/lib/layouts/g-brief-en.layout index 32edc620af..322e40eb94 100644 --- a/lib/layouts/g-brief-en.layout +++ b/lib/layouts/g-brief-en.layout @@ -3,7 +3,7 @@ # Letter textclass definition file. # Author : Thomas Hartkens -Format 5 +Format 6 Input stdinsets.inc Input stdfloats.inc Input stdcounters.inc diff --git a/lib/layouts/g-brief2.layout b/lib/layouts/g-brief2.layout index 6c879bd838..2c8b6c6bdc 100644 --- a/lib/layouts/g-brief2.layout +++ b/lib/layouts/g-brief2.layout @@ -10,7 +10,7 @@ # General textclass parameters -Format 5 +Format 6 Columns 1 Sides 1 PageStyle Empty diff --git a/lib/layouts/hanging.module b/lib/layouts/hanging.module index 21cb9ae5ea..6ad06a9f59 100644 --- a/lib/layouts/hanging.module +++ b/lib/layouts/hanging.module @@ -6,7 +6,7 @@ #Copyright Peter R. Wilson. #Released under the LaTeX Project Public License. -Format 5 +Format 6 Style Hanging LatexType Environment diff --git a/lib/layouts/heb-article.layout b/lib/layouts/heb-article.layout index 247c75816a..c9ccd8dace 100644 --- a/lib/layouts/heb-article.layout +++ b/lib/layouts/heb-article.layout @@ -4,7 +4,7 @@ # Author: Dekel Tsur # Few changes by Baruch Even -Format 5 +Format 6 Input article Preamble diff --git a/lib/layouts/heb-letter.layout b/lib/layouts/heb-letter.layout index 0e7631ee6d..97acbcd96a 100644 --- a/lib/layouts/heb-letter.layout +++ b/lib/layouts/heb-letter.layout @@ -3,7 +3,7 @@ # Hebrew letter textclass definition file. # Author: Dekel Tsur -Format 5 +Format 6 Input letter diff --git a/lib/layouts/hollywood.layout b/lib/layouts/hollywood.layout index b6bb317aae..656290d466 100644 --- a/lib/layouts/hollywood.layout +++ b/lib/layouts/hollywood.layout @@ -15,7 +15,7 @@ # Based on course given by Lars Davidson -Format 5 +Format 6 Columns 1 Sides 1 SecNumDepth 2 diff --git a/lib/layouts/ijmpc.layout b/lib/layouts/ijmpc.layout index 10f3cb8f2f..2e1842292a 100644 --- a/lib/layouts/ijmpc.layout +++ b/lib/layouts/ijmpc.layout @@ -9,7 +9,7 @@ # # Version 1 2006-04-09 - First version, for LyX 1.4.0. -Format 5 +Format 6 Input stdclass.inc Input numarticle.inc diff --git a/lib/layouts/ijmpd.layout b/lib/layouts/ijmpd.layout index 93c528ec40..2aca5e7d97 100644 --- a/lib/layouts/ijmpd.layout +++ b/lib/layouts/ijmpd.layout @@ -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 5 +Format 6 Input stdclass.inc Input numarticle.inc diff --git a/lib/layouts/iopart.layout b/lib/layouts/iopart.layout index 73c49da99c..c7d2d9e856 100644 --- a/lib/layouts/iopart.layout +++ b/lib/layouts/iopart.layout @@ -3,7 +3,7 @@ # IOP article textclass definition file. # Author: Uwe Stöhr (uwestoehr@web.de) -Format 5 +Format 6 Columns 1 Sides 1 diff --git a/lib/layouts/isprs.layout b/lib/layouts/isprs.layout index 3a7decb9d8..98f34b26b6 100644 --- a/lib/layouts/isprs.layout +++ b/lib/layouts/isprs.layout @@ -8,7 +8,7 @@ # Heavily modifed and enhanced by serveral developers. # Input general definitions -Format 5 +Format 6 Input stdclass.inc Sides 2 Columns 2 diff --git a/lib/layouts/jgrga.layout b/lib/layouts/jgrga.layout index f239093a3a..e68e98cce4 100644 --- a/lib/layouts/jgrga.layout +++ b/lib/layouts/jgrga.layout @@ -3,7 +3,7 @@ # AGUplus JGR textclass definition file. # Author: Martin Vermeer -Format 5 +Format 6 Input aguplus.inc ClassOptions diff --git a/lib/layouts/kluwer.layout b/lib/layouts/kluwer.layout index a1695e1a12..9e08bde248 100644 --- a/lib/layouts/kluwer.layout +++ b/lib/layouts/kluwer.layout @@ -14,7 +14,7 @@ # 2003-03-03 Updated for lyx 1.3.0. -Format 5 +Format 6 Columns 1 Sides 2 SecNumDepth 4 diff --git a/lib/layouts/latex8.layout b/lib/layouts/latex8.layout index fb255e4fc0..edb7f8f4e4 100644 --- a/lib/layouts/latex8.layout +++ b/lib/layouts/latex8.layout @@ -3,7 +3,7 @@ # Latex8 textclass definition file. # Author : Allan Rae -Format 5 +Format 6 Preamble \usepackage{latex8} \usepackage{times} diff --git a/lib/layouts/letter.layout b/lib/layouts/letter.layout index ea55e79df8..509d4bdd2f 100644 --- a/lib/layouts/letter.layout +++ b/lib/layouts/letter.layout @@ -4,7 +4,7 @@ # Author : Matthias Ettrich # Heavily modifed and enhanced by serveral developers. -Format 5 +Format 6 Input stdinsets.inc Input stdletter.inc Input stdlists.inc diff --git a/lib/layouts/linguistics.module b/lib/layouts/linguistics.module index f80e41937e..547e9c5c25 100644 --- a/lib/layouts/linguistics.module +++ b/lib/layouts/linguistics.module @@ -1,8 +1,8 @@ -#\DeclareLyXModule[covington.sty]{Defines some special environments useful for linguistics (numbered examples, glosses, semantic markup).}{Linguistics} +#\DeclareLyXModule{Defines some special environments useful for linguistics (numbered examples, glosses, semantic markup).}{Linguistics} # Author: Jürgen Spitzmüller -Format 5 +Format 6 # single numbered example with covington.sty Style Numbered_Example_(multiline) @@ -24,9 +24,7 @@ Style Numbered_Example_(multiline) Shape Italic Color Blue EndFont - Preamble - \usepackage{covington} - EndPreamble + Requires covington End @@ -49,9 +47,8 @@ Style Subexample LatexName subexample LeftMargin XSubexample: LabelString "Subexample:" + Requires covington,enumitem Preamble - \usepackage{covington} - \usepackage{enumitem} \newenvironment{subexample}{% \begin{example}\begin{enumerate}[leftmargin=1.7em] \renewcommand\theenumi{\alph{enumi}} @@ -76,8 +73,8 @@ InsetLayout Custom:Glosse MultiPar true PassThru true FreeSpacing true + Requires covington Preamble - \usepackage{covington} \@ifundefined{linggloss}{% \newenvironment{linggloss}[1]{% \gll #1} @@ -100,8 +97,8 @@ InsetLayout Custom:Tri-Glosse MultiPar true PassThru true FreeSpacing true + Requires covington Preamble - \usepackage{covington} \@ifundefined{lingglosss}{% \newenvironment{lingglosss}[1]{% \glll #1} @@ -143,8 +140,8 @@ InsetLayout CharStyle:Meaning LabelString meaning LatexType command LatexName lingmeaning + Requires csquotes Preamble - \usepackage{csquotes} \newcommand{\lingmeaning}[1]{\enquote*{#1}} EndPreamble End diff --git a/lib/layouts/literate-article.layout b/lib/layouts/literate-article.layout index e1fb977b85..7a5cfe8204 100644 --- a/lib/layouts/literate-article.layout +++ b/lib/layouts/literate-article.layout @@ -3,7 +3,7 @@ # literate-article textclass definition file. # Author : Edmar Wienskoski Jr. -Format 5 +Format 6 Preamble \usepackage{noweb} EndPreamble diff --git a/lib/layouts/literate-book.layout b/lib/layouts/literate-book.layout index 91e4af1b97..fb84d499da 100644 --- a/lib/layouts/literate-book.layout +++ b/lib/layouts/literate-book.layout @@ -3,7 +3,7 @@ # literate-book textclass definition file. # Author : Edmar Wienskoski Jr. -Format 5 +Format 6 Preamble \usepackage{noweb} EndPreamble diff --git a/lib/layouts/literate-report.layout b/lib/layouts/literate-report.layout index e7ebb261ee..fad25ca63b 100644 --- a/lib/layouts/literate-report.layout +++ b/lib/layouts/literate-report.layout @@ -3,7 +3,7 @@ # literate-report textclass definition file. # Author : Edmar Wienskoski Jr. -Format 5 +Format 6 Preamble \usepackage{noweb} EndPreamble diff --git a/lib/layouts/literate-scrap.inc b/lib/layouts/literate-scrap.inc index 8ffcff229e..c8304018a0 100644 --- a/lib/layouts/literate-scrap.inc +++ b/lib/layouts/literate-scrap.inc @@ -6,7 +6,7 @@ # resembles more closely the produced paper doc (more WYSIWYG) # -Format 5 +Format 6 OutputType literate Style Scrap diff --git a/lib/layouts/llncs.layout b/lib/layouts/llncs.layout index d5adbbffd6..c658379a3a 100644 --- a/lib/layouts/llncs.layout +++ b/lib/layouts/llncs.layout @@ -14,7 +14,7 @@ # Modified for LyX 12 by Jean-Marc Lasgouttes and MV. -Format 5 +Format 6 Columns 1 Sides 1 PageStyle Plain diff --git a/lib/layouts/logicalmkup.module b/lib/layouts/logicalmkup.module index c9565b94c3..1d4511e89a 100644 --- a/lib/layouts/logicalmkup.module +++ b/lib/layouts/logicalmkup.module @@ -2,7 +2,7 @@ # Author : Martin vermeer -Format 5 +Format 6 InsetLayout CharStyle:Noun LyxType charstyle @@ -12,9 +12,7 @@ InsetLayout CharStyle:Noun Font Shape Smallcaps EndFont - Preamble - \newcommand{\noun}[1]{\textsc{#1}} - EndPreamble + Requires noun End diff --git a/lib/layouts/ltugboat.layout b/lib/layouts/ltugboat.layout index 605beb411b..d7fbbcb79b 100644 --- a/lib/layouts/ltugboat.layout +++ b/lib/layouts/ltugboat.layout @@ -5,7 +5,7 @@ # Author : Herbert Voss 2001/08/13 -Format 5 +Format 6 Columns 2 Sides 2 #SecNumDepth # no counting diff --git a/lib/layouts/lyxmacros.inc b/lib/layouts/lyxmacros.inc index ee1eb8c583..2f4d159094 100644 --- a/lib/layouts/lyxmacros.inc +++ b/lib/layouts/lyxmacros.inc @@ -8,7 +8,7 @@ # be removed later. -Format 5 +Format 6 Style LyX-Code Margin Static LatexType Environment diff --git a/lib/layouts/manpage.layout b/lib/layouts/manpage.layout index c8a8b4aa7c..9c9a356fef 100644 --- a/lib/layouts/manpage.layout +++ b/lib/layouts/manpage.layout @@ -4,7 +4,7 @@ # Author : José Matos -Format 5 +Format 6 Columns 1 Sides 1 PageStyle Plain diff --git a/lib/layouts/memoir.layout b/lib/layouts/memoir.layout index 252f8bdc95..d75d00a5aa 100644 --- a/lib/layouts/memoir.layout +++ b/lib/layouts/memoir.layout @@ -6,7 +6,7 @@ # feel free to contribute missing features! -Format 5 +Format 6 Columns 1 Sides 2 SecNumDepth 2 diff --git a/lib/layouts/moderncv.layout b/lib/layouts/moderncv.layout index 40dd2df50b..7ee7c10a9f 100644 --- a/lib/layouts/moderncv.layout +++ b/lib/layouts/moderncv.layout @@ -5,7 +5,7 @@ # General textclass parameters -Format 5 +Format 6 Columns 1 Sides 1 SecNumDepth -1 diff --git a/lib/layouts/mwart.layout b/lib/layouts/mwart.layout index 7323c80cb2..6e71749960 100644 --- a/lib/layouts/mwart.layout +++ b/lib/layouts/mwart.layout @@ -5,7 +5,7 @@ # Transposed by Tomasz Łuczak # Heavily modifed and enhanced by several developers. -Format 5 +Format 6 Input stdclass.inc NoStyle Chapter diff --git a/lib/layouts/mwbk.layout b/lib/layouts/mwbk.layout index d15f4a051e..16f169e248 100644 --- a/lib/layouts/mwbk.layout +++ b/lib/layouts/mwbk.layout @@ -5,7 +5,7 @@ # Transposed by Tomasz Łuczak # Heavily modifed and enhanced by serveral developers. -Format 5 +Format 6 Input stdclass.inc Input numreport.inc diff --git a/lib/layouts/mwrep.layout b/lib/layouts/mwrep.layout index ddef6da128..ece20f97c3 100644 --- a/lib/layouts/mwrep.layout +++ b/lib/layouts/mwrep.layout @@ -5,7 +5,7 @@ # Transposed by Tomasz Łuczak # Heavily modifed and enhanced by serveral developers. -Format 5 +Format 6 Input stdclass.inc Input numreport.inc diff --git a/lib/layouts/numarticle.inc b/lib/layouts/numarticle.inc index c251b6e7bc..de7b146616 100644 --- a/lib/layouts/numarticle.inc +++ b/lib/layouts/numarticle.inc @@ -1,7 +1,7 @@ # Author : André Pönitz # This include file contains label definitions for an article-like numbering. -Format 5 +Format 6 # appendix applies to sections. Counter diff --git a/lib/layouts/numreport.inc b/lib/layouts/numreport.inc index db8681a34f..70ceb9a902 100644 --- a/lib/layouts/numreport.inc +++ b/lib/layouts/numreport.inc @@ -1,7 +1,7 @@ # Author : André Pönitz # This include file contains label definitions for a report-like numbering. -Format 5 +Format 6 Style Part TocLevel -1 diff --git a/lib/layouts/numrevtex.inc b/lib/layouts/numrevtex.inc index c353445edb..eb8c19530b 100644 --- a/lib/layouts/numrevtex.inc +++ b/lib/layouts/numrevtex.inc @@ -2,7 +2,7 @@ # This include files contains label definitions for a article-like numbering. -Format 5 +Format 6 Style Section LabelType Counter LabelCounter section diff --git a/lib/layouts/paper.layout b/lib/layouts/paper.layout index 66d55a9f0b..83b9216300 100644 --- a/lib/layouts/paper.layout +++ b/lib/layouts/paper.layout @@ -4,7 +4,7 @@ # Created by Jean-Marc Lasgouttes (Jean-Marc.Lasgouttes@inria.fr) -Format 5 +Format 6 Columns 1 Sides 1 SecNumDepth 3 diff --git a/lib/layouts/powerdot.layout b/lib/layouts/powerdot.layout index 5b775c89e3..cf653ecbc6 100644 --- a/lib/layouts/powerdot.layout +++ b/lib/layouts/powerdot.layout @@ -8,7 +8,7 @@ ### # General textclass parameters ### -Format 5 +Format 6 Columns 1 Sides 1 Provides url 1 diff --git a/lib/layouts/report.layout b/lib/layouts/report.layout index 314279e038..99b6a81872 100644 --- a/lib/layouts/report.layout +++ b/lib/layouts/report.layout @@ -5,7 +5,7 @@ # Transposed by Pascal André # Heavily modifed and enhanced by serveral developers. -Format 5 +Format 6 Input stdclass.inc Input numreport.inc diff --git a/lib/layouts/revtex.layout b/lib/layouts/revtex.layout index f07578ac7f..c25a92b68c 100644 --- a/lib/layouts/revtex.layout +++ b/lib/layouts/revtex.layout @@ -9,7 +9,7 @@ # Amir Karger (LyX v11.34 style modifications - using changes # made by Jean-Marc Lasgouttes to amsart.layout) -Format 5 +Format 6 Columns 1 Sides 1 PageStyle Headers diff --git a/lib/layouts/revtex4.layout b/lib/layouts/revtex4.layout index 37eaa50ae4..ed7f656091 100644 --- a/lib/layouts/revtex4.layout +++ b/lib/layouts/revtex4.layout @@ -10,7 +10,7 @@ # Amir Karger (RevTeX 4 beta) 9/1999, 7/2000 -Format 5 +Format 6 Columns 1 Sides 1 PageStyle Headers diff --git a/lib/layouts/scrartcl.layout b/lib/layouts/scrartcl.layout index d707acc790..971e6e8296 100644 --- a/lib/layouts/scrartcl.layout +++ b/lib/layouts/scrartcl.layout @@ -3,7 +3,7 @@ # KOMA scrartcl textclass definition file. # Bernd Rellermeyer <100.41728@germanynet.de>, 1998/7/11. -Format 5 +Format 6 Input scrclass.inc SecNumDepth 3 diff --git a/lib/layouts/scrbook.layout b/lib/layouts/scrbook.layout index 5bde55686f..df85692b4b 100644 --- a/lib/layouts/scrbook.layout +++ b/lib/layouts/scrbook.layout @@ -3,7 +3,7 @@ # KOMA scrbook textclass definition file. # Bernd Rellermeyer <100.41728@germanynet.de>, 1998/7/11. -Format 5 +Format 6 Input scrclass.inc Input numreport.inc diff --git a/lib/layouts/scrclass.inc b/lib/layouts/scrclass.inc index 77dffdd8af..773504ae81 100644 --- a/lib/layouts/scrclass.inc +++ b/lib/layouts/scrclass.inc @@ -7,7 +7,7 @@ # Guenter Milde -Format 5 +Format 6 SecNumDepth 2 TocDepth 2 DefaultStyle Standard diff --git a/lib/layouts/scrlettr.layout b/lib/layouts/scrlettr.layout index 9483a9519e..0886f9ad81 100644 --- a/lib/layouts/scrlettr.layout +++ b/lib/layouts/scrlettr.layout @@ -3,7 +3,7 @@ # KOMA scrlettr textclass definition file. # Bernd Rellermeyer <100.41728@germanynet.de>, 1999/2/17. -Format 5 +Format 6 Style Standard LatexName dummy ParSep 0.4 diff --git a/lib/layouts/scrlttr2.layout b/lib/layouts/scrlttr2.layout index 613686d164..65b7aab2c4 100644 --- a/lib/layouts/scrlttr2.layout +++ b/lib/layouts/scrlttr2.layout @@ -3,7 +3,7 @@ # KOMA scrlettr2 textclass definition file. # Juergen Spitzmueller , 2003/2/17. -Format 5 +Format 6 Style Standard LatexName dummy ParSep 0.4 diff --git a/lib/layouts/scrreprt.layout b/lib/layouts/scrreprt.layout index c58917b0ab..675a5b65f0 100644 --- a/lib/layouts/scrreprt.layout +++ b/lib/layouts/scrreprt.layout @@ -3,7 +3,7 @@ # KOMA scrreprt textclass definition file. # Bernd Rellermeyer <100.41728@germanynet.de>, 1998/7/11. -Format 5 +Format 6 Input scrclass.inc Input numreport.inc diff --git a/lib/layouts/seminar.layout b/lib/layouts/seminar.layout index 95127a11ad..32637b48b7 100644 --- a/lib/layouts/seminar.layout +++ b/lib/layouts/seminar.layout @@ -3,7 +3,7 @@ # Initial attemt at makeing a LyX layout file for the seminar class. # Author : Lars Gullik Bjønnes -Format 5 +Format 6 Input stdclass.inc NoStyle Chapter diff --git a/lib/layouts/siamltex.layout b/lib/layouts/siamltex.layout index b39b453d30..e42f118ef3 100644 --- a/lib/layouts/siamltex.layout +++ b/lib/layouts/siamltex.layout @@ -4,7 +4,7 @@ # Cut & paste from various LyX layouts plus some minor modifications # Author : Kornelia Pietsch -Format 5 +Format 6 Columns 1 Sides 1 SecNumDepth 2 diff --git a/lib/layouts/simplecv.layout b/lib/layouts/simplecv.layout index 0eaa8f6806..c1150b6385 100644 --- a/lib/layouts/simplecv.layout +++ b/lib/layouts/simplecv.layout @@ -4,7 +4,7 @@ # Author : Jean-Marc Lasgouttes (Jean-Marc.Lasgouttes@inria.fr) -Format 5 +Format 6 Columns 1 Sides 1 SecNumDepth -1 diff --git a/lib/layouts/slides.layout b/lib/layouts/slides.layout index 1e0d9e183c..abc36006bd 100644 --- a/lib/layouts/slides.layout +++ b/lib/layouts/slides.layout @@ -7,7 +7,7 @@ # -Format 5 +Format 6 Columns 1 Sides 1 PageStyle Plain diff --git a/lib/layouts/spie.layout b/lib/layouts/spie.layout index 1f032d6265..a00f40b137 100644 --- a/lib/layouts/spie.layout +++ b/lib/layouts/spie.layout @@ -5,7 +5,7 @@ # to be used with the spie.cls LaTex-style available at # http://public.lanl.gov/kmh/spie/ -Format 5 +Format 6 Input stdclass.inc NoStyle Chapter diff --git a/lib/layouts/stdcharstyles.inc b/lib/layouts/stdcharstyles.inc index b5b87b0df3..46d3e2da73 100644 --- a/lib/layouts/stdcharstyles.inc +++ b/lib/layouts/stdcharstyles.inc @@ -2,7 +2,7 @@ # Author : Martin vermeer # Character Styles definition -Format 5 +Format 6 # Error fallback: InsetLayout CharStyle diff --git a/lib/layouts/stdclass.inc b/lib/layouts/stdclass.inc index 74a86dfeb6..04f1e0a06c 100644 --- a/lib/layouts/stdclass.inc +++ b/lib/layouts/stdclass.inc @@ -7,7 +7,7 @@ # ``standard'' layouts, like article and friends. -Format 5 +Format 6 Columns 1 Sides 1 SecNumDepth 2 diff --git a/lib/layouts/stdcounters.inc b/lib/layouts/stdcounters.inc index d7f0a010a5..3951168e03 100644 --- a/lib/layouts/stdcounters.inc +++ b/lib/layouts/stdcounters.inc @@ -4,7 +4,7 @@ # in most LyX layouts. -Format 5 +Format 6 Counter Name part LabelString "\Roman{part}" diff --git a/lib/layouts/stdcustom.inc b/lib/layouts/stdcustom.inc index a6d26f5c3b..07b8a6b67c 100644 --- a/lib/layouts/stdcustom.inc +++ b/lib/layouts/stdcustom.inc @@ -2,7 +2,7 @@ # Author : Martin vermeer # Custom Inset layouts definition -Format 5 +Format 6 # Error fallback: InsetLayout Custom diff --git a/lib/layouts/stdfloats.inc b/lib/layouts/stdfloats.inc index c81af7ac89..a2c9044a9a 100644 --- a/lib/layouts/stdfloats.inc +++ b/lib/layouts/stdfloats.inc @@ -4,7 +4,7 @@ # in most LyX layouts. -Format 5 +Format 6 Float Type table GuiName Table diff --git a/lib/layouts/stdinsets.inc b/lib/layouts/stdinsets.inc index 6a828077c8..17d3d5660d 100644 --- a/lib/layouts/stdinsets.inc +++ b/lib/layouts/stdinsets.inc @@ -36,16 +36,16 @@ # finished with the LabelFont definition. # MultiPar Indicates that multiple paragraphs are allowed within the inset # or not. FIXME: what is the default? -# Decoration: Classic, Minimalistic, Conglomerate. Decoration styles -# PassThru Do not do various LaTeX conversions, like the phrases -# LaTeX, LyX, quote commands, etc. -# KeepEmpty Do not delete empty paragraphs (?) -# FreeSpacing Preserve multiple spaces etc. -# ForceLTR Force the "latex" language, leading to Left-to-Right -# (latin) output, e.g., in ERT or URL. A kludge. +# Decoration: Classic, Minimalistic, Conglomerate. Decoration styles +# PassThru Do not do various LaTeX conversions, like the phrases +# LaTeX, LyX, quote commands, etc. +# KeepEmpty Do not delete empty paragraphs (?) +# FreeSpacing Preserve multiple spaces etc. +# ForceLTR Force the "latex" language, leading to Left-to-Right +# (latin) output, e.g., in ERT or URL. A kludge. #End -Format 5 +Format 6 InsetLayout Marginal LabelString margin diff --git a/lib/layouts/stdlayouts.inc b/lib/layouts/stdlayouts.inc index 126a7f1128..c0a25ca517 100644 --- a/lib/layouts/stdlayouts.inc +++ b/lib/layouts/stdlayouts.inc @@ -7,7 +7,7 @@ # quotations and such. -Format 5 +Format 6 Style Quotation Margin Static LatexType Environment diff --git a/lib/layouts/stdletter.inc b/lib/layouts/stdletter.inc index 853d699680..b6cf7e44be 100644 --- a/lib/layouts/stdletter.inc +++ b/lib/layouts/stdletter.inc @@ -3,7 +3,7 @@ # Heavily modifed and enhanced by several developers. -Format 5 +Format 6 Columns 1 Sides 1 PageStyle Empty diff --git a/lib/layouts/stdlists.inc b/lib/layouts/stdlists.inc index dde5b5a872..97c5ade0e7 100644 --- a/lib/layouts/stdlists.inc +++ b/lib/layouts/stdlists.inc @@ -7,7 +7,7 @@ # This include files contains various standard environments for lists. -Format 5 +Format 6 Style Itemize Margin Static LatexType Item_Environment diff --git a/lib/layouts/stdsections.inc b/lib/layouts/stdsections.inc index 6a0aa52ec7..c42dc09ca6 100644 --- a/lib/layouts/stdsections.inc +++ b/lib/layouts/stdsections.inc @@ -7,7 +7,7 @@ # commands that are useful for article-like document classes, but not # for letters. -Format 5 +Format 6 Style Part Margin Dynamic LabelString "Part \thepart" diff --git a/lib/layouts/stdstarsections.inc b/lib/layouts/stdstarsections.inc index 6ae208cd2f..0ea8c31ee9 100644 --- a/lib/layouts/stdstarsections.inc +++ b/lib/layouts/stdstarsections.inc @@ -9,7 +9,7 @@ # modifying the style of the regular sectioning layouts. -Format 5 +Format 6 Style Part* CopyStyle Part Margin Static diff --git a/lib/layouts/stdstruct.inc b/lib/layouts/stdstruct.inc index d67dc433fc..efeb2da5cc 100644 --- a/lib/layouts/stdstruct.inc +++ b/lib/layouts/stdstruct.inc @@ -8,7 +8,7 @@ # a document, like abstract, bibliography and such. -Format 5 +Format 6 Style Abstract Margin Static LatexType Environment diff --git a/lib/layouts/stdtitle.inc b/lib/layouts/stdtitle.inc index f654926816..30f0574fef 100644 --- a/lib/layouts/stdtitle.inc +++ b/lib/layouts/stdtitle.inc @@ -8,7 +8,7 @@ # a document, like title, author and such. -Format 5 +Format 6 Style Title Margin Static LatexType Command diff --git a/lib/layouts/svglobal.layout b/lib/layouts/svglobal.layout index d2a0f78c37..1a6ba98964 100644 --- a/lib/layouts/svglobal.layout +++ b/lib/layouts/svglobal.layout @@ -18,7 +18,7 @@ # see www.springer.de/author/tex/help-journals.html for class files # # The standard Springer Journal sections -Format 5 +Format 6 Input svjour.inc ClassOptions diff --git a/lib/layouts/svjog.layout b/lib/layouts/svjog.layout index 506423359c..5377c6f37d 100644 --- a/lib/layouts/svjog.layout +++ b/lib/layouts/svjog.layout @@ -22,7 +22,7 @@ # see www.springer.de/author/tex/help-journals.html for class files -format 5 +Format 6 Input svjour.inc diff --git a/lib/layouts/svjour.inc b/lib/layouts/svjour.inc index bc802bc30d..e9860baace 100644 --- a/lib/layouts/svjour.inc +++ b/lib/layouts/svjour.inc @@ -18,7 +18,7 @@ # see www.springer.de/author/tex/help-journals.html for class files -Format 5 +Format 6 Columns 2 Sides 1 PageStyle Plain diff --git a/lib/layouts/svprobth.layout b/lib/layouts/svprobth.layout index 6d6e49b973..7a5edd44b6 100644 --- a/lib/layouts/svprobth.layout +++ b/lib/layouts/svprobth.layout @@ -24,7 +24,7 @@ # see www.springer.de/author/tex/help-journals.html for class files -Format 5 +Format 6 Input svjour.inc ClassOptions diff --git a/lib/layouts/theorems-ams-withinsec.module b/lib/layouts/theorems-ams-withinsec.module index 981bf15726..f13a939201 100644 --- a/lib/layouts/theorems-ams-withinsec.module +++ b/lib/layouts/theorems-ams-withinsec.module @@ -3,11 +3,13 @@ # Author: Richard Heck # Adapted from amsdefs.inc and amsmaths.inc -Format 5 +Format 6 + +Requires amsmath + Preamble - \usepackage{amsmath} \theoremstyle{plain} - \newtheorem{thm}{Theorem}[section] + \newtheorem{thm}{Theorem}[section] EndPreamble diff --git a/lib/layouts/theorems-ams.module b/lib/layouts/theorems-ams.module index e5247c0e38..c0b6f2d73f 100644 --- a/lib/layouts/theorems-ams.module +++ b/lib/layouts/theorems-ams.module @@ -3,11 +3,13 @@ # Author: Richard Heck # Adapted from amsdefs.inc and amsmaths.inc -Format 5 +Format 6 + +Requires amsmath + Preamble - \usepackage{amsmath} \theoremstyle{plain} - \newtheorem{thm}{Theorem}[section] + \newtheorem{thm}{Theorem}[section] EndPreamble diff --git a/lib/layouts/theorems-std.module b/lib/layouts/theorems-std.module index 1b89f8214a..4a481ef85d 100644 --- a/lib/layouts/theorems-std.module +++ b/lib/layouts/theorems-std.module @@ -3,7 +3,7 @@ # Author: Richard Heck # Adapted from amsmaths.inc -Format 5 +Format 6 Counter Name theorem diff --git a/lib/layouts/theorems-withinchap.module b/lib/layouts/theorems-withinchap.module index 9aa10639a3..8a298138aa 100644 --- a/lib/layouts/theorems-withinchap.module +++ b/lib/layouts/theorems-withinchap.module @@ -3,7 +3,7 @@ # Author: Richard Heck # Adapted from amsmaths.inc -Format 5 +Format 6 Counter Name theorem diff --git a/lib/layouts/theorems-withinsec.module b/lib/layouts/theorems-withinsec.module index cff2e7ed6f..2c8486424d 100644 --- a/lib/layouts/theorems-withinsec.module +++ b/lib/layouts/theorems-withinsec.module @@ -3,7 +3,7 @@ # Author: Richard Heck # Adapted from amsmaths.inc -Format 5 +Format 6 Counter Name theorem diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp index 78c4f85494..bb77a83814 100644 --- a/src/BufferParams.cpp +++ b/src/BufferParams.cpp @@ -810,6 +810,14 @@ void BufferParams::writeFile(ostream & os) const void BufferParams::validate(LaTeXFeatures & features) const { + if (!getTextClass().requires().empty()) { + vector req = getTextClass().requires(); + for (vector::const_iterator it = req.begin(); + it != req.end(); ++it) { + features.require(*it); + } + } + if (outputChanges) { bool dvipost = LaTeXFeatures::isAvailable("dvipost"); bool xcolorsoul = LaTeXFeatures::isAvailable("soul") && diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp index be4d36a258..887651d4c5 100644 --- a/src/LaTeXFeatures.cpp +++ b/src/LaTeXFeatures.cpp @@ -530,6 +530,10 @@ char const * simplefeatures[] = { "mathrsfs", "ascii", "url", + "covington", + "csquotes", + "enumitem", + "endnotes" }; int const nb_simplefeatures = sizeof(simplefeatures) / sizeof(char const *); @@ -542,6 +546,12 @@ string const LaTeXFeatures::getPackages() const ostringstream packages; TextClass const & tclass = params_.getTextClass(); + // FIXME: currently, we can only load packages and macros known + // to LyX. + // However, with the Require tag of layouts/custom insets, + // also inknown packages can be requested. They are silently + // swallowed now. We should change this eventually. + // // These are all the 'simple' includes. i.e // packages which we just \usepackage{package} @@ -832,15 +842,6 @@ docstring const LaTeXFeatures::getTClassPreamble() const tcpreamble << tclass[*cit]->preamble(); } - InsetLayouts const & insetlayouts = tclass.insetlayouts(); - InsetLayouts::const_iterator cit2 = insetlayouts.begin(); - InsetLayouts::const_iterator end2 = insetlayouts.end(); - for (; cit2 != end2; ++cit2) { - if (isRequired(to_utf8(cit2->first))) { - tcpreamble << from_utf8(cit2->second.preamble); - } - } - return tcpreamble.str(); } diff --git a/src/Layout.cpp b/src/Layout.cpp index 08ae3f1973..80c8550923 100644 --- a/src/Layout.cpp +++ b/src/Layout.cpp @@ -82,6 +82,7 @@ enum LayoutTags { LT_PARSKIP, //LT_PLAIN, LT_PREAMBLE, + LT_REQUIRES, LT_RIGHTMARGIN, LT_SPACING, LT_TOPSEP, @@ -179,6 +180,7 @@ bool Layout::read(Lexer & lexrc, TextClass const & tclass) { "parskip", LT_PARSKIP }, { "passthru", LT_PASS_THRU }, { "preamble", LT_PREAMBLE }, + { "requires", LT_REQUIRES }, { "rightmargin", LT_RIGHTMARGIN }, { "spacing", LT_SPACING }, { "textfont", LT_TEXTFONT }, @@ -484,6 +486,12 @@ bool Layout::read(Lexer & lexrc, TextClass const & tclass) case LT_SPACING: // setspace.sty readSpacing(lexrc); break; + + case LT_REQUIRES: + if (lexrc.eatLine()) + requires_ = getVectorFromString(lexrc.getString()); + break; + } } lexrc.popTable(); diff --git a/src/Layout.h b/src/Layout.h index 0e4943dab1..56e031fd59 100644 --- a/src/Layout.h +++ b/src/Layout.h @@ -19,6 +19,9 @@ #include "Spacing.h" #include "support/docstring.h" +#include +#include + namespace lyx { class Lexer; @@ -81,6 +84,8 @@ public: /// docstring const & preamble() const { return preamble_; } /// + std::vector const & requires() const { return requires_; } + /// std::string const & latexparam() const { return latexparam_; } /// std::string const & innertag() const { return innertag_; } @@ -250,6 +255,8 @@ private: std::string itemtag_; /// Macro definitions needed for this layout docstring preamble_; + /// Packages needed for this layout + std::vector requires_; }; } // namespace lyx diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp index ffa24215f7..498c5c1c2c 100644 --- a/src/Paragraph.cpp +++ b/src/Paragraph.cpp @@ -999,6 +999,13 @@ void Paragraph::Private::validate(LaTeXFeatures & features, // then the layouts features.useLayout(layout.name()); + if (!layout.requires().empty()) { + vector req = layout.requires(); + for (vector::const_iterator it = req.begin(); + it != req.end(); ++it) { + features.require(*it); + } + } // then the fonts fontlist_.validate(features); diff --git a/src/TextClass.cpp b/src/TextClass.cpp index 0c3ab8ba2e..80798dd502 100644 --- a/src/TextClass.cpp +++ b/src/TextClass.cpp @@ -56,7 +56,7 @@ private: }; -int const FORMAT = 5; +int const FORMAT = 6; bool layout2layout(FileName const & filename, FileName const & tempfile) @@ -150,6 +150,7 @@ enum TextClassTags { TC_CLASSOPTIONS, TC_PREAMBLE, TC_PROVIDES, + TC_REQUIRES, TC_LEFTMARGIN, TC_RIGHTMARGIN, TC_FLOAT, @@ -188,6 +189,7 @@ bool TextClass::read(FileName const & filename, ReadType rt) { "pagestyle", TC_PAGESTYLE }, { "preamble", TC_PREAMBLE }, { "provides", TC_PROVIDES }, + { "requires", TC_REQUIRES }, { "rightmargin", TC_RIGHTMARGIN }, { "secnumdepth", TC_SECNUMDEPTH }, { "sides", TC_SIDES }, @@ -203,7 +205,7 @@ bool TextClass::read(FileName const & filename, ReadType rt) break; case MERGE: LYXERR(Debug::TCLASS, "Reading input file "); - break; + break; case MODULE: LYXERR(Debug::TCLASS, "Reading module file "); break; @@ -391,6 +393,13 @@ bool TextClass::read(FileName const & filename, ReadType rt) break; } + case TC_REQUIRES: { + lexrc.eatLine(); + string const packages = lexrc.getString(); + requires_ = getVectorFromString(packages); + break; + } + case TC_LEFTMARGIN: // left margin type if (lexrc.next()) leftmargin_ = lexrc.getDocString(); @@ -609,6 +618,7 @@ enum InsetLayoutTags { IL_NEEDPROTECT, IL_PASSTHRU, IL_PREAMBLE, + IL_REQUIRES, IL_END }; @@ -632,7 +642,8 @@ void TextClass::readInsetLayout(Lexer & lexrc, docstring const & name) { "multipar", IL_MULTIPAR }, { "needprotect", IL_NEEDPROTECT }, { "passthru", IL_PASSTHRU }, - { "preamble", IL_PREAMBLE } + { "preamble", IL_PREAMBLE }, + { "requires", IL_REQUIRES } }; lexrc.pushTable(elementTags, IL_END); @@ -647,6 +658,7 @@ void TextClass::readInsetLayout(Lexer & lexrc, docstring const & name) FontInfo labelfont = inherit_font; ColorCode bgcolor(Color_background); string preamble; + vector requires; bool multipar = false; bool passthru = false; bool needprotect = false; @@ -659,7 +671,7 @@ void TextClass::readInsetLayout(Lexer & lexrc, docstring const & name) int le = lexrc.lex(); switch (le) { case Lexer::LEX_UNDEF: - lexrc.printError("Unknown ClassOption tag `$$Token'"); + lexrc.printError("Unknown InsetLayout tag `$$Token'"); continue; default: break; } @@ -729,6 +741,12 @@ void TextClass::readInsetLayout(Lexer & lexrc, docstring const & name) case IL_PREAMBLE: preamble = lexrc.getLongString("EndPreamble"); break; + case IL_REQUIRES: { + lexrc.eatLine(); + string const packages = lexrc.getString(); + requires = getVectorFromString(packages); + break; + } case IL_END: getout = true; break; @@ -756,8 +774,9 @@ void TextClass::readInsetLayout(Lexer & lexrc, docstring const & name) // any realization against a given context. labelfont.realize(sane_font); il.labelfont = labelfont; - il.bgcolor = bgcolor; + il.bgcolor = bgcolor; il.preamble = preamble; + il.requires = requires; insetlayoutlist_[name] = il; } @@ -809,7 +828,7 @@ void TextClass::readFloat(Lexer & lexrc) int le = lexrc.lex(); switch (le) { case Lexer::LEX_UNDEF: - lexrc.printError("Unknown ClassOption tag `$$Token'"); + lexrc.printError("Unknown float tag `$$Token'"); continue; default: break; } @@ -909,7 +928,7 @@ void TextClass::readCounter(Lexer & lexrc) int le = lexrc.lex(); switch (le) { case Lexer::LEX_UNDEF: - lexrc.printError("Unknown ClassOption tag `$$Token'"); + lexrc.printError("Unknown counter tag `$$Token'"); continue; default: break; } diff --git a/src/TextClass.h b/src/TextClass.h index 2cecdb5751..670bc5694b 100644 --- a/src/TextClass.h +++ b/src/TextClass.h @@ -137,6 +137,8 @@ public: /// is this feature already provided by the class? bool provides(std::string const & p) const; + /// features required by the class? + std::vector requires() const { return requires_; } /// unsigned int columns() const; @@ -202,6 +204,8 @@ private: docstring preamble_; /// latex packages loaded by document class. std::set provides_; + /// latex packages requested by document class. + std::vector requires_; /// unsigned int columns_; /// diff --git a/src/insets/InsetFlex.cpp b/src/insets/InsetFlex.cpp index 605d93db1d..e2a6cacbe5 100644 --- a/src/insets/InsetFlex.cpp +++ b/src/insets/InsetFlex.cpp @@ -22,6 +22,7 @@ #include "FuncStatus.h" #include "Cursor.h" #include "support/gettext.h" +#include "LaTeXFeatures.h" #include "Lexer.h" #include "Text.h" #include "MetricsInfo.h" @@ -46,6 +47,8 @@ InsetFlex::InsetFlex(BufferParams const & bp, : InsetCollapsable(bp, Collapsed, &il) { name_ = il.name; + packages_ = il.requires; + preamble_ = il.preamble; } @@ -136,4 +139,17 @@ void InsetFlex::textString(Buffer const & buf, odocstream & os) const os << paragraphs().begin()->asString(buf, true); } + +void InsetFlex::validate(LaTeXFeatures & features) const +{ + if (!preamble_.empty()) + features.addPreambleSnippet(preamble_); + if (packages_.empty()) + return; + for (vector::const_iterator it = packages_.begin(); + it != packages_.end(); ++it) { + features.require(*it); + } +} + } // namespace lyx diff --git a/src/insets/InsetFlex.h b/src/insets/InsetFlex.h index 0de70be84a..4ac50dcd05 100644 --- a/src/insets/InsetFlex.h +++ b/src/insets/InsetFlex.h @@ -51,6 +51,8 @@ public: OutputParams const &) const; /// the string that is passed to the TOC virtual void textString(Buffer const &, odocstream &) const; + /// + void validate(LaTeXFeatures &) const; /// should paragraph indendation be ommitted in any case? bool neverIndent(Buffer const &) const { return true; } @@ -63,6 +65,10 @@ private: /// std::string name_; + /// + std::vector packages_; + /// + std::string preamble_; }; diff --git a/src/insets/InsetLayout.h b/src/insets/InsetLayout.h index 0e118f1c5a..f4921ff295 100644 --- a/src/insets/InsetLayout.h +++ b/src/insets/InsetLayout.h @@ -15,6 +15,9 @@ #include "support/docstring.h" +#include +#include + namespace lyx { /// @@ -31,6 +34,7 @@ public: FontInfo labelfont; ColorCode bgcolor; std::string preamble; + std::vector requires; bool multipar; bool passthru; bool needprotect; -- 2.39.5