]> git.lyx.org Git - lyx.git/commitdiff
Add support for the nomentbl nomenclature option
authorJuergen Spitzmueller <spitz@lyx.org>
Wed, 21 Aug 2024 15:35:48 +0000 (17:35 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Wed, 21 Aug 2024 15:39:36 +0000 (17:39 +0200)
file format change

18 files changed:
development/FORMAT
lib/doc/UserGuide.lyx
lib/doc/de/UserGuide.lyx
lib/layouts/stdinsets.inc
lib/lyx2lyx/lyx_2_5.py
src/BufferParams.cpp
src/BufferParams.h
src/LaTeXFeatures.cpp
src/frontends/qt/GuiDocument.cpp
src/frontends/qt/GuiIndices.cpp
src/frontends/qt/GuiIndices.h
src/frontends/qt/ui/IndicesUi.ui
src/insets/InsetNomencl.cpp
src/insets/InsetNomencl.h
src/tex2lyx/Preamble.cpp
src/tex2lyx/Preamble.h
src/tex2lyx/text.cpp
src/version.h

index 830c45ae45dd389ad2785520d3309a6894c09dbf..d7146861d32d0856f5016cd0689a38b0245267eb 100644 (file)
@@ -7,6 +7,11 @@ changes happened in particular if possible. A good example would be
 
 -----------------------
 
+2024-08-21 Jürgen Spitzmüller <spitz@lyx.org> 
+       * Format incremented to 628: Add support for nomentbl-style
+         nomencl insets:
+         \nomenclature[<prefix>]{<symbol>}{<description>}{<units>}{<note>}
+
 2024-08-12 Jürgen Spitzmüller <spitz@lyx.org> 
        * Format incremented to 627: Transform nomenclature inset to
          collapsible.
index 993758fa05f86047a09639e7af1a8cfc2477e1b5..72640e7be1cb644527441ce998e9b1e9c5f7e831 100644 (file)
@@ -36723,7 +36723,16 @@ Nom
 \end_layout
 
 \begin_layout Standard
-A nomenclature entry consists of two main entries.
+
+\change_inserted -712698321 1724253386
+By default,
+\change_deleted -712698321 1724253387
+A
+\change_inserted -712698321 1724253387
+a
+\change_unchanged
+ nomenclature entry consists of two main entries.
  The first is the term or 
 \family sans
 Symbol
@@ -36735,7 +36744,7 @@ Description
 \family default
  of the term or symbol.
 
-\change_inserted -712698321 1723454817
+\change_inserted -712698321 1724253392
  The former is inserted into the collapsible inset directly,
  the latter into the 
 \family sans
@@ -36744,6 +36753,44 @@ Description
  sub-inset which is automatically inserted or can be inserted via the 
 \family sans
 Insert
+\family default
+ menu.
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted -712698321 1724253593
+In addition to this,
+ you can select a 
+\begin_inset Quotes eld
+\end_inset
+
+Tabular
+\begin_inset Quotes erd
+\end_inset
+
+ nomenclature style in 
+\family sans
+Document\SpecialChar menuseparator
+Settings\SpecialChar menuseparator
+Indexes & Nomenclature
+\family default
+.
+ With this,
+ the nomenclature is set as a multi-page table (with four columns) rather than a list,
+ and it provides two more entries:
+\emph on
+unit
+\emph default
+ (for units of all kinds) and 
+\emph on
+note
+\emph default
+ (for additional notes).
+ These two entries can also be selected via the 
+\family sans
+Insert
 \family default
  menu.
 \change_unchanged
@@ -52215,6 +52262,10 @@ nolink "false"
 
 \begin_layout Section
 Indexes
+\change_inserted -712698321 1724253284
+ & Nomenclature
+\change_unchanged
+
 \end_layout
 
 \begin_layout Standard
@@ -52235,6 +52286,27 @@ nolink "false"
 \end_inset
 
  for details).
+
+\change_inserted -712698321 1724253333
+ Moreover,
+ you can select a nomenclature style (see section
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "sec:Nomenclature"
+plural "false"
+caps "false"
+noprefix "false"
+nolink "false"
+
+\end_inset
+
+ for details).
+\change_unchanged
+
 \end_layout
 
 \begin_layout Section
index 0b1c9ec92d2b0c4cfbb2cb01a16d4a811c1fb546..9f1145fdd6ed545413372167ec773a76ec8f3002 100644 (file)
@@ -35876,7 +35876,7 @@ Nom
  wird eingefügt.
  Falls der Cursor direkt hinter einem Wort steht,
  wird dieses hineinkopiert.
- Ein Nomenklatur-Eintrag besteht aus zwei Hauptteilen:
+ Ein Nomenklatur-Eintrag besteht im Standard-Stil aus zwei Hauptteilen:
  das 
 \family sans
 Symbol
@@ -35894,6 +35894,39 @@ Beschreibung
 .
 \end_layout
 
+\begin_layout Standard
+Wenn Sie in 
+\family sans
+Dokument\SpecialChar menuseparator
+Einstellungen\SpecialChar menuseparator
+Stichwortverzeichnis & Nomenklatur
+\family default
+ den Nomenklatur-Stil 
+\begin_inset Quotes gld
+\end_inset
+
+Tabelle
+\begin_inset Quotes grd
+\end_inset
+
+ auswählen,
+ wird das Verzeichnis als mehrseitige Tabelle und nicht als Liste gesetzt und Sie haben zwei weitere Teile:
+\family sans
+Einheit
+\family default
+ (für Einheiten aller Art) und 
+\family sans
+Anmerkung
+\family default
+ (für zusätzliche Informationen).
+ Diese können Sie im Menü 
+\family sans
+Einfügen
+\family default
+ auswählen.
+\end_layout
+
 \begin_layout Subsection
 Nomenklaturdefinition und Layout
 \begin_inset Index idx
@@ -50592,7 +50625,7 @@ nolink "false"
 \end_layout
 
 \begin_layout Section
-Stichwortverzeichnis
+Stichwortverzeichnis & Nomenklatur
 \end_layout
 
 \begin_layout Standard
@@ -50614,6 +50647,22 @@ nolink "false"
 \end_inset
 
  für Details).
+ Außerdem können Sie hier einen Nomenklatur-Stil auswählen (siehe Abschnitt
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "sec:Nomenklatur/Glossar"
+plural "false"
+caps "false"
+noprefix "false"
+nolink "false"
+
+\end_inset
+
+ für Einzelheiten).
 \end_layout
 
 \begin_layout Section
index 000a0d696a945bf97f70f9be818d3c9d36fe97b3..135a5a473872439bacd58582a090fc718a11217f 100644 (file)
@@ -486,6 +486,22 @@ InsetLayout Nomenclature
        InsertCotext          1
 End
 
+InsetLayout Nomenclature:nomentbl
+       CopyStyle             Nomenclature
+       Argument post:2
+         LabelString         "Unit"
+         Tooltip             "Nomenclature unit"
+         AutoInsert          1
+         Mandatory           1
+       EndArgument
+       Argument post:3
+         LabelString         "Note"
+         Tooltip             "Nomenclature note"
+         AutoInsert          1
+         Mandatory           1
+       EndArgument
+End
+
 InsetLayout Box
        InheritFont           false
        LabelFont
index e3de465948e43587fd4993b6f62cd39bf4f6d2f1..cd224fe946991d836446c150fceb16cc45786e2f 100644 (file)
@@ -713,6 +713,152 @@ def revert_index_sc(document):
                 k += len(repl)
         i += 1
 
+
+def revert_nomentbl(document):
+    """Revert nomentbl inset to ERT."""
+
+    i = find_token(document.header, "\\use_nomentbl", 0)
+    if i == -1:
+        document.warning("Malformed document! Missing \\use_nomentbl")
+        return
+    if get_value(document.header, "\\use_nomentbl", i) == 0:
+        # just remove header
+        del document.header[i]
+        return
+
+    # remove header
+    del document.header[i]
+
+    # revert insets to ERT
+    have_nomencl = False
+    i = 0
+    while True:
+        i = find_token(document.body, "\\begin_inset Nomenclature", i)
+        if i == -1:
+            break
+
+        have_nomencl = True
+        j = find_end_of_inset(document.body, i)
+        if j == -1:
+            document.warning(
+                "Malformed LyX document: Can't find end of command inset at line %d" % i
+            )
+            i += 1
+            continue
+
+        arg = find_token(document.body, "\\begin_inset Argument 1", i, j)
+        prefix = []
+        if arg != -1:
+            endarg = find_end_of_inset(document.body, arg)
+            argbeginPlain = find_token(
+                document.body, "\\begin_layout Plain Layout", arg, endarg
+            )
+            if argbeginPlain == -1:
+                document.warning("Malformed LyX document: Can't find optarg plain Layout")
+                continue
+            argendPlain = find_end_of_inset(document.body, argbeginPlain)
+            prefix = document.body[argbeginPlain + 1 : argendPlain - 2]
+
+            # remove Arg insets and paragraph, if it only contains this inset
+            if (
+                document.body[arg - 1] == "\\begin_layout Plain Layout"
+                and find_end_of_layout(document.body, arg - 1) == endarg + 3
+            ):
+                del document.body[arg - 1 : endarg + 4]
+            else:
+                del document.body[arg : endarg + 1]
+
+        j = find_end_of_inset(document.body, i)
+        arg = find_token(document.body, "\\begin_inset Argument post:1", i, j)
+        description = []
+        if arg != -1:
+            endarg = find_end_of_inset(document.body, arg)
+            argbeginPlain = find_token(
+                document.body, "\\begin_layout Plain Layout", arg, endarg
+            )
+            if argbeginPlain == -1:
+                document.warning("Malformed LyX document: Can't find arg post:1 plain Layout")
+                continue
+            argendPlain = find_end_of_inset(document.body, argbeginPlain)
+            description = document.body[argbeginPlain + 1 : argendPlain - 2]
+
+            # remove Arg insets and paragraph, if it only contains this inset
+            if (
+                document.body[arg - 1] == "\\begin_layout Plain Layout"
+                and find_end_of_layout(document.body, arg - 1) == endarg + 3
+            ):
+                del document.body[arg - 1 : endarg + 4]
+            else:
+                del document.body[arg : endarg + 1]
+
+        j = find_end_of_inset(document.body, i)
+        arg = find_token(document.body, "\\begin_inset Argument post:2", i, j)
+        unit = []
+        if arg != -1:
+            endarg = find_end_of_inset(document.body, arg)
+            argbeginPlain = find_token(
+                document.body, "\\begin_layout Plain Layout", arg, endarg
+            )
+            if argbeginPlain == -1:
+                document.warning("Malformed LyX document: Can't find arg post:2 plain Layout")
+                continue
+            argendPlain = find_end_of_inset(document.body, argbeginPlain)
+            unit = document.body[argbeginPlain + 1 : argendPlain - 2]
+
+            # remove Arg insets and paragraph, if it only contains this inset
+            if (
+                document.body[arg - 1] == "\\begin_layout Plain Layout"
+                and find_end_of_layout(document.body, arg - 1) == endarg + 3
+            ):
+                del document.body[arg - 1 : endarg + 4]
+            else:
+                del document.body[arg : endarg + 1]
+
+        j = find_end_of_inset(document.body, i)
+        arg = find_token(document.body, "\\begin_inset Argument post:3", i, j)
+        note = []
+        if arg != -1:
+            endarg = find_end_of_inset(document.body, arg)
+            argbeginPlain = find_token(
+                document.body, "\\begin_layout Plain Layout", arg, endarg
+            )
+            if argbeginPlain == -1:
+                document.warning("Malformed LyX document: Can't find arg post:3 plain Layout")
+                continue
+            argendPlain = find_end_of_inset(document.body, argbeginPlain)
+            note = document.body[argbeginPlain + 1 : argendPlain - 2]
+
+            # remove Arg insets and paragraph, if it only contains this inset
+            if (
+                document.body[arg - 1] == "\\begin_layout Plain Layout"
+                and find_end_of_layout(document.body, arg - 1) == endarg + 3
+            ):
+                del document.body[arg - 1 : endarg + 4]
+            else:
+                del document.body[arg : endarg + 1]
+
+        beginPlain = find_token(document.body, "\\begin_layout Plain Layout", i)
+        endPlain = find_end_of_layout(document.body, beginPlain)
+        symbol = document.body[beginPlain + 1 : endPlain]
+
+        # Replace command with ERT
+        res = put_cmd_in_ert(["\\nomenclature"])
+        if prefix:
+            res += put_cmd_in_ert(["["]) + prefix + put_cmd_in_ert(["]"])
+        res += put_cmd_in_ert(["{"]) + symbol + put_cmd_in_ert(["}{"]) \
+            + description + put_cmd_in_ert(["}{"]) + unit + put_cmd_in_ert(["}{"]) \
+            + note + put_cmd_in_ert(["}"])
+
+        j = find_end_of_inset(document.body, i)
+        document.body[i : j + 1] = res
+
+        i += 1
+        
+    if have_nomencl:
+        document.append_local_layout([r"### Inserted by lyx2lyx (nomencl) ###",
+                                      r"PackageOptions nomencl nomentbl"])
+
+
 ##
 # Conversion hub
 #
@@ -725,11 +871,13 @@ convert = [
     [624, [convert_biblatex_chicago]],
     [625, []],
     [626, []],
-    [627, [convert_nomencl, convert_index_sc]]
+    [627, [convert_nomencl, convert_index_sc]],
+    [628, []]
 ]
 
 
 revert = [
+    [627, [revert_nomentbl]],
     [626, [revert_nomencl, revert_index_sc]],
     [625, [revert_nomencl_textwidth]],
     [624, [revert_nptextcite]],
index c5b1027518a8ed358b06b85041d7f9a97fa8cfab..8f1563e5167aa1ca1e9df20cb8e0921f37cfce4f 100644 (file)
@@ -492,6 +492,7 @@ BufferParams::BufferParams()
        use_formatted_ref = false;
        use_minted = false;
        use_lineno = false;
+       use_nomentbl = false;
 
        // map current author
        author_map_[pimpl_->authorlist.get(0).bufferId()] = 0;
@@ -1211,6 +1212,8 @@ string BufferParams::readToken(Lexer & lex, string const & token,
                lex >> use_formatted_ref;
        } else if (token == "\\use_minted") {
                lex >> use_minted;
+       } else if (token == "\\use_nomentbl") {
+               lex >> use_nomentbl;
        } else if (token == "\\use_lineno") {
                lex >> use_lineno;
        } else if (token == "\\lineno_options") {
@@ -1439,6 +1442,7 @@ void BufferParams::writeFile(ostream & os, Buffer const * buf) const
           << "\n\\use_refstyle " << use_refstyle
           << "\n\\use_formatted_ref " << use_formatted_ref
           << "\n\\use_minted " << use_minted
+          << "\n\\use_nomentbl " << use_nomentbl
           << "\n\\use_lineno " << use_lineno
           << '\n';
 
index 15e65d0ef8d139850b0a07f52cddfa1c5b3d3b4d..bef948330c4f4bcb25781ad40503f68fae1eef16 100644 (file)
@@ -619,10 +619,12 @@ public:
        bool use_formatted_ref;
        /// use minted? or listings?
        bool use_minted;
-       //output line numbering
+       //output line numbering
        bool use_lineno;
-       //optional params for lineno package
+       //optional params for lineno package
        std::string lineno_opts;
+       /// use nomentbl nomenclature sty
+       bool use_nomentbl;
 
        /// Return true if language could be set to lang,
        /// otherwise return false and do not change language
index 3736953480752881d53756d85208157008273756..b4234372696d13071401a204b04d74548792cd6f 100644 (file)
@@ -1497,7 +1497,10 @@ string const LaTeXFeatures::getPackages() const
                            "\\usepackage{ulem}\n";
 
        if (mustProvide("nomencl")) {
-               packages << "\\usepackage{nomencl}\n";
+               packages << "\\usepackage";
+               if (params_.use_nomentbl)
+                       packages << "[nomentbl]";
+               packages << "{nomencl}\n";
                // Make it work with the new and old version of the package,
                // but don't use the compatibility option since it is
                // incompatible to other packages.
index 08e3fb05eff3bd8fa202af2b180fbc0032a0473b..5ab4c53b5b878305fd569c6f9cf60de5fbe1f8d6 100644 (file)
@@ -1836,7 +1836,7 @@ GuiDocument::GuiDocument(GuiView & lv)
        docPS->addPanel(changesModule, N_("Change Tracking"));
        docPS->addPanel(numberingModule, N_("Numbering & TOC"));
        docPS->addPanel(biblioModule, N_("Bibliography"));
-       docPS->addPanel(indicesModule, N_("Indexes"));
+       docPS->addPanel(indicesModule, N_("Indexes & Nomenclature"));
        docPS->addPanel(pdfSupportModule, N_("PDF Properties"));
        docPS->addPanel(mathsModule, N_("Math Options"));
        docPS->addPanel(floatModule, N_("Float Settings"));
index 6fa9cbc34ec8b6c0596217dbeab1c499f6ccbc08..2c3a0d78ce5890c675ba54b0f4b6af1abca36292 100644 (file)
@@ -62,6 +62,10 @@ GuiIndices::GuiIndices(QWidget * parent)
                indexCO->addItem(command, command);
        }
 
+       nomenclStyleCO->clear();
+       nomenclStyleCO->addItem(qt_("Default"), QString("default"));
+       nomenclStyleCO->addItem(qt_("Tabular"), QString("tabular"));
+
        indexOptionsLE->setValidator(new NoNewLineValidator(indexOptionsLE));
        newIndexLE->setValidator(new NoNewLineValidator(newIndexLE));
 }
@@ -104,7 +108,7 @@ void GuiIndices::update(BufferParams const & params, bool const readonly)
        string options =
                split(params.index_command, command, ' ');
 
-       int const pos = indexCO->findData(toqstr(command));
+       int pos = indexCO->findData(toqstr(command));
        if (pos != -1) {
                indexCO->setCurrentIndex(pos);
                indexOptionsLE->setText(toqstr(options).trimmed());
@@ -115,6 +119,9 @@ void GuiIndices::update(BufferParams const & params, bool const readonly)
                indexOptionsLE->clear();
        }
 
+       pos = (params.use_nomentbl) ? 1 : 0;
+       nomenclStyleCO->setCurrentIndex(pos);
+
        updateView();
 }
 
@@ -162,6 +169,8 @@ void GuiIndices::apply(BufferParams & params) const
        params.use_indices = multipleIndicesCB->isChecked();
        params.indiceslist() = indiceslist_;
 
+       params.use_nomentbl = nomenclStyleCO->currentIndex() == 1;
+
        string const index_command =
                fromqstr(indexCO->itemData(
                        indexCO->currentIndex()).toString());
@@ -300,6 +309,12 @@ void GuiIndices::toggleColor(QTreeWidgetItem * item)
        updateView();
 }
 
+
+void GuiIndices::on_nomenclStyleCO_activated(int)
+{
+       changed();
+}
+
 } // namespace frontend
 } // namespace lyx
 
index efaec8354f7884a9a3f12da939467aa05c2e7519..4ba15dbfa6731f2371f772d93992c1f8110e51e1 100644 (file)
@@ -54,6 +54,7 @@ protected Q_SLOTS:
        void on_indicesTW_itemSelectionChanged();
        void on_colorPB_clicked();
        void on_multipleIndicesCB_toggled(bool);
+       void on_nomenclStyleCO_activated(int);
 
 private:
        ///
index a7b92b90ad47be79dfeb2a7cce02932fb19066d1..ac7ed3a986a2ca3be0125096baa20187fca7f624 100644 (file)
@@ -1,78 +1,96 @@
-<ui version="4.0" >
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
  <class>IndicesUi</class>
- <widget class="QWidget" name="IndicesUi" >
-  <property name="geometry" >
+ <widget class="QWidget" name="IndicesUi">
+  <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>401</width>
-    <height>340</height>
+    <width>341</width>
+    <height>479</height>
    </rect>
   </property>
-  <property name="windowTitle" >
+  <property name="windowTitle">
    <string/>
   </property>
-  <layout class="QGridLayout" name="gridLayout" >
-   <item row="0" column="0" colspan="2" >
-    <widget class="QGroupBox" name="indexGB" >
-     <property name="toolTip" >
+  <layout class="QGridLayout" name="gridLayout_4">
+   <item row="1" column="0">
+    <widget class="QCheckBox" name="multipleIndicesCB">
+     <property name="toolTip">
+      <string>Check if you need multiple indexes (e.g., an Index of Names)</string>
+     </property>
+     <property name="text">
+      <string>&amp;Use multiple indexes</string>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="0">
+    <widget class="Line" name="line">
+     <property name="orientation">
+      <enum>Qt::Orientation::Horizontal</enum>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="0">
+    <widget class="QGroupBox" name="indexGB">
+     <property name="toolTip">
       <string>Here you can define an alternative index processor and specify its options.</string>
      </property>
-     <property name="title" >
+     <property name="title">
       <string>Index Generation</string>
      </property>
-     <property name="flat" >
+     <property name="flat">
       <bool>true</bool>
      </property>
-     <layout class="QGridLayout" name="gridLayout_2" >
-      <item row="0" column="0" >
-       <layout class="QHBoxLayout" name="horizontalLayout" >
+     <layout class="QGridLayout" name="gridLayout_2">
+      <item row="0" column="0">
+       <layout class="QHBoxLayout" name="horizontalLayout">
         <item>
-         <widget class="QLabel" name="indexLA" >
-          <property name="text" >
+         <widget class="QLabel" name="indexLA">
+          <property name="text">
            <string>&amp;Processor:</string>
           </property>
-          <property name="buddy" >
+          <property name="buddy">
            <cstring>indexCO</cstring>
           </property>
          </widget>
         </item>
         <item>
-         <widget class="QComboBox" name="indexCO" >
-          <property name="toolTip" >
+         <widget class="QComboBox" name="indexCO">
+          <property name="toolTip">
            <string>Select a processor</string>
           </property>
          </widget>
         </item>
        </layout>
       </item>
-      <item row="1" column="0" >
-       <layout class="QHBoxLayout" name="horizontalLayout_2" >
+      <item row="1" column="0">
+       <layout class="QHBoxLayout" name="horizontalLayout_2">
         <item>
-         <widget class="QLabel" name="indexOptionsLA" >
-          <property name="text" >
+         <widget class="QLabel" name="indexOptionsLA">
+          <property name="text">
            <string>&amp;Options:</string>
           </property>
-          <property name="buddy" >
+          <property name="buddy">
            <cstring>indexOptionsLE</cstring>
           </property>
          </widget>
         </item>
         <item>
-         <widget class="QLineEdit" name="indexOptionsLE" >
-          <property name="toolTip" >
+         <widget class="QLineEdit" name="indexOptionsLE">
+          <property name="toolTip">
            <string>Define program options of the selected processor.</string>
           </property>
          </widget>
         </item>
        </layout>
       </item>
-      <item rowspan="2" row="0" column="1" >
-       <spacer name="horizontalSpacer" >
-        <property name="orientation" >
-         <enum>Qt::Horizontal</enum>
+      <item row="0" column="1" rowspan="2">
+       <spacer name="horizontalSpacer">
+        <property name="orientation">
+         <enum>Qt::Orientation::Horizontal</enum>
         </property>
-        <property name="sizeHint" stdset="0" >
+        <property name="sizeHint" stdset="0">
          <size>
           <width>183</width>
           <height>20</height>
      </layout>
     </widget>
    </item>
-   <item row="1" column="0" >
-    <widget class="QCheckBox" name="multipleIndicesCB" >
-     <property name="toolTip" >
-      <string>Check if you need multiple indexes (e.g., an Index of Names)</string>
-     </property>
-     <property name="text" >
-      <string>&amp;Use multiple indexes</string>
-     </property>
-    </widget>
-   </item>
-   <item row="2" column="0" colspan="2" >
-    <widget class="Line" name="line" >
-     <property name="orientation" >
-      <enum>Qt::Horizontal</enum>
-     </property>
-    </widget>
-   </item>
-   <item row="3" column="0" colspan="2" >
-    <layout class="QHBoxLayout" >
-     <property name="spacing" >
+   <item row="3" column="0">
+    <layout class="QHBoxLayout">
+     <property name="spacing">
       <number>6</number>
      </property>
-     <property name="margin" >
+     <property name="margin" stdset="0">
       <number>0</number>
      </property>
      <item>
-      <widget class="QLabel" name="newIndexLA" >
-       <property name="text" >
+      <widget class="QLabel" name="newIndexLA">
+       <property name="text">
         <string>&amp;New:[[index]]</string>
        </property>
-       <property name="buddy" >
+       <property name="buddy">
         <cstring>newIndexLE</cstring>
        </property>
       </widget>
      </item>
      <item>
-      <widget class="QLineEdit" name="newIndexLE" >
-       <property name="toolTip" >
-        <string>Enter the name of the desired index (e.g. "Index of Names") and hit "Add"</string>
+      <widget class="QLineEdit" name="newIndexLE">
+       <property name="toolTip">
+        <string>Enter the name of the desired index (e.g. &quot;Index of Names&quot;) and hit &quot;Add&quot;</string>
        </property>
       </widget>
      </item>
      <item>
-      <widget class="QPushButton" name="addIndexPB" >
-       <property name="toolTip" >
+      <widget class="QPushButton" name="addIndexPB">
+       <property name="toolTip">
         <string>Add a new index to the list</string>
        </property>
-       <property name="text" >
+       <property name="text">
         <string>&amp;Add</string>
        </property>
       </widget>
      </item>
     </layout>
    </item>
-   <item row="4" column="0" >
-    <widget class="QLabel" name="availableLA" >
-     <property name="text" >
-      <string>A&amp;vailable Indexes:</string>
-     </property>
-     <property name="buddy" >
-      <cstring>indicesTW</cstring>
-     </property>
-    </widget>
-   </item>
-   <item rowspan="4" row="5" column="0" >
-    <widget class="QTreeWidget" name="indicesTW" >
-     <column>
-      <property name="text" >
-       <string>1</string>
-      </property>
-     </column>
-    </widget>
-   </item>
-   <item row="5" column="1" >
-    <widget class="QPushButton" name="removePB" >
-     <property name="toolTip" >
-      <string>Remove the selected index</string>
-     </property>
-     <property name="text" >
-      <string>&amp;Remove</string>
+   <item row="6" column="0">
+    <widget class="QGroupBox" name="nomenclGB">
+     <property name="title">
+      <string>Nomenclature</string>
      </property>
+     <layout class="QGridLayout" name="gridLayout_3">
+      <item row="0" column="1">
+       <widget class="QComboBox" name="nomenclStyleCO"/>
+      </item>
+      <item row="0" column="0">
+       <widget class="QLabel" name="nomenclStyleLA">
+        <property name="text">
+         <string>Nomenclature St&amp;yle:</string>
+        </property>
+        <property name="buddy">
+         <cstring>nomenclStyleCO</cstring>
+        </property>
+       </widget>
+      </item>
+      <item row="0" column="2">
+       <spacer name="horizontalSpacer_2">
+        <property name="orientation">
+         <enum>Qt::Orientation::Horizontal</enum>
+        </property>
+        <property name="sizeHint" stdset="0">
+         <size>
+          <width>40</width>
+          <height>20</height>
+         </size>
+        </property>
+       </spacer>
+      </item>
+     </layout>
     </widget>
    </item>
-   <item row="6" column="1" >
-    <widget class="QPushButton" name="renamePB" >
-     <property name="toolTip" >
-      <string>Rename the selected index</string>
-     </property>
-     <property name="text" >
-      <string>R&amp;ename...</string>
-     </property>
-    </widget>
+   <item row="5" column="0">
+    <layout class="QGridLayout" name="gridLayout">
+     <item row="0" column="0" rowspan="4">
+      <widget class="QTreeWidget" name="indicesTW">
+       <column>
+        <property name="text">
+         <string>1</string>
+        </property>
+       </column>
+      </widget>
+     </item>
+     <item row="0" column="1">
+      <widget class="QPushButton" name="removePB">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="toolTip">
+        <string>Remove the selected index</string>
+       </property>
+       <property name="text">
+        <string>&amp;Remove</string>
+       </property>
+      </widget>
+     </item>
+     <item row="1" column="1">
+      <widget class="QPushButton" name="renamePB">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="toolTip">
+        <string>Rename the selected index</string>
+       </property>
+       <property name="text">
+        <string>R&amp;ename...</string>
+       </property>
+      </widget>
+     </item>
+     <item row="2" column="1">
+      <widget class="QPushButton" name="colorPB">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="toolTip">
+        <string>Define or change button color</string>
+       </property>
+       <property name="text">
+        <string>Alter Co&amp;lor...</string>
+       </property>
+      </widget>
+     </item>
+     <item row="3" column="1">
+      <spacer>
+       <property name="orientation">
+        <enum>Qt::Orientation::Vertical</enum>
+       </property>
+       <property name="sizeType">
+        <enum>QSizePolicy::Policy::Expanding</enum>
+       </property>
+       <property name="sizeHint" stdset="0">
+        <size>
+         <width>20</width>
+         <height>121</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+    </layout>
    </item>
-   <item row="7" column="1" >
-    <widget class="QPushButton" name="colorPB" >
-     <property name="toolTip" >
-      <string>Define or change button color</string>
+   <item row="4" column="0">
+    <widget class="QLabel" name="availableLA">
+     <property name="text">
+      <string>A&amp;vailable Indexes:</string>
      </property>
-     <property name="text" >
-      <string>Alter Co&amp;lor...</string>
+     <property name="buddy">
+      <cstring>indicesTW</cstring>
      </property>
     </widget>
    </item>
-   <item row="8" column="1" >
-    <spacer>
-     <property name="orientation" >
-      <enum>Qt::Vertical</enum>
-     </property>
-     <property name="sizeType" >
-      <enum>QSizePolicy::Expanding</enum>
-     </property>
-     <property name="sizeHint" stdset="0" >
-      <size>
-       <width>20</width>
-       <height>121</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
   </layout>
  </widget>
  <includes>
-  <include location="local" >qt_i18n.h</include>
+  <include location="local">qt_i18n.h</include>
  </includes>
  <resources/>
  <connections/>
index 4adcded1f8bce130a614ca513784b46bca30fdec..4baa29ecfcf026ae3e71a66e0503670e369d700f 100644 (file)
@@ -16,6 +16,7 @@
 #include "InsetArgument.h"
 
 #include "Buffer.h"
+#include "BufferParams.h"
 #include "Cursor.h"
 #include "DispatchResult.h"
 #include "Font.h"
@@ -71,7 +72,7 @@ docstring InsetNomencl::toolTip(BufferView const & /*bv*/, int /*x*/, int /*y*/)
 
 void InsetNomencl::write(ostream & os) const
 {
-       os << to_utf8(layoutName()) << endl;
+       os << "Nomenclature" << endl;
        InsetCollapsible::write(os);
 }
 
@@ -151,6 +152,14 @@ void InsetNomencl::addToToc(DocIterator const & cpit, bool output_active,
 }
 
 
+docstring InsetNomencl::layoutName() const
+{
+       return (buffer().params().use_nomentbl) ?
+                               from_ascii("Nomenclature:nomentbl")
+                             : from_ascii("Nomenclature");
+}
+
+
 /////////////////////////////////////////////////////////////////////
 //
 // InsetPrintNomencl
index 3b4f3474c5d1b8ff3da976a179561af3af2c062a..47ff626e0bcec0613d0bab0ad0cde35b0ae44cd5 100644 (file)
@@ -68,7 +68,7 @@ private:
        /// \name Private functions inherited from InsetCollapsible class
        //@{
        ///
-       docstring layoutName() const override { return from_ascii("Nomenclature"); }
+       docstring layoutName() const override;
        ///
        void write(std::ostream & os) const override;
        //@}
index 8b727028ec70dddb8b510757dfd626acb1fee62f..c21a97abbe1879d52141a00a19bb4c0aaa70ea9d 100644 (file)
@@ -616,6 +616,7 @@ Preamble::Preamble() : one_language(true), explicit_babel(false),
        h_use_lineno              = "false";
        h_use_refstyle            = false;
        h_use_minted              = false;
+       h_use_nomentbl            = false;
        h_use_packages["amsmath"]    = "1";
        h_use_packages["amssymb"]    = "0";
        h_use_packages["cancel"]     = "0";
@@ -1778,6 +1779,19 @@ void Preamble::handle_package(Parser &p, string const & name,
                }
        }
 
+       else if (name == "nomencl") {
+               vector<string>::iterator it =
+                       find(options.begin(), options.end(), "nomentbl");
+               if (it != options.end()) {
+                       h_use_nomentbl = true;
+                       options.erase(it);
+               }
+               if (!options.empty())
+                       // Fixme: add PackageOptions to local layout
+                       warning_message("Ignoring options '" + join(options, ",")
+                                       + "' of package " + name + '.');
+       }
+
        else if (name == "geometry")
                handle_geometry(options);
 
@@ -2107,6 +2121,7 @@ bool Preamble::writeLyXHeader(ostream & os, bool subdoc, string const & outfiled
           << "\\justification " << h_justification << '\n'
           << "\\use_refstyle " << h_use_refstyle << '\n'
           << "\\use_minted " << h_use_minted << '\n'
+          << "\\use_nomentbl " << h_use_nomentbl << '\n'
           << "\\use_lineno " << h_use_lineno << '\n';
        if (!h_lineno_options.empty())
                os << "\\lineno_options " << h_lineno_options << '\n';
index 36a8df82dfd288d340fe7296cdc7a6513a2ef62e..9177784771dd866b7c5fca4f3f6467a4232d559a 100644 (file)
@@ -50,6 +50,8 @@ public:
        void fontCJK(std::string const & f) { h_font_cjk_set = true; h_font_cjk = f; }
        ///
        bool minted() const { return h_use_minted; }
+       ///
+       bool nomentbl() const { return h_use_nomentbl; }
        /// The document language
        std::string docLanguage() const { return h_language; }
        /// The language of text which is not explicitly marked
@@ -255,6 +257,7 @@ private:
        std::vector<std::string> h_includeonlys;
        bool h_use_refstyle;
        bool h_use_minted;
+       bool h_use_nomentbl;
 
        /*!
         * Add package \p name with options \p options to used_packages.
index 9af7ff9359eb08695fbeafa0e457042ad774895f..ee40d4a1ef0717aeda57b3c700dd54a65f4716dc 100644 (file)
@@ -5010,7 +5010,10 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
                        set<string> pass_thru_cmds = context.pass_thru_cmds;
                        // These commands have special meanings in Nomenclature
                        context.pass_thru_cmds.insert("%");
-                       parse_text_in_inset(p, os, FLAG_ITEM, outer, context, "Nomenclature");
+                       if (preamble.nomentbl())
+                               parse_text_in_inset(p, os, FLAG_ITEM, outer, context, "Nomenclature:nomentbl");
+                       else
+                               parse_text_in_inset(p, os, FLAG_ITEM, outer, context, "Nomenclature");
                        context.pass_thru_cmds = pass_thru_cmds;
                        end_inset(os);
                        preamble.registerAutomaticallyLoadedPackage("nomencl");
index 714f8c08bfb3b8b49abc4df34491ee23a3a07b48..132b939451e9a3c035e12f9ec1db27ddf992cedb 100644 (file)
@@ -32,8 +32,8 @@ extern char const * const lyx_version_info;
 
 // Do not remove the comment below, so we get merge conflict in
 // independent branches. Instead add your own.
-#define LYX_FORMAT_LYX 627 // spitz: nomencl collapsible
-#define LYX_FORMAT_TEX2LYX 627
+#define LYX_FORMAT_LYX 628 // spitz: nomentbl
+#define LYX_FORMAT_TEX2LYX 628
 
 #if LYX_FORMAT_TEX2LYX != LYX_FORMAT_LYX
 #ifndef _MSC_VER