#include "InsetList.h"
#include "LaTeXFeatures.h"
#include "Length.h"
+#include "LyX.h"
#include "MetricsInfo.h"
+#include "output_xhtml.h"
#include "sgml.h"
#include "frontends/FontMetrics.h"
//
/////////////////////////////////////////////////////////////////////
-InsetNomencl::InsetNomencl(InsetCommandParams const & p)
- : InsetCommand(p, "nomenclature"),
+InsetNomencl::InsetNomencl(Buffer * buf, InsetCommandParams const & p)
+ : InsetCommand(buf, p, "nomenclature"),
nomenclature_entry_id(sgml::uniqueID(from_ascii("nomen")))
{}
}
+docstring InsetNomencl::xhtml(XHTMLStream &, OutputParams const &) const
+{
+ return docstring();
+}
+
+
int InsetNomencl::docbookGlossary(odocstream & os) const
{
os << "<glossentry id=\"" << nomenclature_entry_id << "\">\n"
//
/////////////////////////////////////////////////////////////////////
-InsetPrintNomencl::InsetPrintNomencl(InsetCommandParams const & p)
- : InsetCommand(p, "nomencl_print")
+InsetPrintNomencl::InsetPrintNomencl(Buffer * buf, InsetCommandParams const & p)
+ : InsetCommand(buf, p, "nomencl_print")
{}
}
+docstring InsetPrintNomencl::xhtml(XHTMLStream &, OutputParams const &) const
+{
+ return docstring();
+}
+
int InsetPrintNomencl::docbook(odocstream & os, OutputParams const &) const
{
nomencl->getParam("symbol");
// This is only an approximation,
// but the best we can get.
- int const wx =
- theFontMetrics(Font()).width(symbol);
+ int const wx = use_gui ?
+ theFontMetrics(Font()).width(symbol) :
+ symbol.size();
if (wx > w) {
w = wx;
symb = symbol;
int lines = 0;
if (getParam("set_width") == "auto") {
docstring widest = nomenclWidest(buffer());
- // set the label width via nomencl's command
- // \nomlabelwidth. This must be output before the command
- // \printnomenclature
+ // Set the label width via nomencl's command \nomlabelwidth.
+ // This must be output before the command \printnomenclature
if (!widest.empty()) {
- // assure that the width is never below the
- // predefined value of 1 cm
- // FIXME: Why this?
os << "\\settowidth{\\nomlabelwidth}{"
<< widest
<< "}\n";
- os << "\\ifthenelse{%\n";
- os << "\\lengthtest{\\nomlabelwidth < 1cm}}\n";
- os << " {\\setlength{\\nomlabelwidth}{1cm}}\n";
- os << " {}\n";
- lines += 5;
+ ++lines;
}
} else if (getParam("set_width") == "custom") {
// custom length as optional arg of \printnomenclature
void InsetPrintNomencl::validate(LaTeXFeatures & features) const
{
features.require("nomencl");
- // needed for InsetPrintNomencl::latex
- features.require("ifthen");
}