"Lars Gullik Bjønnes" wrote: > > *Jean-Marc Lasgouttes writes: > | If you can remove that, this would be fine. > > Agree. > > Lgb Hello, I have have a few question related with this: Is it possible/desirable to have an extra field within the \ref inset? The goal is to have a unique interface for cross-references, between the latex, linuxdoc, and docbook layouts. The extra field could be ignored by the latex "front-end", but it would be used by the linuxdoc and docbook. Is there any inset with optional atributes? This is only relevant for the \url and \htmlurl insets, since \htmlurl is a special case of \url, and this distinction is only relevant for the linuxdoc "front-end". I would like to have only one inset, to avoid extra-work to change between linuxdoc and docbook... Any suggestions are welcome... With this message follows two small diff, diff.C and diff.h, which should be applied respectivelly to buffer.C and buffer.h to completly support the textclasses, and to add the support for footnotes for linuxdoc. Tell me if it applies cleanly... José -- José Abílio de Oliveira Matos ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Zounds! I was never so bethumped with words since I first called my brother's father dad. -- William Shakespeare, "King John"
--- buffer.C.orig Wed Nov 25 16:09:50 1998 +++ buffer.C Fri Nov 27 12:02:01 1998 @@ -1951,9 +1951,8 @@ void Buffer::makeLinuxDocFile(LString const & filename, int column) { LyXParagraph *par = paragraph; - //LyXParagraph *prevpar = par; - LyXFont font; + LString top_element=lyxstyle.LatexnameOfClass(params.textclass); LString environment_stack[10]; LString item_name; @@ -1982,7 +1981,7 @@ fprintf(file, "<!-- LinuxDoc file was created by LyX 1.0 (C) 1995-1998 "); fprintf(file, "by <%s> %s -->\n", userName.c_str(), (char *)date()); - fprintf(file, "<article>\n"); + sgmlOpenTag(file,0,top_element); while (par) { if (par->IsDummy()) { @@ -2005,7 +2004,7 @@ } par = par->next; - linuxDocHandleFootnote(par); + linuxDocHandleFootnote(file,par); continue; } @@ -2078,7 +2077,7 @@ break; } - SimpleLinuxDocOnePar(file, font, par, desc_on); + SimpleLinuxDocOnePar(file, par, desc_on); /* write closing SGML tags */ switch(style->latextype) { @@ -2093,7 +2092,7 @@ par = par->next; - linuxDocHandleFootnote(par); + linuxDocHandleFootnote(file,par); } } @@ -2105,7 +2104,8 @@ if(environment_stack[depth] != "") sgmlCloseTag(file,depth,environment_stack[depth]); - fprintf(file, "\n\n</article>\n"); + fprintf(file, "\n\n"); + sgmlCloseTag(file,0,top_element); if (file.close()) { WriteFSAlert(_("Error! Could not close file properly:"), @@ -2114,10 +2114,12 @@ } -void Buffer::linuxDocHandleFootnote(LyXParagraph* &par) +void Buffer::linuxDocHandleFootnote(FILE *file,LyXParagraph* &par) { while (par && par->footnoteflag != LyXParagraph::NO_FOOTNOTE) { - /* no footnote support yet */ + fprintf(file,"<footnote> "); + SimpleLinuxDocOnePar(file, par, 0); + fprintf(file,"</footnote>\n"); par = par->next; } } @@ -2231,10 +2233,9 @@ } -void Buffer::SimpleLinuxDocOnePar(FILE *file, LyXFont &font1, - LyXParagraph *par, int desc_on) +void Buffer::SimpleLinuxDocOnePar(FILE *file, LyXParagraph *par, int desc_on) { - LyXFont font2; + LyXFont font1,font2; char c; Inset *inset; int main_body, j;
--- buffer.h.orig Fri Nov 27 11:46:41 1998 +++ buffer.h Fri Nov 27 11:56:09 1998 @@ -307,7 +307,7 @@ void insertErrors(TeXErrors &); /// - void linuxDocHandleFootnote(LyXParagraph*&par); + void linuxDocHandleFootnote(FILE *file,LyXParagraph* &par); /// bool linuxDocConvertChar(char c, LString &sgml_string); /// @@ -317,8 +317,7 @@ /// void LinuxDocError(LyXParagraph *par, int pos, char const *message); /// - void SimpleLinuxDocOnePar(FILE *file, LyXFont &font1, - LyXParagraph *par, int desc_on); + void SimpleLinuxDocOnePar(FILE *file, LyXParagraph *par, int desc_on); /** Gets next LinuxDoc parameter.