+
+2003-11-25 Martin Vermeer <martin.vermeer@hut.fi>
+
+ * lib/layouts/agu-dtd.layout:
+ * lib/layouts/agu_stdclass.inc:
+ * lib/layouts/agu_stdcounters.inc:
+ * lib/layouts/agu_stdlists.inc:
+ * lib/layouts/agu_stdsections.inc:
+ * lib/layouts/db_lyxmacros.inc:
+ * lib/layouts/db_stdclass.inc:
+ * lib/layouts/db_stdlayouts.inc:
+ * lib/layouts/db_stdlists.inc:
+ * lib/layouts/db_stdstarsections.inc:
+ * lib/layouts/db_stdstruct.inc:
+ * lib/layouts/db_stdtitle.inc:
+ * lib/layouts/docbook-book.layout:
+ * lib/layouts/docbook-chapter.layout:
+ * lib/layouts/docbook-section.layout: Introducing a number of tags
+ parametrizing various XML formats that we may want to support
+
2003-11-17 Roman Maurer <roman.maurer@amis.net>
* examples/sl_splash.lyx: update
--- /dev/null
+#% Do not delete the line below; configure depends on this
+# \DeclareDocBookClass[AGU-article]{AGU Article (SGML)}
+# AGU XML textclass definition file.
+# Authors : Jose' Matos <jamatos@lyx.org>
+# Martin Vermeer <martin.vermeer@hut.fi>
+
+
+Input agu_stdclass.inc
+Input numarticle.inc
+
+
+# Exclude higher, or equal, sections:
+NoStyle Part
+NoStyle Chapter
--- /dev/null
+# Textclass definition file for AGU-Article.
+# Author : José Abílio Oliveira Matos <jamatos@lyx.org>
+# Martin Vermeer <martin.vermeer@hut.fi>
+
+# This file is the counterpart of stdclass.inc
+# It is desirable, as far as possible, to have the same look and feel for
+# related layouts in latex and docbook.
+
+OutputType docbook
+
+Columns 1
+Sides 1
+SecNumDepth 3
+TocDepth 3
+DefaultStyle Standard
+
+
+Style Standard
+ Margin Static
+ LatexType Paragraph
+ LatexName p
+ ParIndent MM
+ ParSkip 0.4
+ Align Block
+ AlignPossible Block
+ LabelType No_Label
+ LatexParam "para#"
+End
+
+
+CharStyle Firstname
+ LatexType Command
+ LatexName firstname
+ Font
+ Shape SmallCaps
+ EndFont
+ LabelFont
+ Shape Italic
+ Color red
+ EndFont
+End
+
+CharStyle Surname
+ LatexType Command
+ LatexName firstname
+ Font
+ Shape SmallCaps
+ EndFont
+ LabelFont
+ Shape Italic
+ Color red
+ EndFont
+End
+
+CharStyle Filename
+ LatexType Command
+ LatexName firstname
+ Font
+ Family Typewriter
+ EndFont
+ LabelFont
+ Shape Italic
+ Color red
+ EndFont
+End
+
+CharStyle Literal
+ LatexType Command
+ LatexName firstname
+ Font
+ Family Typewriter
+ EndFont
+ LabelFont
+ Shape Italic
+ Color red
+ EndFont
+End
+
+
+Input agu_stdlists.inc
+Input agu_stdsections.inc
+Input db_stdstarsections.inc
+Input db_stdtitle.inc
+Input db_stdstruct.inc
+Input db_lyxmacros.inc
+Input db_stdlayouts.inc
+Input stdcounters.inc
+Input agu_stdcounters.inc
+Input stdfloats.inc
--- /dev/null
+# Author : José Matos <jamatos@lyx.org>
+# Martin Vermeer <martin.vermeer@hut.fi>
+
+# This include file contains all the counters that are defined as standard
+# in AGU-Article LyX layouts.
+
+Counter
+ Name sect1
+ Within section
+End
+
+Counter
+ Name sect2
+ Within sect1
+End
+
+Counter
+ Name sect3
+ Within sect2
+End
+
+Counter
+ Name sect4
+ Within sect3
+End
+
+Counter
+ Name sect5
+ Within sect4
+End
+
+Counter
+ Name para
+End
--- /dev/null
+# Textclass definition file for AGU-Article.
+# Author : José Abílio Oliveira Matos <jamatos@lyx.org>
+# Martin Vermeer <martin.vermeer@hut.fi>
+
+# This is the counterpart of stdlists.inc
+# It is desirable, as far as possible, to have the same look and feel for
+# related layouts in latex and docbook.
+
+Input stdlists.inc
+
+
+Style Itemize
+ LatexType Item_Environment
+ LatexName lst
+ Latexparam "type="bulleted""
+ ItemTag item
+End
+
+
+Style Enumerate
+ LatexType Item_Environment
+ LatexName lst
+ Latexparam "type="ordered""
+ ItemTag item
+End
+
+
+Style Description
+ LatexType Item_environment
+ LatexName lst
+ Latexparam "type="unordered""
+ ItemTag item
+End
+
+# maybe List is the same as simplelist (I need to check it).
+NoStyle List
+
--- /dev/null
+# Textclass definition file for docbook.
+# Author : José Abílio Oliveira Matos <jamatos@lyx.org>
+# Martin Vermeer <martin.vermeer@hut.fi>
+
+# This file is the counterpart of stdsections.inc
+# It is desirable, as far as possible, to have the same look and feel for
+# related layouts in latex and docbook.
+
+Input stdsections.inc
+
+Style Part
+ LatexType Command
+ LatexName part
+ InnerTag head
+ LabelTag label
+ CommandDepth 0
+End
+
+
+Style Chapter
+ LatexType Command
+ LatexName chapter
+ InnerTag head
+ LabelTag label
+ CommandDepth 1
+End
+
+
+Style Section
+ LatexType Command
+ LatexName section
+ InnerTag head
+ LabelTag label
+ CommandDepth 2
+ LatexParam "s#"
+End
+
+
+Style Subsection
+ LatexType Command
+ LatexName subsect1
+ InnerTag head
+ LabelTag label
+ CommandDepth 3
+ LatexParam "s#"
+End
+
+
+Style Subsubsection
+ LatexType Command
+ LatexName subsect2
+ InnerTag head
+ LabelTag label
+ CommandDepth 4
+ LatexParam "s#"
+End
+
+
+Style Paragraph
+ LatexType Command
+ LatexName subsect3
+ InnerTag head
+ LabelTag label
+ CommandDepth 5
+ LatexParam "s#"
+End
+
+
+Style Subparagraph
+ LatexType Command
+ LatexName subsect4
+ InnerTag head
+ LabelTag label
+ CommandDepth 6
+ LatexParam "s#"
+End
+
+Style Subsubparagraph
+ LatexType Command
+ LatexName subsect5
+ InnerTag head
+ LabelTag label
+ CommandDepth 7
+ LatexParam "s#"
+End
+
# Author : José Abílio Oliveira Matos <jamatos@lyx.org>
# This is the counterpart of lyxmacros.inc
-# It is desireable, as far as possible, to have the same look and feeling for
+# It is desirable, as far as possible, to have the same look and feel for
# related layouts in latex and docbook.
Input lyxmacros.inc
CopyStyle LyX-Code
LatexType Environment
LatexName programlisting
- LatexParam CDATA
+ InnerTag CDATA
PassThru 1
End
# Author : José Abílio Oliveira Matos <jamatos@lyx.org>
# This file is the counterpart of stdclass.inc
-# It is desireable, as far as possible, to have the same look and feeling for
+# It is desirable, as far as possible, to have the same look and feel for
# related layouts in latex and docbook.
OutputType docbook
EndFont
End
-CharStyle FirstName
+CharStyle Firstname
LatexType Command
LatexName firstname
Font
# Author : José Abílio Oliveira Matos <jamatos@lyx.org>
# This is the counterpart of stdlayouts.inc
-# It is desireable, as far as possible, to have the same look and feeling for
+# It is desirable, as far as possible, to have the same look and feel for
# related layouts in latex and docbook.
Input stdlayouts.inc
Style Quotation
LatexType Environment
LatexName blockquote
- LatexParam para
+ InnerTag para
End
# Quote should be an inline element
# Author : José Abílio Oliveira Matos <jamatos@lyx.org>
# This is the counterpart of stdlists.inc
-# It is desireable, as far as possible, to have the same look and feeling for
+# It is desirable, as far as possible, to have the same look and feel for
# related layouts in latex and docbook.
Input stdlists.inc
Style Itemize
LatexType Item_Environment
LatexName itemizedlist
+ ItemTag listitem
End
Style Enumerate
LatexType Item_Environment
LatexName orderedlist
+ ItemTag listitem
End
Style Description
LatexType Item_environment
LatexName variablelist
+ InnerTag varlistentry
+ LabelTag term
+ ItemTag listitem
End
# maybe List is the same as simplelist (I need to check it).
# Author : José Abílio Oliveira Matos <jamatos@lyx.org>
# This file is the counterpart of stdstarsections.inc
-# It is desireable, as far as possible, to have the same look and feeling for
+# It is desirable, as far as possible, to have the same look and feel for
# related layouts in latex and docbook.
# empty for now, it is possible to do it using bridgehead with attribute
# Author : José Abílio Oliveira Matos <jamatos@lyx.org>
# This file is the counterpart of stdstruct.inc
-# It is desireable, as far as possible, to have the same look and feeling for
+# It is desirable, as far as possible, to have the same look and feel for
# related layouts in latex and docbook.
Input stdstruct.inc
Style Abstract
LatexType Environment
LatexName abstract
- LatexParam para
+ InnerTag para
End
NoStyle Bibliography
LatexType Command
LatexName articleinfo
CommandDepth 2
- InnerTag "title"
+ InnerTag title
End
CopyStyle Author
LatexType Environment
LatexName authorgroup
- LatexParam author
+ InnerTag author
End
Margin Static
LatexType Command
LatexName revhistory
- LatexParam "3|!-- --"
+ CommandDepth 3
+ InnerTag "!-- --"
LeftMargin MMM
RightMargin MMM
ParIndent MM
Margin Dynamic
LatexType Command
LatexName revision
- LatexParam "4|revnumber"
+ CommandDepth 4
+ InnerTag revnumber
LabelSep xxx
ParSkip 0.4
TopSep 0.9
Style Title
LatexType Command
LatexName bookinfo
- LatexParam "1|"
+ CommandDepth 1
End
Style Title
LatexType Command
LatexName "!-- --"
- LatexParam "2|"
+ CommandDepth 2
End
Style Title
LatexType Command
LatexName "!-- --"
- LatexParam "3|"
+ CommandDepth 3
End
+2003-11-25 Martin Vermeer <martin.vermeer@hut.fi>
+
+ * src/buffer.C:
+ * src/lyxlayout.C:
+ * src/lyxlayout.h:
+ * src/lyxtext.h:
+ * src/output_docbook.C:
+ * src/output_latex.C:
+ * src/paragraph.C:
+ * src/paragraph.h:
+ * src/sgml.C:
+ * src/sgml.h:
+ * src/text2.C: Introducing a number of tags parametrizing various
+ XML formats that we may want to support
+
2003-11-25 André Pönitz <poenitz@gmx.net>
* InsetList.[Ch] (begein, end): inline as suggested by profiler
#include "buffer_funcs.h"
#include "bufferlist.h"
#include "bufferparams.h"
+#include "counters.h"
#include "Bullet.h"
#include "Chktex.h"
#include "debug.h"
ofs << "<!-- DocBook file was created by LyX " << lyx_version
<< "\n See http://www.lyx.org/ for more information -->\n";
+ params().getLyXTextClass().counters().reset();
docbookParagraphs(*this, paragraphs(), ofs, runparams);
ofs << "\n\n";
LT_TOPSEP,
LT_TOCLEVEL,
LT_INNERTAG,
+ LT_LABELTAG,
+ LT_ITEMTAG,
LT_INTITLE // keep this last!
};
{ "innertag", LT_INNERTAG },
{ "intitle", LT_INTITLE },
{ "itemsep", LT_ITEMSEP },
+ { "itemtag", LT_ITEMTAG },
{ "keepempty", LT_KEEPEMPTY },
{ "labelbottomsep", LT_LABEL_BOTTOMSEP },
{ "labelcounter", LT_LABELCOUNTER },
{ "labelsep", LT_LABELSEP },
{ "labelstring", LT_LABELSTRING },
{ "labelstringappendix", LT_LABELSTRING_APPENDIX },
+ { "labeltag", LT_LABELTAG },
{ "labeltype", LT_LABELTYPE },
{ "latexfooter", LT_LATEXFOOTER },
{ "latexheader", LT_LATEXHEADER },
case LT_LATEXPARAM:
if (lexrc.next())
- latexparam_ = lexrc.getString();
+ latexparam_ = subst(lexrc.getString(), """, "\"");
break;
case LT_INNERTAG:
innertag_ = lexrc.getString();
break;
+ case LT_LABELTAG:
+ if (lexrc.next())
+ labeltag_ = lexrc.getString();
+ break;
+
+ case LT_ITEMTAG:
+ if (lexrc.next())
+ itemtag_ = lexrc.getString();
+ break;
+
case LT_PREAMBLE:
preamble_ = lexrc.getLongString("EndPreamble");
break;
///
std::string const & innertag() const { return innertag_; }
///
+ std::string const & labeltag() const { return labeltag_; }
+ ///
+ std::string const & itemtag() const { return itemtag_; }
+ ///
std::string const & labelstring_appendix() const {
return labelstring_appendix_;
}
std::string latexparam_;
/// Internal tag to use (e.g., <title></title> for sect header)
std::string innertag_;
+ /// Internal tag to use e.g. to surround varlistentry label)
+ std::string labeltag_;
+ /// Internal tag to surround the item text in a list)
+ std::string itemtag_;
/// Macro definitions needed for this layout
std::string preamble_;
};
#include "Bidi.h"
#include "layout.h"
#include "lyxfont.h"
+#include "lyxtextclass.h"
#include "ParagraphList_fwd.h"
#include "RowList_fwd.h"
#include "textcursor.h"
/// return the default height of a row in pixels, considering font zoom
extern int defaultRowHeight();
+///
+std::string expandLabel(LyXTextClass const & textclass,
+ LyXLayout_ptr const & layout, bool appendix);
+
#endif // LYXTEXT_H
#include "buffer.h"
#include "bufferparams.h"
+#include "counters.h"
+#include "lyxtext.h"
#include "paragraph.h"
#include "paragraph_funcs.h"
#include "ParagraphParameters.h"
#include "support/lstrings.h"
#include "support/lyxlib.h"
+#include "support/tostr.h"
#include <stack>
using lyx::support::atoi;
using lyx::support::split;
+using lyx::support::subst;
using std::endl;
using std::ostream;
string command_name;
+ string item_tag;
+
ParagraphList::iterator par = const_cast<ParagraphList&>(paragraphs).begin();
ParagraphList::iterator pend = const_cast<ParagraphList&>(paragraphs).end();
+ Counters & counters = buf.params().getLyXTextClass().counters();
+
for (; par != pend; ++par) {
- string inner_tag;
- int desc_on = 0; // description mode
LyXLayout_ptr const & style = par->layout();
// environment tag closing
for (; depth > par->params().depth(); --depth) {
- if (!environment_inner[depth].empty())
sgml::closeEnvTags(os, false, environment_inner[depth],
- command_depth + depth);
+ item_tag, command_depth + depth);
sgml::closeTag(os, depth + command_depth, false, environment_stack[depth]);
environment_stack[depth].erase();
environment_inner[depth].erase();
&& environment_stack[depth] != style->latexname()
&& !environment_stack[depth].empty()) {
sgml::closeEnvTags(os, false, environment_inner[depth],
- command_depth + depth);
+ item_tag, command_depth + depth);
sgml::closeTag(os, depth + command_depth, false, environment_stack[depth]);
environment_stack[depth].erase();
environment_inner[depth].erase();
}
-
+
+ string ls = "";
+ bool labelid = false;
// Write opening SGML tags.
- string item_name;
switch (style->latextype) {
case LATEX_PARAGRAPH:
+ if (!style->latexparam().empty()) {
+ counters.step("para");
+ int i = counters.value("para");
+ ls = "id=\"" + subst(style->latexparam(), "#", tostr(i)) + '"';
+ }
sgml::openTag(os, depth + command_depth,
- false, style->latexname());
+ false, style->latexname(), ls);
break;
case LATEX_COMMAND:
command_name = style->latexname();
cmd_depth = style->commanddepth;
- inner_tag = style->innertag();
if (command_flag) {
if (cmd_depth < command_base) {
command_stack.push_back(string());
command_stack[command_depth] = command_name;
+ if (!style->latexparam().empty()) {
+ counters.step(style->counter);
+ }
// treat label as a special case for
// more WYSIWYM handling.
// This is a hack while paragraphs can't have
command_name += " id=\"";
command_name += (static_cast<InsetCommand *>(inset))->getContents();
command_name += '"';
- desc_on = 3;
+ labelid = true;
+ }
+ } else {
+ if (!style->latexparam().empty()) {
+ ls = expandLabel(buf.params().getLyXTextClass(), style, false);
+ ls = "id=\"" + subst(style->latexparam(), "#", ls) + '"';
}
}
+
+ sgml::openTag(os, depth + command_depth, false, command_name, ls);
+
+ // Label around sectioning number:
+ if (!style->labeltag().empty()) {
+ sgml::openTag(os, depth + 1 + command_depth, false,
+ style->labeltag());
+ os << expandLabel(buf.params().getLyXTextClass(), style, false);
+ sgml::closeTag(os, depth + 1 + command_depth, false,
+ style->labeltag());
+ }
- sgml::openTag(os, depth + command_depth, false, command_name);
// Inner tagged header text, e.g. <title> for sectioning:
- sgml::openTag(os, depth + 1 + command_depth, false, inner_tag);
+ sgml::openTag(os, depth + 1 + command_depth, false,
+ style->innertag());
break;
case LATEX_ENVIRONMENT:
}
environment_stack[depth] = style->latexname();
environment_inner[depth] = "!-- --";
- sgml::openTag(os, depth + command_depth, false, environment_stack[depth]);
+ // outputs <environment_stack[depth] latexparam()>
+ sgml::openTag(os, depth + command_depth, false,
+ environment_stack[depth], style->latexparam());
} else {
- sgml::closeEnvTags(os, false, environment_inner[depth],
- command_depth + depth);
+ sgml::closeEnvTags(os, false, environment_inner[depth],
+ style->itemtag(), command_depth + depth);
}
if (style->latextype == LATEX_ENVIRONMENT) {
- if (!style->latexparam().empty()) {
- if (style->latexparam() == "CDATA")
+ if (!style->innertag().empty()) {
+ if (style->innertag() == "CDATA")
os << "<![CDATA[";
else
- sgml::openTag(os, depth + command_depth, false, style->latexparam());
+ sgml::openTag(os, depth + command_depth, false,
+ style->innertag());
}
break;
}
- desc_on = (style->labeltype == LABEL_MANUAL);
+ environment_inner[depth] = style->innertag();
- environment_inner[depth] = desc_on ? "varlistentry" : "listitem";
- sgml::openTag(os, depth + 1 + command_depth,
+ if (!environment_inner[depth].empty())
+ sgml::openTag(os, depth + 1 + command_depth,
false, environment_inner[depth]);
-
- item_name = desc_on ? "term" : "para";
- sgml::openTag(os, depth + 1 + command_depth,
- false, item_name);
break;
default:
sgml::openTag(os, depth + command_depth,
break;
}
- par->simpleDocBookOnePar(buf, os, outerFont(par, paragraphs), desc_on,
- runparams, depth + 1 + command_depth);
+ par->simpleDocBookOnePar(buf, os, outerFont(par, paragraphs),
+ runparams, depth + 1 + command_depth, labelid);
- string end_tag;
// write closing SGML tags
switch (style->latextype) {
case LATEX_COMMAND:
- sgml::closeTag(os, depth + command_depth, false, inner_tag);
+ sgml::closeTag(os, depth + command_depth, false,
+ style->innertag());
break;
case LATEX_ENVIRONMENT:
- if (!style->latexparam().empty()) {
- if (style->latexparam() == "CDATA")
+ if (!style->innertag().empty()) {
+ if (style->innertag() == "CDATA")
os << "]]>";
else
- sgml::closeTag(os, depth + command_depth, false, style->latexparam());
+ sgml::closeTag(os, depth + command_depth, false,
+ style->innertag());
}
break;
case LATEX_ITEM_ENVIRONMENT:
- if (desc_on == 1) break;
- end_tag = "para";
- sgml::closeTag(os, depth + 1 + command_depth, false, end_tag);
+ item_tag = style->itemtag();
break;
case LATEX_PARAGRAPH:
sgml::closeTag(os, depth + command_depth, false, style->latexname());
for (int d = depth; d >= 0; --d) {
if (!environment_stack[depth].empty()) {
sgml::closeEnvTags(os, false, environment_inner[depth],
- command_depth + depth);
+ item_tag, command_depth + depth);
}
}
}
if (style->isEnvironment()) {
+ os << "\\begin{" << style->latexname() << '}';
if (style->latextype == LATEX_LIST_ENVIRONMENT) {
- os << "\\begin{" << style->latexname() << "}{"
- << pit->params().labelWidthString() << "}\n";
+ os << "{" << pit->params().labelWidthString() << "}\n";
} else if (style->labeltype == LABEL_BIBLIO) {
// ale970405
- os << "\\begin{" << style->latexname() << "}{"
- << bibitemWidest(buf)
- << "}\n";
- } else if (style->latextype == LATEX_ITEM_ENVIRONMENT) {
- os << "\\begin{" << style->latexname() << '}'
- << style->latexparam() << '\n';
+ os << "{" << bibitemWidest(buf) << "}\n";
} else
- os << "\\begin{" << style->latexname() << '}'
- << style->latexparam() << '\n';
+ os << style->latexparam() << '\n';
texrow.newline();
}
ParagraphList::iterator par = pit;
#include "buffer.h"
#include "bufferparams.h"
+#include "counters.h"
#include "encoding.h"
#include "debug.h"
#include "gettext.h"
#include "insets/insetoptarg.h"
#include "support/lstrings.h"
-#include "support/textutils.h"
#include "support/std_sstream.h"
+#include "support/textutils.h"
+#include "support/tostr.h"
#include <boost/tuple/tuple.hpp>
void Paragraph::simpleDocBookOnePar(Buffer const & buf,
ostream & os,
LyXFont const & outerfont,
- int & desc_on,
OutputParams const & runparams,
- lyx::depth_type depth) const
+ lyx::depth_type depth,
+ bool labelid) const
{
bool emph_flag = false;
LyXLayout_ptr const & style = layout();
+ LyXLayout_ptr const & defaultstyle
+ = buf.params().getLyXTextClass().defaultLayout();
LyXFont font_old = (style->labeltype == LABEL_MANUAL ? style->labelfont : style->font);
int char_line_count = depth;
- //if (!style.free_spacing)
- // os << string(depth,' ');
+ bool label_closed = true;
+ bool para_closed = true;
+
+ if (style->latextype == LATEX_ITEM_ENVIRONMENT) {
+ string ls = "";
+ Counters & counters = buf.params().getLyXTextClass().counters();
+ if (!style->free_spacing)
+ os << string(depth,' ');
+ if (!style->labeltag().empty()) {
+ os << "<" << style->labeltag() << ">\n";
+ label_closed = false;
+ } else {
+ if (!defaultstyle->latexparam().empty()) {
+ counters.step("para");
+ ls = tostr(counters.value("para"));
+ ls = " id=\""
+ + subst(defaultstyle->latexparam(), "#", ls) + '"';
+ }
+ os << "<" << style->itemtag() << ">\n"
+ << string(depth, ' ') << "<"
+ << defaultstyle->latexname() << ls << ">\n";
+ para_closed = false;
+ }
+ }
// parsing main loop
for (pos_type i = 0; i < size(); ++i) {
if (isInset(i)) {
InsetOld const * inset = getInset(i);
// don't print the inset in position 0 if desc_on == 3 (label)
- if (i || desc_on != 3) {
+ //if (i || desc_on != 3) {
+ if (!labelid) {
if (style->latexparam() == "CDATA")
os << "]]>";
inset->docbook(buf, os, runparams);
os << c;
} else if (isFreeSpacing() || c != ' ') {
os << str;
- } else if (desc_on == 1) {
+ } else if (!style->labeltag().empty() && !label_closed) {
++char_line_count;
- os << "\n</term><listitem><para>";
- desc_on = 2;
+ os << "\n</" << style->labeltag() << "><"
+ << style->itemtag() << "><"
+ << defaultstyle->latexname() << ">";
+ label_closed = true;
+ para_closed = false;
} else {
os << ' ';
}
}
// resets description flag correctly
- if (desc_on == 1) {
+ if (!label_closed) {
// <term> not closed...
- os << "</term>\n<listitem><para> </para>";
+ os << "</" << style->labeltag() << ">\n<"
+ << style->itemtag() << "><"
+ << defaultstyle->latexname() << "> ";
+ }
+ if (!para_closed) {
+ os << "\n" << string(depth, ' ') << "</"
+ << defaultstyle->latexname() << ">\n";
}
if (style->free_spacing)
os << '\n';
void simpleDocBookOnePar(Buffer const & buf,
std::ostream &,
LyXFont const & outerfont,
- int & desc_on,
OutputParams const & runparams,
- lyx::depth_type depth) const;
+ lyx::depth_type depth,
+ bool labelid) const;
///
bool hasSameLayout(Paragraph const & par) const;
int openTag(ostream & os, Paragraph::depth_type depth,
- bool mixcont, string const & latexname)
+ bool mixcont, string const & latexname,
+ string const & latexparam)
{
if (!latexname.empty() && latexname != "!-- --") {
if (!mixcont)
os << string(depth, ' ');
- os << '<' << latexname << '>';
+ os << '<' << latexname;
+ if (!latexparam.empty())
+ os << " " << latexparam;
+ os << '>';
}
if (!mixcont)
unsigned int closeEnvTags(ostream & os, bool mixcont,
string const & environment_inner_depth,
+ string const & itemtag,
lyx::depth_type total_depth)
{
unsigned int lines = 0;
if (environment_inner_depth != "!-- --") {
- string item_name= "listitem";
- lines += closeTag(os, total_depth, mixcont, item_name);
- if (environment_inner_depth == "varlistentry")
+ lines += closeTag(os, total_depth, mixcont, itemtag);
+ if (!environment_inner_depth.empty())
lines += closeTag(os, total_depth, mixcont,
environment_inner_depth);
}
/// FIXME
int openTag(std::ostream & os, lyx::depth_type depth,
- bool mixcont, std::string const & latexname);
+ bool mixcont, std::string const & latexname,
+ std::string const & latexparam = std::string());
/// FIXME
int closeTag(std::ostream & os, lyx::depth_type depth,
unsigned int closeEnvTags(std::ostream & os,
bool mixcont,
std::string const & environment_inner_depth,
+ std::string const & item_tag,
lyx::depth_type total_depth);
}
}
-namespace {
-
string expandLabel(LyXTextClass const & textclass,
LyXLayout_ptr const & layout, bool appendix)
{
}
+namespace {
+
void incrementItemDepth(ParagraphList::iterator pit,
ParagraphList::iterator first_pit)
{