From c3aa7181517fc7fe6c8a4cdd8e0b96c033ed64ee Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Wed, 19 Dec 2012 16:55:22 +0100 Subject: [PATCH] Make the \item command in lists customizable --- lib/doc/Customization.lyx | 55 +++++++++++++++++++++++++++++++++++++++ src/Layout.cpp | 7 +++++ src/Layout.h | 4 +++ src/output_latex.cpp | 2 +- 4 files changed, 67 insertions(+), 1 deletion(-) diff --git a/lib/doc/Customization.lyx b/lib/doc/Customization.lyx index a7a8ca4f4f..86925af50f 100644 --- a/lib/doc/Customization.lyx +++ b/lib/doc/Customization.lyx @@ -11688,6 +11688,61 @@ TitleLatexName global entries). \end_layout +\begin_layout Description + +\change_inserted -712698321 1355932296 +\begin_inset Flex Code +status collapsed + +\begin_layout Plain Layout + +\change_inserted -712698321 1355932178 +ItemCommand +\end_layout + +\end_inset + + [ +\begin_inset Flex Code +status collapsed + +\begin_layout Plain Layout + +\change_inserted -712698321 1355932181 +string="item" +\end_layout + +\end_inset + +] The LaTeX command sequence declaring an item in a list. + The command is to be defined without the preceding backslash (the default + is +\begin_inset Quotes eld +\end_inset + +item +\begin_inset Quotes erd +\end_inset + +, resulting in +\begin_inset Flex Code +status collapsed + +\begin_layout Plain Layout + +\change_inserted -712698321 1355932279 + +\backslash +item +\change_unchanged + +\end_layout + +\end_inset + + in the LaTeX output). +\end_layout + \begin_layout Description \begin_inset Flex Code status collapsed diff --git a/src/Layout.cpp b/src/Layout.cpp index 3914b36843..7e0308db9b 100644 --- a/src/Layout.cpp +++ b/src/Layout.cpp @@ -53,6 +53,7 @@ enum LayoutTags { LT_FREE_SPACING, LT_PASS_THRU, LT_PARBREAK_IS_NEWLINE, + LT_ITEMCOMMAND, LT_ITEMSEP, LT_KEEPEMPTY, LT_LABEL_BOTTOMSEP, @@ -145,6 +146,7 @@ Layout::Layout() htmlforcecss_ = false; htmltitle_ = false; spellcheck = true; + itemcommand_ = "item"; } @@ -180,6 +182,7 @@ bool Layout::read(Lexer & lex, TextClass const & tclass) { "innertag", LT_INNERTAG }, { "inpreamble", LT_INPREAMBLE }, { "intitle", LT_INTITLE }, + { "itemcommand", LT_ITEMCOMMAND }, { "itemsep", LT_ITEMSEP }, { "itemtag", LT_ITEMTAG }, { "keepempty", LT_KEEPEMPTY }, @@ -394,6 +397,10 @@ bool Layout::read(Lexer & lex, TextClass const & tclass) lex >> itemtag_; break; + case LT_ITEMCOMMAND: + lex >> itemcommand_; + break; + case LT_PREAMBLE: preamble_ = from_utf8(lex.getLongString("EndPreamble")); break; diff --git a/src/Layout.h b/src/Layout.h index 270e4df117..39f784638e 100644 --- a/src/Layout.h +++ b/src/Layout.h @@ -86,6 +86,8 @@ public: /// std::string const & latexname() const { return latexname_; } /// + std::string const & itemcommand() const { return itemcommand_; } + /// void setLatexName(std::string const & n) { latexname_ = n; } /// The arguments of this layout struct latexarg { @@ -328,6 +330,8 @@ private: docstring labelstring_appendix_; /// LaTeX parameter for environment std::string latexparam_; + /// Item command in lists + std::string itemcommand_; /// Left delimiter of the content docstring leftdelim_; /// Right delimiter of the content diff --git a/src/output_latex.cpp b/src/output_latex.cpp index 1ddb4c3caa..9629a91ebf 100644 --- a/src/output_latex.cpp +++ b/src/output_latex.cpp @@ -428,7 +428,7 @@ void parStartCommand(Paragraph const & par, otexstream & os, break; case LATEX_ITEM_ENVIRONMENT: case LATEX_LIST_ENVIRONMENT: - os << "\\item"; + os << "\\" + style.itemcommand(); // Item arguments if (!style.itemargs().empty()) latexArgInsets(par, os, runparams, style.itemargs(), true); -- 2.39.5