]> git.lyx.org Git - lyx.git/commitdiff
Make the \item command in lists customizable
authorJuergen Spitzmueller <spitz@lyx.org>
Wed, 19 Dec 2012 15:55:22 +0000 (16:55 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Wed, 19 Dec 2012 15:55:22 +0000 (16:55 +0100)
lib/doc/Customization.lyx
src/Layout.cpp
src/Layout.h
src/output_latex.cpp

index a7a8ca4f4f3779989c91526f222bc45d861df9a5..86925af50fdafe735979399d5840ea4d3363d702 100644 (file)
@@ -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
index 3914b368435dd8a14afb44e96b39abcc4aaaab9d..7e0308db9bf1d8fbe1a646e2b262e3bb5607b173 100644 (file)
@@ -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;
index 270e4df117d612b549095afb48c0268632ee23af..39f784638e2bcfc5248fb706567a94485ba7099c 100644 (file)
@@ -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
index 1ddb4c3caa438efcc429438bc0b7967709d175ec..9629a91ebffc9cb9affa3bf630c6705918d04c70 100644 (file)
@@ -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);