]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetNomencl.cpp
Routines for calculating numerical labels for BibTeX citations.
[lyx.git] / src / insets / InsetNomencl.cpp
index 33c7366557a630dea28d2e18c280d579429d30c6..306498feb6338ba4fb97c0d69d2f7fcdacaedbb1 100644 (file)
@@ -26,6 +26,7 @@
 #include "Length.h"
 #include "LyX.h"
 #include "MetricsInfo.h"
+#include "output_xhtml.h"
 #include "sgml.h"
 
 #include "frontends/FontMetrics.h"
@@ -46,8 +47,8 @@ namespace lyx {
 //
 /////////////////////////////////////////////////////////////////////
 
-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")))
 {}
 
@@ -98,6 +99,12 @@ int InsetNomencl::docbook(odocstream & os, OutputParams const &) const
 }
 
 
+docstring InsetNomencl::xhtml(XHTMLStream &, OutputParams const &) const
+{
+       return docstring();
+}
+
+
 int InsetNomencl::docbookGlossary(odocstream & os) const
 {
        os << "<glossentry id=\"" << nomenclature_entry_id << "\">\n"
@@ -124,8 +131,8 @@ void InsetNomencl::validate(LaTeXFeatures & features) const
 //
 /////////////////////////////////////////////////////////////////////
 
-InsetPrintNomencl::InsetPrintNomencl(InsetCommandParams const & p)
-       : InsetCommand(p, "nomencl_print")
+InsetPrintNomencl::InsetPrintNomencl(Buffer * buf, InsetCommandParams const & p)
+       : InsetCommand(buf, p, "nomencl_print")
 {}
 
 
@@ -192,6 +199,11 @@ bool InsetPrintNomencl::getStatus(Cursor & cur, FuncRequest const & cmd,
 }
 
 
+docstring InsetPrintNomencl::xhtml(XHTMLStream &, OutputParams const &) const
+{
+       return docstring();
+}
+
 
 int InsetPrintNomencl::docbook(odocstream & os, OutputParams const &) const
 {
@@ -264,20 +276,12 @@ int InsetPrintNomencl::latex(odocstream & os, OutputParams const &) const
        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
+               // This must be output before the command \printnomenclature
                if (!widest.empty()) {
-                       // assure that the width is never below the
-                       // value predefined in nomencl.cfg
-                       os << "\\newlength{\\symbwidth}\n";
-                       os << "\\settowidth{\\symbwidth}{"
+                       os << "\\settowidth{\\nomlabelwidth}{"
                           << widest
                           << "}\n";
-                       os << "\\ifthenelse{%\n";
-                       os << "\\lengthtest{\\symbwidth < \\nomlabelwidth}}\n";
-                       os << " {\\setlength{\\symbwidth}{\\nomlabelwidth}}\n";
-                       os << " {}\n";
-                       lines += 6;
+                       ++lines;
                }
        } else if (getParam("set_width") == "custom") {
                // custom length as optional arg of \printnomenclature
@@ -299,8 +303,6 @@ int InsetPrintNomencl::latex(odocstream & os, OutputParams const &) const
 void InsetPrintNomencl::validate(LaTeXFeatures & features) const
 {
        features.require("nomencl");
-       // needed for InsetPrintNomencl::latex
-       features.require("ifthen");
 }