The branch, master, has been updated.

- Log -----------------------------------------------------------------

commit 9cbba74a62bce39c5128800474edcb45028a6df2
Author: Juergen Spitzmueller <[email protected]>
Date:   Sat Feb 9 11:00:42 2013 +0100

    Preamble tag for LaTeXFonts (#8530)

diff --git a/lib/latexfonts b/lib/latexfonts
index 4898c18..b840784 100644
--- a/lib/latexfonts
+++ b/lib/latexfonts
@@ -22,6 +22,9 @@
 #      OsfScOption        <option for combined osf and true smallcaps support>
 #      ScaleOption        <option for font scaling>
 #      Provides           <features provided by the font packages 
(comma-separated)>
+#      Preamble
+#        <some arbitrary LaTeX code to be issued in the preamble>
+#      EndPreamble
 # EndFont
 #
 #
@@ -53,8 +56,8 @@
 #   The value "none" tells LyX not to load any font in OT1 encoding.
 #   OT1Fonts need to be defined separately using AltFont ... EndFont tags.
 # * The CompleteFont is loaded if the current font is selected as rm and
-#   both sf and tt are set to "default" (this allows f. ex. to load "bera"
-#   as opposed to "beraserif").
+#   both sf and tt are set to "default" (this allows for instance to load
+#   "bera" as opposed to "beraserif").
 #   CompleteFonts need to be defined separately using AltFont ... EndFont
 #   tags.
 # * OsfFont is a font that is loaded additionally in and that provides
@@ -65,9 +68,12 @@
 #   default and provide an option for lining figures. Pass this option
 #   to OsfOption.
 # * ScaleOption supports the placeholder $$val for the scale value.
+# * The Preamble code is output immediately after the respective font
+#   loading command.
 #
 ##########################################################################
 
+
 #
 # ROMAN FONTS
 #
diff --git a/src/LaTeXFonts.cpp b/src/LaTeXFonts.cpp
index c837815..4cc1b82 100644
--- a/src/LaTeXFonts.cpp
+++ b/src/LaTeXFonts.cpp
@@ -275,6 +275,9 @@ string const LaTeXFont::getLaTeXCode(bool dryrun, bool ot1, 
bool complete, bool
        if (osf && providesOSF(ot1, complete, nomath) && !osffont_.empty())
                os << altFont(osffont_).getLaTeXCode(dryrun, ot1, complete, sc, 
osf, nomath, scale);
 
+       if (!preamble_.empty())
+               os << preamble_;
+
        return os.str();
 }
 
@@ -295,6 +298,7 @@ bool LaTeXFont::readFont(Lexer & lex)
                LF_OT1_FONT,
                LF_PACKAGE,
                LF_PACKAGEOPTION,
+               LF_PREAMBLE,
                LF_PROVIDES,
                LF_REQUIRES,
                LF_SCALEOPTION,
@@ -317,6 +321,7 @@ bool LaTeXFont::readFont(Lexer & lex)
                { "ot1font",              LF_OT1_FONT },
                { "package",              LF_PACKAGE },
                { "packageoption",        LF_PACKAGEOPTION },
+               { "preamble",             LF_PREAMBLE },
                { "provides",             LF_PROVIDES },
                { "requires",             LF_REQUIRES },
                { "scaleoption",          LF_SCALEOPTION },
@@ -386,6 +391,9 @@ bool LaTeXFont::readFont(Lexer & lex)
                case LF_PACKAGEOPTION:
                        lex >> packageoption_;
                        break;
+               case LF_PREAMBLE:
+                       preamble_ = lex.getLongString("EndPreamble");
+                       break;
                case LF_PROVIDES: {
                        lex.eatLine();
                        string features = lex.getString();
diff --git a/src/LaTeXFonts.h b/src/LaTeXFonts.h
index d79d456..f4f09b7 100644
--- a/src/LaTeXFonts.h
+++ b/src/LaTeXFonts.h
@@ -127,6 +127,8 @@ private:
        ///
        docstring requires_;
        ///
+       std::string preamble_;
+       ///
        bool osfdefault_;
        ///
        bool switchdefault_;

-----------------------------------------------------------------------

Summary of changes:
 lib/latexfonts     |   10 ++++++++--
 src/LaTeXFonts.cpp |    8 ++++++++
 src/LaTeXFonts.h   |    2 ++
 3 files changed, 18 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
The LyX Source Repository

Reply via email to