From 13ee0bc8cd10257a0e00586fa20c801935f09aa9 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Wed, 21 Aug 2024 17:35:48 +0200 Subject: [PATCH] Add support for the nomentbl nomenclature option file format change --- development/FORMAT | 5 + lib/doc/UserGuide.lyx | 76 +++++++- lib/doc/de/UserGuide.lyx | 53 +++++- lib/layouts/stdinsets.inc | 16 ++ lib/lyx2lyx/lyx_2_5.py | 150 ++++++++++++++- src/BufferParams.cpp | 4 + src/BufferParams.h | 6 +- src/LaTeXFeatures.cpp | 5 +- src/frontends/qt/GuiDocument.cpp | 2 +- src/frontends/qt/GuiIndices.cpp | 17 +- src/frontends/qt/GuiIndices.h | 1 + src/frontends/qt/ui/IndicesUi.ui | 302 ++++++++++++++++++------------- src/insets/InsetNomencl.cpp | 11 +- src/insets/InsetNomencl.h | 2 +- src/tex2lyx/Preamble.cpp | 15 ++ src/tex2lyx/Preamble.h | 3 + src/tex2lyx/text.cpp | 5 +- src/version.h | 4 +- 18 files changed, 540 insertions(+), 137 deletions(-) diff --git a/development/FORMAT b/development/FORMAT index 830c45ae45..d7146861d3 100644 --- a/development/FORMAT +++ b/development/FORMAT @@ -7,6 +7,11 @@ changes happened in particular if possible. A good example would be ----------------------- +2024-08-21 Jürgen Spitzmüller + * Format incremented to 628: Add support for nomentbl-style + nomencl insets: + \nomenclature[]{}{}{}{} + 2024-08-12 Jürgen Spitzmüller * Format incremented to 627: Transform nomenclature inset to collapsible. diff --git a/lib/doc/UserGuide.lyx b/lib/doc/UserGuide.lyx index 993758fa05..72640e7be1 100644 --- a/lib/doc/UserGuide.lyx +++ b/lib/doc/UserGuide.lyx @@ -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 diff --git a/lib/doc/de/UserGuide.lyx b/lib/doc/de/UserGuide.lyx index 0b1c9ec92d..9f1145fdd6 100644 --- a/lib/doc/de/UserGuide.lyx +++ b/lib/doc/de/UserGuide.lyx @@ -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 diff --git a/lib/layouts/stdinsets.inc b/lib/layouts/stdinsets.inc index 000a0d696a..135a5a4738 100644 --- a/lib/layouts/stdinsets.inc +++ b/lib/layouts/stdinsets.inc @@ -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 diff --git a/lib/lyx2lyx/lyx_2_5.py b/lib/lyx2lyx/lyx_2_5.py index e3de465948..cd224fe946 100644 --- a/lib/lyx2lyx/lyx_2_5.py +++ b/lib/lyx2lyx/lyx_2_5.py @@ -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]], diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp index c5b1027518..8f1563e516 100644 --- a/src/BufferParams.cpp +++ b/src/BufferParams.cpp @@ -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'; diff --git a/src/BufferParams.h b/src/BufferParams.h index 15e65d0ef8..bef948330c 100644 --- a/src/BufferParams.h +++ b/src/BufferParams.h @@ -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 diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp index 3736953480..b423437269 100644 --- a/src/LaTeXFeatures.cpp +++ b/src/LaTeXFeatures.cpp @@ -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. diff --git a/src/frontends/qt/GuiDocument.cpp b/src/frontends/qt/GuiDocument.cpp index 08e3fb05ef..5ab4c53b5b 100644 --- a/src/frontends/qt/GuiDocument.cpp +++ b/src/frontends/qt/GuiDocument.cpp @@ -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")); diff --git a/src/frontends/qt/GuiIndices.cpp b/src/frontends/qt/GuiIndices.cpp index 6fa9cbc34e..2c3a0d78ce 100644 --- a/src/frontends/qt/GuiIndices.cpp +++ b/src/frontends/qt/GuiIndices.cpp @@ -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 diff --git a/src/frontends/qt/GuiIndices.h b/src/frontends/qt/GuiIndices.h index efaec8354f..4ba15dbfa6 100644 --- a/src/frontends/qt/GuiIndices.h +++ b/src/frontends/qt/GuiIndices.h @@ -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: /// diff --git a/src/frontends/qt/ui/IndicesUi.ui b/src/frontends/qt/ui/IndicesUi.ui index a7b92b90ad..ac7ed3a986 100644 --- a/src/frontends/qt/ui/IndicesUi.ui +++ b/src/frontends/qt/ui/IndicesUi.ui @@ -1,78 +1,96 @@ - + + IndicesUi - - + + 0 0 - 401 - 340 + 341 + 479 - + - - - - + + + + + Check if you need multiple indexes (e.g., an Index of Names) + + + &Use multiple indexes + + + + + + + Qt::Orientation::Horizontal + + + + + + Here you can define an alternative index processor and specify its options. - + Index Generation - + true - - - + + + - - + + &Processor: - + indexCO - - + + Select a processor - - + + - - + + &Options: - + indexOptionsLE - - + + Define program options of the selected processor. - - - - Qt::Horizontal + + + + Qt::Orientation::Horizontal - + 183 20 @@ -83,129 +101,169 @@ - - - - Check if you need multiple indexes (e.g., an Index of Names) - - - &Use multiple indexes - - - - - - - Qt::Horizontal - - - - - - + + + 6 - + 0 - - + + &New:[[index]] - + newIndexLE - - - Enter the name of the desired index (e.g. "Index of Names") and hit "Add" + + + Enter the name of the desired index (e.g. "Index of Names") and hit "Add" - - + + Add a new index to the list - + &Add - - - + + + + Nomenclature + + + + + + + + + Nomenclature St&yle: + + + nomenclStyleCO + + + + + + + Qt::Orientation::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + + 1 + + + + + + + + + 0 + 0 + + + + Remove the selected index + + + &Remove + + + + + + + + 0 + 0 + + + + Rename the selected index + + + R&ename... + + + + + + + + 0 + 0 + + + + Define or change button color + + + Alter Co&lor... + + + + + + + Qt::Orientation::Vertical + + + QSizePolicy::Policy::Expanding + + + + 20 + 121 + + + + + + + + + A&vailable Indexes: - + indicesTW - - - - - 1 - - - - - - - - Remove the selected index - - - &Remove - - - - - - - Rename the selected index - - - R&ename... - - - - - - - Define or change button color - - - Alter Co&lor... - - - - - - - Qt::Vertical - - - QSizePolicy::Expanding - - - - 20 - 121 - - - - - qt_i18n.h + qt_i18n.h diff --git a/src/insets/InsetNomencl.cpp b/src/insets/InsetNomencl.cpp index 4adcded1f8..4baa29ecfc 100644 --- a/src/insets/InsetNomencl.cpp +++ b/src/insets/InsetNomencl.cpp @@ -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 diff --git a/src/insets/InsetNomencl.h b/src/insets/InsetNomencl.h index 3b4f3474c5..47ff626e0b 100644 --- a/src/insets/InsetNomencl.h +++ b/src/insets/InsetNomencl.h @@ -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; //@} diff --git a/src/tex2lyx/Preamble.cpp b/src/tex2lyx/Preamble.cpp index 8b727028ec..c21a97abbe 100644 --- a/src/tex2lyx/Preamble.cpp +++ b/src/tex2lyx/Preamble.cpp @@ -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::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'; diff --git a/src/tex2lyx/Preamble.h b/src/tex2lyx/Preamble.h index 36a8df82df..9177784771 100644 --- a/src/tex2lyx/Preamble.h +++ b/src/tex2lyx/Preamble.h @@ -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 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. diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp index 9af7ff9359..ee40d4a1ef 100644 --- a/src/tex2lyx/text.cpp +++ b/src/tex2lyx/text.cpp @@ -5010,7 +5010,10 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, set 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"); diff --git a/src/version.h b/src/version.h index 714f8c08bf..132b939451 100644 --- a/src/version.h +++ b/src/version.h @@ -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