+2001-07-07 Lars Gullik Bjønnes <larsbj@birdstep.com>
+
+ * boost/config.hpp: update
+
2001-06-07 Lars Gullik Bjønnes <larsbj@birdstep.com>
* boost/limits.hpp: completely bogus jug addon removed.
+2001-07-08 Lars Gullik Bjønnes <larsbj@birdstep.com>
+
+ * ui/default.ui: comment out tex-mode
+
+ * layouts/stdlayouts.inc: comment out style LaTeX
+
+ * bind/menus.bind: comment out tex-mode
+
2001-07-06 Dekel Tsur <dekelts@tau.ac.il>
* layouts/IEEEtran.layout: Add qed box at the end of proof.
\bind "M-c p" "font-code"
\bind "M-c r" "font-roman"
\bind "M-c s" "font-sans"
-\bind "M-c t" "tex-mode"
+#\bind "M-c t" "tex-mode"
\bind "M-c u" "font-underline"
\bind "M-c Down" "word-lowcase"
# quotations and such.
# LaTeX style definition
-Style LaTeX
- Margin Static
- LatexType Paragraph
- LatexName dummy
- NewLine 0
- ParIndent MM
- ParSkip 0.4
- ParSep 0.5
- Align Block
- AlignPossible Block, Left, Right, Center
- LabelType No_Label
- FreeSpacing 1
-
- # standard font definition
- Font
- Latex Latex
- EndFont
-
-End
+#Style LaTeX
+# Margin Static
+# LatexType Paragraph
+# LatexName dummy
+# NewLine 0
+# ParIndent MM
+# ParSkip 0.4
+# ParSep 0.5
+# Align Block
+# AlignPossible Block, Left, Right, Center
+# LabelType No_Label
+# FreeSpacing 1
+#
+# # standard font definition
+# Font
+# Latex Latex
+# EndFont
+#
+#End
# Quotation style definition
Style Quotation
Item "Emphasize Style|E" "font-emph"
Item "Noun Style|N" "font-noun"
Item "Bold Style|B" "font-bold"
- Item "TeX Style|X" "tex-mode"
+# Item "TeX Style|X" "tex-mode"
Separator
Item "Change Environment Depth|v" "depth-increment"
Item "LaTeX Preamble...|L" "layout-preamble"
src/CutAndPaste.C
src/debug.C
src/exporter.C
-src/ext_l10n.h
src/figure_form.C
src/figureForm.C
src/FontLoader.C
+2001-07-08 Lars Gullik Bjønnes <larsbj@birdstep.com>
+
+ * lyxfont.h: turn NO_LATEX on as default
+
+ * buffer.C (insertErtContents): new methods of tex style compability.
+ (parseSingleLyXformat2Token): use it several places.
+ * tabular.C (OldFormatRead): and here
+
2001-07-07 Lars Gullik Bjønnes <larsbj@birdstep.com>
* text2.C: remove some commented code.
lyx_LDADD = $(lyx_DEPENDENCIES) @INTLLIBS@ $(LYX_LIBS) $(SIGC_LIBS) \
$(PSPELL_LIBS) @FRONTEND_LDFLAGS@ @FRONTEND_LIBS@
#lyx_LDFLAGS=-Wl,-O1
-EXTRA_DIST = config.h.in stamp-h.in cheaders
+EXTRA_DIST = config.h.in stamp-h.in cheaders ext_l10n.h
ETAGS_ARGS = --lang=c++
BOOST_INCLUDES = -I$(top_srcdir)/boost
INCLUDES = $(SIGC_CFLAGS) $(BOOST_INCLUDES) $(PSPELL_INCLUDES) @FRONTEND_INCLUDES@
encoding.h \
exporter.C \
exporter.h \
- ext_l10n.h \
figure.h \
figure_form.C \
figure_form.h \
namespace {
string last_inset_read;
+string inset_ert_contents;
+bool ert_active = false;
} // anon
+void Buffer::insertErtContents(Paragraph * par, int & pos,
+ LyXFont const & font, bool set_inactive)
+{
+ if (!inset_ert_contents.empty()) {
+ lyxerr[Debug::INSETS] << "ERT contents:\n"
+ << inset_ert_contents << endl;
+ Inset * inset = new InsetERT(inset_ert_contents);
+ par->insertInset(pos++, inset, font);
+ inset_ert_contents.erase();
+ }
+ if (set_inactive) {
+ ert_active = false;
+ }
+}
+
+
bool
Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
Paragraph *& return_par,
)
{
bool the_end_read = false;
-#ifdef NO_LATEX
- static string inset_ert_contents;
-#endif
#ifndef NO_PEXTRA_REALLY
// This is super temporary but is needed to get the compability
// mode for minipages work correctly together with new tabulars.
#endif
if (token[0] != '\\') {
+#ifdef NO_LATEX
+ if (ert_active) {
+ inset_ert_contents += token;
+ } else {
+#endif
for (string::const_iterator cit = token.begin();
cit != token.end(); ++cit) {
par->insertChar(pos, (*cit), font);
++pos;
}
checkminipage = true;
+#ifdef NO_LATEX
+ }
+#endif
} else if (token == "\\i") {
Inset * inset = new InsetLatexAccent;
inset->read(this, lex);
} else if (token == "\\layout") {
#ifdef NO_LATEX
// Do the insetert.
- if (!inset_ert_contents.empty()) {
- Inset * inset = new InsetERT(inset_ert_contents);
- par->insertInset(pos, inset, font);
- ++pos;
- inset_ert_contents.erase();
- }
+ insertErtContents(par, pos, font);
#endif
lex.EatLine();
string const layoutname = lex.GetString();
= textclasslist.NumberOfLayout(params.textclass,
layoutname);
+#ifdef NO_LATEX
+ if (compare_no_case(layoutname, "latex") == 0) {
+ ert_active = true;
+ }
+#endif
#ifdef USE_CAPTION
// The is the compability reading of layout caption.
// It can be removed in LyX version 1.3.0. (Lgb)
lex.next();
string const tok = lex.GetString();
if (tok == "no_latex") {
- ; // nothing
+ // Do the insetert.
+ insertErtContents(par, pos, font);
} else if (tok == "latex") {
- ; // nothing
+ ert_active = true;
} else if (tok == "default") {
- ; // nothing
+ // Do the insetert.
+ insertErtContents(par, pos, font);
} else {
lex.printError("Unknown LaTeX font flag "
"`$$Token'");
}
++pos;
} else if (token == "\\newline") {
+#ifdef NO_LATEX
+ // Since we cannot know it this is only a regular newline or a
+ // tabular cell delimter we have to handle the ERT here.
+ insertErtContents(par, pos, font, false);
+#endif
par->insertChar(pos, Paragraph::META_NEWLINE, font);
++pos;
} else if (token == "\\LyXTable") {
}
par->bibkey->read(this, lex);
} else if (token == "\\backslash") {
+#ifdef NO_LATEX
+ if (ert_active) {
+ inset_ert_contents += "\\";
+ } else {
+#endif
par->insertChar(pos, '\\', font);
++pos;
+#ifdef NO_LATEX
+ }
+#endif
} else if (token == "\\the_end") {
+#ifdef NO_LATEX
+ // If we still have some ert active here we have to insert
+ // it so we don't loose it. (Lgb)
+ insertErtContents(par, pos, font);
+#endif
the_end_read = true;
minipar = parBeforeMinipage = 0;
} else {
+#ifdef NO_LATEX
+ if (ert_active) {
+ inset_ert_contents += token;
+ } else {
+#endif
// This should be insurance for the future: (Asger)
lex.printError("Unknown token `$$Token'. "
"Inserting as text.");
par->insertChar(pos, (*cit), font);
++pos;
}
+#ifdef NO_LATEX
+ }
+#endif
}
#ifndef NO_PEXTRA_REALLY
// now check if we have a minipage paragraph as at this
string const & token, int & pos,
Paragraph::depth_type & depth,
LyXFont &);
+ ///
+ void insertErtContents(Paragraph * par, int & pos,
+ LyXFont const & font,
+ bool set_inactive = true);
private:
/// Parse a single inset.
void readInset(LyXLex &, Paragraph *& par, int & pos, LyXFont &);
+2001-07-08 Lars Gullik Bjønnes <larsbj@birdstep.com>
+
+ * insetert.C (InsetERT): new contructor
+
2001-07-06 Juergen Vigna <jug@sad.it>
* a lot of files: added implementation of the below new functions
InsetERT::InsetERT() : InsetCollapsable()
{
setLabel(_("666"));
-#ifndef NO_LATEX
+ //LyXFont font(LyXFont::ALL_SANE);
+ //font.setLatex (LyXFont::ON);
+ labelfont = LyXFont(LyXFont::ALL_SANE);
+ labelfont.decSize();
+ labelfont.decSize();
+ labelfont.setColor(LColor::latex);
+ setAutoCollapse(false);
+ setInsetName("ERT");
+}
+
+
+InsetERT::InsetERT(string const & contents)
+{
+ setLabel(_("666"));
LyXFont font(LyXFont::ALL_SANE);
- font.setLatex (LyXFont::ON);
+#ifndef NO_LATEX
+ font.setLatex(LyXFont::ON);
+#else
+ font.setColor(LColor::latex);
#endif
labelfont = LyXFont(LyXFont::ALL_SANE);
labelfont.decSize();
labelfont.setColor(LColor::latex);
setAutoCollapse(false);
setInsetName("ERT");
+
+ string::const_iterator cit = contents.begin();
+ string::const_iterator end = contents.end();
+ Paragraph::size_type pos = 0;
+ for (; cit != end; ++cit) {
+ inset.paragraph()->insertChar(pos++, *cit, font);
+ }
}
///
InsetERT();
///
+ InsetERT(string const & contents);
+ ///
virtual void write(Buffer const * buf, std::ostream & os) const;
///
virtual Inset * clone(Buffer const &, bool same_id = false) const;
sel_cell_end = tabular->GetNumberOfCells() - 1;
}
if (hasSelection()) {
- bool frozen;
setUndo(bv, Undo::EDIT,
bv->text->cursor.par(),
bv->text->cursor.par()->next());
- frozen = undo_frozen;
+ bool frozen = undo_frozen;
if (!frozen)
freezeUndo();
// apply the fontchange on the whole selection
#include "converter.h"
#include "language.h"
#include "support/os.h"
+// for NO_LATEX
+#if 1
+#include "lyxfont.h"
+#endif
using std::endl;
class BufferParams;
-//#define NO_LATEX 1
+#define NO_LATEX 1
///
class LyXFont {
void mathPrintError(string const & msg)
{
- lyxerr << "Line ~" << yylineno << ": Math parse error: " << msg << endl;
+ lyxerr[Debug::MATHED] << "Line ~" << yylineno << ": Math parse error: " << msg << endl;
}
if (!lf)
lf = c;
else if (c != lf) {
- lyxerr << "Math parse error: unexpected '" << c << "'" << endl;
+ lyxerr[Debug::MATHED] << "Math parse error: unexpected '" << c << "'" << endl;
return '\0';
}
break;
if (lf == '[') rg = ']';
if (lf == '(') rg = ')';
if (!rg) {
- lyxerr << "Math parse error: unknown bracket '" << lf << "'" << endl;
+ lyxerr[Debug::MATHED] << "Math parse error: unknown bracket '" << lf << "'" << endl;
return '\0';
}
yytext.erase();
}
if (yyis->good())
yyis->putback(c);
- lyxerr << "reading: text '" << yytext << "'\n";
+ lyxerr[Debug::MATHED] << "reading: text '" << yytext << "'\n";
latexkeys const * l = in_word_set(yytext);
if (!l)
return LM_TK_UNDEF;
p = new MathMacroTemplate(name, na);
mathed_parse(p->cell(0), FLAG_BRACE | FLAG_BRACE_LAST);
- lyxerr << "LM_TK_NEWCOMMAND: name: " << name << " na: " << na << "\n";
+ lyxerr[Debug::MATHED] << "LM_TK_NEWCOMMAND: name: " << name << " na: " << na << "\n";
break;
}
case LM_TK_BEGIN: {
int i = yylval.i;
- lyxerr << "reading math environment " << i << " "
+ lyxerr[Debug::MATHED] << "reading math environment " << i << " "
<< latex_mathenv[i].name << "\n";
MathInsetTypes typ = latex_mathenv[i].typ;
case LM_OT_ALIGNAT: {
LexGetArg('{');
//int c = atoi(yytext.c_str());
- lyxerr << "LM_OT_ALIGNAT: not implemented\n";
+ lyxerr[Debug::MATHED] << "LM_OT_ALIGNAT: not implemented\n";
mathed_parse_lines(p, 2, latex_mathenv[i].numbered, true);
- lyxerr << "LM_OT_ALIGNAT: par: " << *p << "\n";
+ lyxerr[Debug::MATHED] << "LM_OT_ALIGNAT: par: " << *p << "\n";
break;
}
default:
- lyxerr << "1: unknown math environment: " << typ << "\n";
+ lyxerr[Debug::MATHED] << "1: unknown math environment: " << typ << "\n";
}
p->SetName(latex_mathenv[i].basename);
}
default:
- lyxerr << "2 unknown math environment: " << t << "\n";
+ lyxerr[Debug::MATHED] << "2 unknown math environment: " << t << "\n";
}
return p;
--plevel;
return;
}
- lyxerr << "found tab unexpectedly, array: '" << array << "'\n";
+ lyxerr[Debug::MATHED] << "found tab unexpectedly, array: '" << array << "'\n";
break;
}
--plevel;
return;
}
- lyxerr << "found newline unexpectedly, array: '" << array << "'\n";
+ lyxerr[Debug::MATHED] << "found newline unexpectedly, array: '" << array << "'\n";
break;
}
case LM_TK_STY:
{
- lyxerr << "LM_TK_STY not implemented\n";
+ lyxerr[Debug::MATHED] << "LM_TK_STY not implemented\n";
//MathArray tmp = array;
//MathSizeInset * p = new MathSizeInset(MathStyles(yylval.l->id));
//array.push_back(p);
//lyxerr << "read matrix " << *mm << "\n";
break;
} else
- lyxerr << "unknow math inset " << typ << "\n";
+ lyxerr[Debug::MATHED] << "unknow math inset " << typ << "\n";
break;
}
if (rg != '}') {
mathPrintError("Expected '{'");
// debug info
- lyxerr << "[" << yytext << "]" << endl;
+ lyxerr[Debug::MATHED] << "[" << yytext << "]" << endl;
panic = true;
break;
}
default:
mathPrintError("Unrecognized token");
- lyxerr << "[" << t << " " << yytext << "]" << endl;
+ lyxerr[Debug::MATHED] << "[" << t << " " << yytext << "]" << endl;
break;
} // end of big switch
lex.nextToken();
if (lex.GetString() == "\\end_inset")
break;
- lyxerr << "InsetFormula::Read: Garbage before \\end_inset,"
+ lyxerr[Debug::MATHED] << "InsetFormula::Read: Garbage before \\end_inset,"
" or missing \\end_inset!" << endl;
}
|| token == "\\end_float"
|| token == "\\end_deeper") {
lex.pushToken(token);
+ // Here we need to insert the inset_ert_contents into the last
+ // cell of the tabular.
+ owner_->bufferOwner()->insertErtContents(par, pos, font);
+
break;
}
if (owner_->bufferOwner()->parseSingleLyXformat2Token(lex, par,