diff --git a/src/ChangeLog b/src/ChangeLog index 083e00ff8c..0b6b389495 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2003-12-01 Martin Vermeer + + * lyxtextclass.[Ch]: add latexparam to CharStyle inset + 2003-12-01 Michael Schmitt * vspace.[Ch]: remove VSpace::NONE diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index baeee6150d..39bceff435 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,4 +1,8 @@ +2003-12-01 Martin Vermeer + + * insetcharstyle.[Ch]: add latexparam to CharStyle inset + 2003-12-01 Martin Vermeer * insetcollapsable.[Ch]: diff --git a/src/insets/insetcharstyle.C b/src/insets/insetcharstyle.C index 709694bbe7..3a24c12cda 100644 --- a/src/insets/insetcharstyle.C +++ b/src/insets/insetcharstyle.C @@ -49,6 +49,7 @@ InsetCharStyle::InsetCharStyle(BufferParams const & bp, params_.type = cs->name; params_.latextype = cs->latextype; params_.latexname = cs->latexname; + params_.latexparam = cs->latexparam; params_.font = cs->font; params_.labelfont = cs->labelfont; init(); @@ -153,7 +154,10 @@ int outputVerbatim(std::ostream & os, InsetText inset) int InsetCharStyle::latex(Buffer const &, ostream & os, OutputParams const &) const { - os << "%\n\\" << params_.latexname << "{"; + os << "%\n\\" << params_.latexname; + if (!params_.latexparam.empty()) + os << params_.latexparam; + os << "{"; int i = outputVerbatim(os, inset); os << "}%\n"; i += 2; @@ -164,7 +168,10 @@ int InsetCharStyle::latex(Buffer const &, ostream & os, int InsetCharStyle::linuxdoc(Buffer const &, std::ostream & os, OutputParams const &) const { - os << "<" << params_.latexname << ">"; + os << "<" << params_.latexname; + if (!params_.latexparam.empty()) + os << " " << params_.latexparam; + os << ">"; int const i = outputVerbatim(os, inset); os << ""; return i; @@ -174,7 +181,10 @@ int InsetCharStyle::linuxdoc(Buffer const &, std::ostream & os, int InsetCharStyle::docbook(Buffer const &, std::ostream & os, OutputParams const &) const { - os << "<" << params_.latexname << ">"; + os << "<" << params_.latexname; + if (!params_.latexparam.empty()) + os << " " << params_.latexparam; + os << ">"; int const i = outputVerbatim(os, inset); os << ""; return i; diff --git a/src/insets/insetcharstyle.h b/src/insets/insetcharstyle.h index 8b3ea9c2b1..c4fcad9708 100644 --- a/src/insets/insetcharstyle.h +++ b/src/insets/insetcharstyle.h @@ -30,6 +30,8 @@ /// std::string latexname; /// + std::string latexparam; + /// LyXFont font; /// LyXFont labelfont; diff --git a/src/lyxtextclass.C b/src/lyxtextclass.C index 6a5d6fc688..14e89546a8 100644 --- a/src/lyxtextclass.C +++ b/src/lyxtextclass.C @@ -525,6 +525,7 @@ enum CharStyleTags { CS_LABELFONT, CS_LATEXTYPE, CS_LATEXNAME, + CS_LATEXPARAM, CS_PREAMBLE, CS_END }; @@ -537,6 +538,7 @@ void LyXTextClass::readCharStyle(LyXLex & lexrc, string const & name) { "font", CS_FONT }, { "labelfont", CS_LABELFONT }, { "latexname", CS_LATEXNAME }, + { "latexparam", CS_LATEXPARAM }, { "latextype", CS_LATEXTYPE }, { "preamble", CS_PREAMBLE} }; @@ -545,6 +547,7 @@ void LyXTextClass::readCharStyle(LyXLex & lexrc, string const & name) string latextype; string latexname; + string latexparam; LyXFont font(LyXFont::ALL_INHERIT); LyXFont labelfont(LyXFont::ALL_INHERIT); string preamble; @@ -567,6 +570,10 @@ void LyXTextClass::readCharStyle(LyXLex & lexrc, string const & name) lexrc.next(); latexname = lexrc.getString(); break; + case CS_LATEXPARAM: + lexrc.next(); + latexparam = subst(lexrc.getString(), """, "\""); + break; case CS_LABELFONT: labelfont.lyxRead(lexrc); break; @@ -590,6 +597,7 @@ void LyXTextClass::readCharStyle(LyXLex & lexrc, string const & name) cs.name = name; cs.latextype = latextype; cs.latexname = latexname; + cs.latexparam = latexparam; cs.font = font; cs.labelfont = labelfont; cs.preamble = preamble; diff --git a/src/lyxtextclass.h b/src/lyxtextclass.h index e190af915e..fd4eeb986a 100644 --- a/src/lyxtextclass.h +++ b/src/lyxtextclass.h @@ -27,6 +27,7 @@ struct CharStyle { std::string name; std::string latextype; std::string latexname; + std::string latexparam; LyXFont font; LyXFont labelfont; std::string preamble;