mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
Make the \item command in lists customizable
This commit is contained in:
parent
f456260562
commit
c3aa718151
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user