Size Small
EndFont
MultiPar true
+ NeedProtect true
HTMLTag span
HTMLAttr class='marginal'
HTMLStyle
InsetLayout Index
LabelString Idx
- LatexType command
- LatexName index
Decoration classic
Font
Color foreground
MultiPar false
CustomPars false
ForcePlain true
- NeedProtect true
End
InsetLayout Box
InsetLayout URL
LyXType standard
- LatexName url
- LatexType command
Decoration classic
LabelString URL
+ LatexName url
+ LatexType command
+ Requires url
+ MultiPar false
+ CustomPars false
+ ForcePlain true
PassThru true
+ FreeSpacing true
ForceLTR true
Font
Family Typewriter
Color urllabel
Size Small
EndFont
- Requires url
End
InsetLayout OptArg
#include "InsetLayout.h"
#include "InsetList.h"
#include "Language.h"
-#include "LaTeXFeatures.h"
#include "Lexer.h"
#include "MetricsInfo.h"
#include "output_xhtml.h"
+#include "OutputParams.h"
#include "paragraph_funcs.h"
#include "ParagraphParameters.h"
#include "sgml.h"
}
-int InsetCollapsable::latex(odocstream & os,
- OutputParams const & runparams) const
-{
- // This implements the standard way of handling the LaTeX output of
- // a collapsable inset, either a command or an environment. Standard
- // collapsable insets should not redefine this, non-standard ones may
- // call this.
- InsetLayout const & il = getLayout();
- if (!il.latexname().empty()) {
- if (il.latextype() == InsetLayout::COMMAND) {
- // FIXME UNICODE
- if (runparams.moving_arg)
- os << "\\protect";
- os << '\\' << from_utf8(il.latexname());
- if (!il.latexparam().empty())
- os << from_utf8(il.latexparam());
- os << '{';
- } else if (il.latextype() == InsetLayout::ENVIRONMENT) {
- os << "%\n\\begin{" << from_utf8(il.latexname()) << "}\n";
- if (!il.latexparam().empty())
- os << from_utf8(il.latexparam());
- }
- }
- OutputParams rp = runparams;
- if (il.isPassThru())
- rp.verbatim = true;
- if (il.isNeedProtect())
- rp.moving_arg = true;
- int i = InsetText::latex(os, rp);
- if (!il.latexname().empty()) {
- if (il.latextype() == InsetLayout::COMMAND) {
- os << "}";
- } else if (il.latextype() == InsetLayout::ENVIRONMENT) {
- os << "\n\\end{" << from_utf8(il.latexname()) << "}\n";
- i += 4;
- }
- }
- return i;
-}
-
-
// FIXME It seems as if it ought to be possible to do this more simply,
// maybe by calling InsetText::docbook() in the middle there.
int InsetCollapsable::docbook(odocstream & os, OutputParams const & runparams) const
}
-void InsetCollapsable::validate(LaTeXFeatures & features) const
-{
- features.useInsetLayout(getLayout());
- InsetText::validate(features);
-}
-
-
bool InsetCollapsable::undefined() const
{
docstring const & n = getLayout().name();
///
ColorCode labelColor() const { return getLayout().labelfont().color(); }
///
- int latex(odocstream &, OutputParams const &) const;
- ///
int docbook(odocstream &, OutputParams const &) const;
/// It will rarely be right to call this from subclasses, due
/// to the fact that it steps counters, etc. Instead, call
/// InsetText::xhtml().
docstring xhtml(odocstream &, OutputParams const &) const;
///
- void validate(LaTeXFeatures &) const;
- ///
InsetCode lyxCode() const { return COLLAPSABLE_CODE; }
///
}
-int InsetMarginal::latex(odocstream & os, OutputParams const & runparams) const
-{
- os << "%\n";
- if (runparams.moving_arg)
- os << "\\protect";
- os << "\\marginpar{";
- int const i = InsetText::latex(os, runparams);
- os << "%\n}";
- return i + 2;
-}
-
-
int InsetMarginal::plaintext(odocstream & os,
OutputParams const & runparams) const
{
///
docstring name() const { return from_ascii("Marginal"); }
///
- int latex(odocstream &, OutputParams const &) const;
- ///
int plaintext(odocstream &, OutputParams const & runparams) const;
///
int docbook(odocstream &, OutputParams const & runparams) const;
#include "InsetList.h"
#include "Intl.h"
#include "Language.h"
+#include "LaTeXFeatures.h"
#include "Lexer.h"
#include "lyxfind.h"
#include "LyXRC.h"
int InsetText::latex(odocstream & os, OutputParams const & runparams) const
{
+ // This implements the standard way of handling the LaTeX
+ // output of a text inset, either a command or an
+ // environment. Standard collapsable insets should not
+ // redefine this, non-standard ones may call this.
+ InsetLayout const & il = getLayout();
+ int rows = 0;
+ if (!il.latexname().empty()) {
+ if (il.latextype() == InsetLayout::COMMAND) {
+ // FIXME UNICODE
+ if (runparams.moving_arg)
+ os << "\\protect";
+ os << '\\' << from_utf8(il.latexname());
+ if (!il.latexparam().empty())
+ os << from_utf8(il.latexparam());
+ os << '{';
+ } else if (il.latextype() == InsetLayout::ENVIRONMENT) {
+ os << "%\n\\begin{" << from_utf8(il.latexname()) << "}\n";
+ if (!il.latexparam().empty())
+ os << from_utf8(il.latexparam());
+ rows += 2;
+ }
+ }
+ OutputParams rp = runparams;
+ if (il.isPassThru())
+ rp.verbatim = true;
+ if (il.isNeedProtect())
+ rp.moving_arg = true;
+
+ // Output the contents of the inset
TexRow texrow;
- latexParagraphs(buffer(), text_, os, texrow, runparams);
- return texrow.rows();
+ latexParagraphs(buffer(), text_, os, texrow, rp);
+ rows += texrow.rows();
+
+ if (!il.latexname().empty()) {
+ if (il.latextype() == InsetLayout::COMMAND) {
+ os << "}";
+ } else if (il.latextype() == InsetLayout::ENVIRONMENT) {
+ os << "\n\\end{" << from_utf8(il.latexname()) << "}\n";
+ rows += 2;
+ }
+ }
+ return rows;
}
void InsetText::validate(LaTeXFeatures & features) const
{
+ features.useInsetLayout(getLayout());
for_each(paragraphs().begin(), paragraphs().end(),
bind(&Paragraph::validate, _1, ref(features)));
}