+2003-07-27 José Matos <jamatos@fep.up.pt>
+
+ * layouts/linuxdoc.layout: add support for tables and figures (linuxdoc).
+
2003-07-22 John Levon <levon@movementarian.org>
* ui/stdmenu.ui: fix up mnemonics to not clash, standardise
DefaultStyle Standard
Input stdcounters.inc
+Input stdfloats.inc
# Standard style definition
Style Standard
FreeSpacing 1
PassThru 1
End
+
+# Caption style definition
+Style Caption
+ Margin First_Dynamic
+ LatexType Paragraph
+ LatexName caption
+ NeedProtect 1
+ LabelSep xx
+ ParSkip 0.4
+ TopSep 0.5
+ Align Center
+ AlignPossible Center
+ LabelType Sensitive
+ LabelString Caption
+ OptionalArgs 1
+
+ # label font definition
+ LabelFont
+ Series Bold
+ EndFont
+End
+2003-07-27 José Matos <jamatos@fep.up.pt>
+
+ * tabular.[Ch] (linuxdoc): add support for tables and figures (linuxdoc).
+
2003-07-27 José Matos <jamatos@fep.up.pt>
* buffer.[Ch] (makeLaTeXFile): changed name of arguments for
+2003-07-27 José Matos <jamatos@fep.up.pt>
+
+ * insetfloat.[Ch] (linuxdoc):
+ * insetgraphics.C (linuxdoc):
+ * insettabular.C (linuxdoc):
+ * insettext.[Ch] (linuxdoc): add support for tables and figures (linuxdoc).
+
2003-07-27 José Matos <jamatos@fep.up.pt>
* insetinclude (latex): comply with makeLaTeXFile argument change.
}
+int InsetFloat::linuxdoc(Buffer const * buf, ostream & os) const
+{
+ FloatList const & floats = buf->params.getLyXTextClass().floats();
+ string const tmptype = params_.type;
+ // Figure out the float placement to use.
+ // From lowest to highest:
+ // - float default placement
+ // - document wide default placement
+ // - specific float placement
+ // This is the same as latex, as linuxdoc is modeled after latex.
+
+ string placement;
+ string const buf_placement = buf->params.float_placement;
+ string const def_placement = floats.defaultPlacement(params_.type);
+ if (!params_.placement.empty()
+ && params_.placement != def_placement) {
+ placement = params_.placement;
+ } else if (params_.placement.empty()
+ && !buf_placement.empty()
+ && buf_placement != def_placement) {
+ placement = buf_placement;
+ }
+
+ os << "\n<" << tmptype ;
+ // We only output placement if different from the def_placement.
+ if (!placement.empty()) {
+ os << " loc=\"" << placement << '"';
+ }
+ os << ">";
+
+ int const i = inset.linuxdoc(buf, os);
+ os << "</" << tmptype << ">\n";
+
+ return i;
+}
+
+
int InsetFloat::docbook(Buffer const * buf, ostream & os, bool mixcont) const
{
os << '<' << params_.type << '>';
int latex(Buffer const *, std::ostream &,
LatexRunParams const &) const;
///
+ int linuxdoc(Buffer const *, std::ostream &) const;
+ ///
int docbook(Buffer const *, std::ostream &, bool mixcont) const;
///
string const editMessage() const;
}
-int InsetGraphics::linuxdoc(Buffer const *, ostream &) const
+int InsetGraphics::linuxdoc(Buffer const * buf, ostream & os) const
{
- // No graphics in LinuxDoc output. Should check how/what to add.
+ string const file_name = buf->niceFile ?
+ params().filename.relFilename(buf->filePath()):
+ params().filename.absFilename();
+
+ os << "<eps file=\"" << file_name << "\">\n";
+ os << "<img src=\"" << file_name << "\">";
return 0;
}
int InsetTabular::linuxdoc(Buffer const * buf, ostream & os) const
{
- os << "<![CDATA[";
- int const ret = tabular.ascii(buf,os,
- (int)parOwner()->params().depth(),
- false, 0);
- os << "]]>";
- return ret;
+ return tabular.linuxdoc(buf,os);
}
return lines;
}
+int InsetText::linuxdoc(Buffer const * buf, ostream & os) const
+{
+ ParagraphList::iterator pit = const_cast<ParagraphList&>(paragraphs).begin();
+ ParagraphList::iterator pend = const_cast<ParagraphList&>(paragraphs).end();
+
+ // There is a confusion between the empty paragraph and the default paragraph
+ // The default paragraph is <p></p>, the empty paragraph is *empty*
+ // Since none of the floats of linuxdoc accepts standard paragraphs
+ // I disable them. I don't expect problems. (jamatos 2003/07/27)
+ for (; pit != pend; ++pit) {
+ const string name = pit->layout()->latexname();
+ if (name != "p")
+ sgml::openTag(os, 1, 0, name);
+ buf->simpleLinuxDocOnePar(os, pit, 0);
+ if (name != "p")
+ sgml::closeTag(os, 1, 0, name);
+ }
+ return 0;
+}
int InsetText::docbook(Buffer const * buf, ostream & os, bool mixcont) const
{
///
int ascii(Buffer const *, std::ostream &, int linelen) const;
///
- int linuxdoc(Buffer const *, std::ostream &) const { return 0; }
+ int linuxdoc(Buffer const *, std::ostream &) const ;
///
int docbook(Buffer const *, std::ostream &, bool mixcont) const ;
///
}
+int LyXTabular::linuxdoc(Buffer const * buf, ostream & os) const
+{
+ os << "<tabular ca=\"";
+ for (int i = 0; i < columns_; ++i) {
+ switch (column_info[i].alignment) {
+ case LYX_ALIGN_LEFT:
+ os << 'l';
+ break;
+ case LYX_ALIGN_RIGHT:
+ os << 'r';
+ break;
+ default:
+ os << 'c';
+ break;
+ }
+ }
+ os << "\">\n";
+ int cell = 0;
+ int ret = 0;
+ for (int i = 0; i < rows_; ++i) {
+ for (int j = 0; j < columns_; ++j) {
+ if (isPartOfMultiColumn(i, j))
+ continue;
+ InsetText & inset = getCellInset(cell);
+
+ ret += inset.linuxdoc(buf, os);
+
+ if (isLastCellInRow(cell)) {
+ os << "@\n";
+ ++ret;
+ } else {
+ os << "|";
+ }
+ ++cell;
+ }
+ }
+ os << "</tabular>\n";
+ return ret;
+}
+
+
int LyXTabular::docbookRow(Buffer const * buf, ostream & os, int row) const
{
int ret = 0;
///
int latex(Buffer const *, std::ostream &,
LatexRunParams const &) const;
+ //
+ int linuxdoc(Buffer const * buf, std::ostream & os) const;
///
int docbook(Buffer const * buf, std::ostream & os, bool mixcont) const;
///