mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-24 01:01:57 +00:00
Added CDATA sections to fix Code style.
New layout files to support inclusion. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_1_6@1481 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
7b3c57e57e
commit
9aec3b7843
@ -1,32 +1,13 @@
|
|||||||
#% Do not delete the line below; configure depends on this
|
#% Do not delete the line below; configure depends on this
|
||||||
# \DeclareDocBookClass[book]{SGML (DocBook book)}
|
# \DeclareDocBookClass[book]{DocBook book (SGML)}
|
||||||
# DocBook textclass definition file.
|
# DocBook textclass definition file.
|
||||||
# Author : Jose' Matos <jamatos@lyx.org>
|
# Author : Jose' Matos <jamatos@lyx.org>
|
||||||
# hacked for books: Luc Abom <luc@abom.com>
|
# hacked for books: Luc Abom <luc@abom.com>
|
||||||
|
|
||||||
# Input general definitions
|
# Input general definitions
|
||||||
Input stdclass.inc
|
Input db_stdclass.inc
|
||||||
|
|
||||||
OutputType docbook
|
|
||||||
|
|
||||||
MaxCounter Counter_Section
|
|
||||||
SecNumDepth 3
|
|
||||||
TocDepth 3
|
|
||||||
|
|
||||||
#docbook specific definitions
|
|
||||||
Style Standard
|
|
||||||
LatexType Paragraph
|
|
||||||
LatexName para
|
|
||||||
End
|
|
||||||
|
|
||||||
# Quote style definition
|
|
||||||
Style Quotation
|
|
||||||
LatexType Environment
|
|
||||||
LatexName blockquote
|
|
||||||
LatexParam para
|
|
||||||
End
|
|
||||||
|
|
||||||
|
|
||||||
|
MaxCounter Counter_Chapter
|
||||||
|
|
||||||
# Title style definition
|
# Title style definition
|
||||||
Style Title
|
Style Title
|
||||||
@ -34,155 +15,3 @@ Style Title
|
|||||||
LatexName bookinfo
|
LatexName bookinfo
|
||||||
LatexParam "1|"
|
LatexParam "1|"
|
||||||
End
|
End
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Title style definition
|
|
||||||
Style Chapter
|
|
||||||
LatexType Command
|
|
||||||
LatexName chapter
|
|
||||||
LatexParam "1|"
|
|
||||||
End
|
|
||||||
|
|
||||||
# Section style definition
|
|
||||||
Style Section
|
|
||||||
LatexType Command
|
|
||||||
LatexName sect1
|
|
||||||
LatexParam "2|"
|
|
||||||
End
|
|
||||||
|
|
||||||
# Subsection style definition
|
|
||||||
Style Subsection
|
|
||||||
LatexType Command
|
|
||||||
LatexName sect2
|
|
||||||
LatexParam "3|"
|
|
||||||
End
|
|
||||||
|
|
||||||
# Subsubsection style definition
|
|
||||||
Style Subsubsection
|
|
||||||
LatexType Command
|
|
||||||
LatexName sect3
|
|
||||||
LatexParam "4|"
|
|
||||||
End
|
|
||||||
|
|
||||||
# Paragraph style definition
|
|
||||||
Style Paragraph
|
|
||||||
LatexType Command
|
|
||||||
LatexName sect4
|
|
||||||
LatexParam "5|"
|
|
||||||
End
|
|
||||||
|
|
||||||
# Subparagraph style definition
|
|
||||||
Style Subparagraph
|
|
||||||
LatexType Command
|
|
||||||
LatexName sect5
|
|
||||||
LatexParam "6|"
|
|
||||||
End
|
|
||||||
|
|
||||||
# Enumerate style definition
|
|
||||||
Style Enumerate
|
|
||||||
LatexType Item_Environment
|
|
||||||
LatexName orderedlist
|
|
||||||
End
|
|
||||||
|
|
||||||
# Itemize style definition
|
|
||||||
Style Itemize
|
|
||||||
LatexType Item_Environment
|
|
||||||
LatexName itemizedlist
|
|
||||||
End
|
|
||||||
|
|
||||||
# Description style definition
|
|
||||||
Style Description
|
|
||||||
LatexType Item_environment
|
|
||||||
LatexName variablelist
|
|
||||||
End
|
|
||||||
|
|
||||||
# Verbatim style definition
|
|
||||||
Style Literal
|
|
||||||
LatexType Environment
|
|
||||||
LatexName literallayout
|
|
||||||
Font
|
|
||||||
Latex Latex
|
|
||||||
EndFont
|
|
||||||
End
|
|
||||||
|
|
||||||
# Code style definition
|
|
||||||
Style Code
|
|
||||||
CopyStyle LyX-Code
|
|
||||||
LatexType Environment
|
|
||||||
LatexName programlisting
|
|
||||||
Font
|
|
||||||
Latex Latex
|
|
||||||
EndFont
|
|
||||||
End
|
|
||||||
|
|
||||||
# Author style definition
|
|
||||||
Style Author
|
|
||||||
LatexType Environment
|
|
||||||
LatexName author
|
|
||||||
KeepEmpty 1
|
|
||||||
End
|
|
||||||
|
|
||||||
# first name style definition
|
|
||||||
Style FirstName
|
|
||||||
Margin Static
|
|
||||||
LatexType Paragraph
|
|
||||||
LatexName firstname
|
|
||||||
ParIndent MM
|
|
||||||
ParSkip 0.4
|
|
||||||
Align Center
|
|
||||||
AlignPossible Center
|
|
||||||
LabelType No_Label
|
|
||||||
End
|
|
||||||
|
|
||||||
# surname style definition
|
|
||||||
Style Surname
|
|
||||||
Margin Static
|
|
||||||
LatexType Paragraph
|
|
||||||
LatexName surname
|
|
||||||
ParIndent MM
|
|
||||||
ParSkip 0.4
|
|
||||||
Align Center
|
|
||||||
AlignPossible Center
|
|
||||||
LabelType No_Label
|
|
||||||
End
|
|
||||||
|
|
||||||
# Date style definition
|
|
||||||
Style Date
|
|
||||||
LatexType Paragraph
|
|
||||||
LatexName date
|
|
||||||
End
|
|
||||||
|
|
||||||
# Abstract style definition
|
|
||||||
Style Abstract
|
|
||||||
LatexType Environment
|
|
||||||
LatexName abstract
|
|
||||||
LatexParam para
|
|
||||||
End
|
|
||||||
|
|
||||||
# SGML style definition
|
|
||||||
Style SGML
|
|
||||||
CopyStyle LaTeX
|
|
||||||
LatexName "!-- --"
|
|
||||||
End
|
|
||||||
|
|
||||||
# There are no chapters or parts in an docbook article.
|
|
||||||
#NoStyle Chapter
|
|
||||||
NoStyle Chapter*
|
|
||||||
NoStyle Part
|
|
||||||
NoStyle Part*
|
|
||||||
NoStyle LaTeX
|
|
||||||
NoStyle LyX-Code
|
|
||||||
NoStyle Address
|
|
||||||
NoStyle Right_Address
|
|
||||||
NoStyle LaTeX_Title
|
|
||||||
NoStyle Verse
|
|
||||||
NoStyle Section*
|
|
||||||
NoStyle Subsection*
|
|
||||||
NoStyle Subsubsection*
|
|
||||||
NoStyle Paragraph*
|
|
||||||
NoStyle Subparagraph*
|
|
||||||
|
|
||||||
Style LyX-Code
|
|
||||||
ObsoletedBy Code
|
|
||||||
End
|
|
||||||
|
@ -1,178 +1,13 @@
|
|||||||
#% Do not delete the line below; configure depends on this
|
#% Do not delete the line below; configure depends on this
|
||||||
# \DeclareDocBookClass[article]{SGML (DocBook article)}
|
# \DeclareDocBookClass[article]{DocBook article (SGML)}
|
||||||
# DocBook textclass definition file.
|
# DocBook textclass definition file.
|
||||||
# Author : Jose' Matos <jamatos@lyx.org>
|
# Author : Jose' Matos <jamatos@lyx.org>
|
||||||
|
|
||||||
# Input general definitions
|
# Input general definitions
|
||||||
Input stdclass.inc
|
Input db_stdclass.inc
|
||||||
|
|
||||||
OutputType docbook
|
|
||||||
|
|
||||||
MaxCounter Counter_Section
|
MaxCounter Counter_Section
|
||||||
SecNumDepth 3
|
|
||||||
TocDepth 3
|
|
||||||
|
|
||||||
#docbook specific definitions
|
# Exclude higher, or equal, sections:
|
||||||
Style Standard
|
|
||||||
LatexType Paragraph
|
|
||||||
LatexName para
|
|
||||||
End
|
|
||||||
|
|
||||||
# Quote style definition
|
|
||||||
Style Quotation
|
|
||||||
LatexType Environment
|
|
||||||
LatexName blockquote
|
|
||||||
LatexParam para
|
|
||||||
End
|
|
||||||
|
|
||||||
# Title style definition
|
|
||||||
Style Title
|
|
||||||
LatexType Command
|
|
||||||
LatexName artheader
|
|
||||||
LatexParam "1|"
|
|
||||||
End
|
|
||||||
|
|
||||||
# Section style definition
|
|
||||||
Style Section
|
|
||||||
LatexType Command
|
|
||||||
LatexName sect1
|
|
||||||
LatexParam "1|"
|
|
||||||
End
|
|
||||||
|
|
||||||
# Subsection style definition
|
|
||||||
Style Subsection
|
|
||||||
LatexType Command
|
|
||||||
LatexName sect2
|
|
||||||
LatexParam "2|"
|
|
||||||
End
|
|
||||||
|
|
||||||
# Subsubsection style definition
|
|
||||||
Style Subsubsection
|
|
||||||
LatexType Command
|
|
||||||
LatexName sect3
|
|
||||||
LatexParam "3|"
|
|
||||||
End
|
|
||||||
|
|
||||||
# Paragraph style definition
|
|
||||||
Style Paragraph
|
|
||||||
LatexType Command
|
|
||||||
LatexName sect4
|
|
||||||
LatexParam "4|"
|
|
||||||
End
|
|
||||||
|
|
||||||
# Subparagraph style definition
|
|
||||||
Style Subparagraph
|
|
||||||
LatexType Command
|
|
||||||
LatexName sect5
|
|
||||||
LatexParam "5|"
|
|
||||||
End
|
|
||||||
|
|
||||||
# Enumerate style definition
|
|
||||||
Style Enumerate
|
|
||||||
LatexType Item_Environment
|
|
||||||
LatexName orderedlist
|
|
||||||
End
|
|
||||||
|
|
||||||
# Itemize style definition
|
|
||||||
Style Itemize
|
|
||||||
LatexType Item_Environment
|
|
||||||
LatexName itemizedlist
|
|
||||||
End
|
|
||||||
|
|
||||||
# Description style definition
|
|
||||||
Style Description
|
|
||||||
LatexType Item_environment
|
|
||||||
LatexName variablelist
|
|
||||||
End
|
|
||||||
|
|
||||||
# Verbatim style definition
|
|
||||||
Style Literal
|
|
||||||
LatexType Environment
|
|
||||||
LatexName literallayout
|
|
||||||
Font
|
|
||||||
Latex Latex
|
|
||||||
EndFont
|
|
||||||
End
|
|
||||||
|
|
||||||
# Code style definition
|
|
||||||
Style Code
|
|
||||||
CopyStyle LyX-Code
|
|
||||||
LatexType Environment
|
|
||||||
LatexName programlisting
|
|
||||||
Preamble
|
|
||||||
EndPreamble
|
|
||||||
Font
|
|
||||||
Latex Latex
|
|
||||||
EndFont
|
|
||||||
End
|
|
||||||
|
|
||||||
# Author style definition
|
|
||||||
Style Author
|
|
||||||
LatexType Environment
|
|
||||||
LatexName author
|
|
||||||
KeepEmpty 1
|
|
||||||
End
|
|
||||||
|
|
||||||
# first name style definition
|
|
||||||
Style FirstName
|
|
||||||
Margin Static
|
|
||||||
LatexType Paragraph
|
|
||||||
LatexName firstname
|
|
||||||
ParIndent MM
|
|
||||||
ParSkip 0.4
|
|
||||||
Align Center
|
|
||||||
AlignPossible Center
|
|
||||||
LabelType No_Label
|
|
||||||
End
|
|
||||||
|
|
||||||
# surname style definition
|
|
||||||
Style Surname
|
|
||||||
Margin Static
|
|
||||||
LatexType Paragraph
|
|
||||||
LatexName surname
|
|
||||||
ParIndent MM
|
|
||||||
ParSkip 0.4
|
|
||||||
Align Center
|
|
||||||
AlignPossible Center
|
|
||||||
LabelType No_Label
|
|
||||||
End
|
|
||||||
|
|
||||||
# Date style definition
|
|
||||||
Style Date
|
|
||||||
LatexType Paragraph
|
|
||||||
LatexName date
|
|
||||||
End
|
|
||||||
|
|
||||||
# Abstract style definition
|
|
||||||
Style Abstract
|
|
||||||
LatexType Environment
|
|
||||||
LatexName abstract
|
|
||||||
LatexParam para
|
|
||||||
End
|
|
||||||
|
|
||||||
# SGML style definition
|
|
||||||
Style SGML
|
|
||||||
CopyStyle LaTeX
|
|
||||||
LatexName "!-- --"
|
|
||||||
End
|
|
||||||
|
|
||||||
# There are no chapters or parts in an docbook article.
|
|
||||||
NoStyle Chapter
|
|
||||||
NoStyle Chapter*
|
|
||||||
NoStyle Part
|
NoStyle Part
|
||||||
NoStyle Part*
|
NoStyle Chapter
|
||||||
NoStyle LaTeX
|
|
||||||
NoStyle LyX-Code
|
|
||||||
NoStyle Address
|
|
||||||
NoStyle Right_Address
|
|
||||||
NoStyle LaTeX_Title
|
|
||||||
NoStyle Verse
|
|
||||||
NoStyle Section*
|
|
||||||
NoStyle Subsection*
|
|
||||||
NoStyle Subsubsection*
|
|
||||||
NoStyle Paragraph*
|
|
||||||
NoStyle Subparagraph*
|
|
||||||
|
|
||||||
Style LyX-Code
|
|
||||||
ObsoletedBy Code
|
|
||||||
End
|
|
||||||
|
36
src/buffer.C
36
src/buffer.C
@ -3002,9 +3002,11 @@ void Buffer::makeDocBookFile(string const & fname, bool nice, bool only_body)
|
|||||||
}
|
}
|
||||||
|
|
||||||
sgmlOpenTag(ofs, depth + command_depth, command_name);
|
sgmlOpenTag(ofs, depth + command_depth, command_name);
|
||||||
item_name = "title";
|
if (c_params.empty())
|
||||||
if (command_name != "!-- --")
|
item_name = "title";
|
||||||
sgmlOpenTag(ofs, depth + 1 + command_depth, item_name);
|
else
|
||||||
|
item_name = c_params;
|
||||||
|
sgmlOpenTag(ofs, depth + 1 + command_depth, item_name);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LATEX_ENVIRONMENT:
|
case LATEX_ENVIRONMENT:
|
||||||
@ -3033,9 +3035,13 @@ void Buffer::makeDocBookFile(string const & fname, bool nice, bool only_body)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (style.latextype == LATEX_ENVIRONMENT) {
|
if (style.latextype == LATEX_ENVIRONMENT) {
|
||||||
if (!style.latexparam().empty())
|
if (!style.latexparam().empty()) {
|
||||||
sgmlOpenTag(ofs, depth + command_depth,
|
if(style.latexparam() == "CDATA")
|
||||||
style.latexparam());
|
ofs << "<![ CDATA [";
|
||||||
|
else
|
||||||
|
sgmlOpenTag(ofs, depth + command_depth,
|
||||||
|
style.latexparam());
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3082,14 +3088,20 @@ void Buffer::makeDocBookFile(string const & fname, bool nice, bool only_body)
|
|||||||
// write closing SGML tags
|
// write closing SGML tags
|
||||||
switch (style.latextype) {
|
switch (style.latextype) {
|
||||||
case LATEX_COMMAND:
|
case LATEX_COMMAND:
|
||||||
end_tag = "title";
|
if (c_params.empty())
|
||||||
if (command_name != "!-- --")
|
end_tag = "title";
|
||||||
sgmlCloseTag(ofs, depth + command_depth, end_tag);
|
else
|
||||||
|
end_tag = c_params;
|
||||||
|
sgmlCloseTag(ofs, depth + command_depth, end_tag);
|
||||||
break;
|
break;
|
||||||
case LATEX_ENVIRONMENT:
|
case LATEX_ENVIRONMENT:
|
||||||
if (!style.latexparam().empty())
|
if (!style.latexparam().empty()) {
|
||||||
sgmlCloseTag(ofs, depth + command_depth,
|
if(style.latexparam() == "CDATA")
|
||||||
style.latexparam());
|
ofs << "]]>";
|
||||||
|
else
|
||||||
|
sgmlCloseTag(ofs, depth + command_depth,
|
||||||
|
style.latexparam());
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case LATEX_ITEM_ENVIRONMENT:
|
case LATEX_ITEM_ENVIRONMENT:
|
||||||
if (desc_on == 1) break;
|
if (desc_on == 1) break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user