]> matita.cs.unibo.it Git - helm.git/commitdiff
* changed handling of ' (\primes) with a few patches in the stylesheets
authorLuca Padovani <luca.padovani@unito.it>
Wed, 12 Mar 2003 10:18:02 +0000 (10:18 +0000)
committerLuca Padovani <luca.padovani@unito.it>
Wed, 12 Mar 2003 10:18:02 +0000 (10:18 +0000)
17 files changed:
helm/DEVEL/mathml_editor/Makefile.am
helm/DEVEL/mathml_editor/Makefile.in
helm/DEVEL/mathml_editor/TODO [new file with mode: 0644]
helm/DEVEL/mathml_editor/configure.ac
helm/DEVEL/mathml_editor/dictionary-tex.xml
helm/DEVEL/mathml_editor/editex-config.in [deleted file]
helm/DEVEL/mathml_editor/editex.pc.in [new file with mode: 0644]
helm/DEVEL/mathml_editor/ocaml/ml_mathml_editor.c
helm/DEVEL/mathml_editor/src/Makefile.am
helm/DEVEL/mathml_editor/src/Makefile.in
helm/DEVEL/mathml_editor/src/TPushParser.cc
helm/DEVEL/mathml_editor/src/TPushParser.hh
helm/DEVEL/mathml_editor/test/Makefile.in
helm/DEVEL/mathml_editor/test/editor.cc
helm/DEVEL/mathml_editor/test/guiGTK.c
helm/DEVEL/mathml_editor/xsl/tml-mmlp.xsl
helm/DEVEL/mathml_editor/xsl/tml-tex.xsl

index 20f515335782a7368299ae12f7c9f6d4b3984634..63f89fc1fa7cc9e02b5a055099332bffdddc58a0 100644 (file)
@@ -2,7 +2,8 @@
 SUBDIRS = src test ocaml textomml
 CLEANFILES = core
 
-bin_SCRIPTS = editex-config
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = editex.pc
 
 backup:
        cd ..; tar cvfz @PACKAGE@-@VERSION@-`date|tr ' ' '_'|tr ':' '_'`.tar.gz @PACKAGE@
index cdb115fcd60d25fe6b089ee3e50e5a2cb8149f33..8e9c9ef1f87877b3e5e1fa0e9aeb73949c863931 100644 (file)
@@ -72,6 +72,8 @@ EDITEX_VERSION_INFO = @EDITEX_VERSION_INFO@
 EXEEXT = @EXEEXT@
 GDOMEXSLT_CFLAGS = @GDOMEXSLT_CFLAGS@
 GDOMEXSLT_LIBS = @GDOMEXSLT_LIBS@
+GLIB2_CFLAGS = @GLIB2_CFLAGS@
+GLIB2_LIBS = @GLIB2_LIBS@
 GMETADOM_CFLAGS = @GMETADOM_CFLAGS@
 GMETADOM_LIBS = @GMETADOM_LIBS@
 GTKMATHVIEW_CFLAGS = @GTKMATHVIEW_CFLAGS@
@@ -97,6 +99,7 @@ OCAMLSTDLIBDIR = @OCAMLSTDLIBDIR@
 OCAMLSTUBDIR = @OCAMLSTUBDIR@
 OCAML_INCLUDE_DIR = @OCAML_INCLUDE_DIR@
 PACKAGE = @PACKAGE@
+PKG_CONFIG = @PKG_CONFIG@
 RANLIB = @RANLIB@
 STRIP = @STRIP@
 VERSION = @VERSION@
@@ -104,16 +107,17 @@ VERSION = @VERSION@
 SUBDIRS = src test ocaml textomml
 CLEANFILES = core
 
-bin_SCRIPTS = editex-config
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = editex.pc
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = config.h
-CONFIG_CLEAN_FILES =  editex-config
-SCRIPTS =  $(bin_SCRIPTS)
+CONFIG_CLEAN_FILES =  editex.pc
+DATA =  $(pkgconfig_DATA)
 
 DIST_COMMON =  README ./stamp-h.in AUTHORS COPYING ChangeLog INSTALL \
-Makefile.am Makefile.in NEWS aclocal.m4 config.guess config.h.in \
-config.sub configure configure.ac editex-config.in install-sh ltmain.sh \
+Makefile.am Makefile.in NEWS TODO aclocal.m4 config.guess config.h.in \
+config.sub configure configure.ac editex.pc.in install-sh ltmain.sh \
 missing mkinstalldirs
 
 
@@ -165,26 +169,26 @@ distclean-hdr:
        -rm -f config.h
 
 maintainer-clean-hdr:
-editex-config: $(top_builddir)/config.status editex-config.in
+editex.pc: $(top_builddir)/config.status editex.pc.in
        cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
 
-install-binSCRIPTS: $(bin_SCRIPTS)
+install-pkgconfigDATA: $(pkgconfig_DATA)
        @$(NORMAL_INSTALL)
-       $(mkinstalldirs) $(DESTDIR)$(bindir)
-       @list='$(bin_SCRIPTS)'; for p in $$list; do \
-         if test -f $$p; then \
-           echo " $(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \
-           $(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \
-         else if test -f $(srcdir)/$$p; then \
-           echo " $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \
-           $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \
-         else :; fi; fi; \
+       $(mkinstalldirs) $(DESTDIR)$(pkgconfigdir)
+       @list='$(pkgconfig_DATA)'; for p in $$list; do \
+         if test -f $(srcdir)/$$p; then \
+           echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkgconfigdir)/$$p"; \
+           $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkgconfigdir)/$$p; \
+         else if test -f $$p; then \
+           echo " $(INSTALL_DATA) $$p $(DESTDIR)$(pkgconfigdir)/$$p"; \
+           $(INSTALL_DATA) $$p $(DESTDIR)$(pkgconfigdir)/$$p; \
+         fi; fi; \
        done
 
-uninstall-binSCRIPTS:
+uninstall-pkgconfigDATA:
        @$(NORMAL_UNINSTALL)
-       list='$(bin_SCRIPTS)'; for p in $$list; do \
-         rm -f $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \
+       list='$(pkgconfig_DATA)'; for p in $$list; do \
+         rm -f $(DESTDIR)$(pkgconfigdir)/$$p; \
        done
 
 # This directory's subdirectories are mostly independent; you can cd
@@ -350,24 +354,24 @@ installcheck: installcheck-recursive
 all-recursive-am: config.h
        $(MAKE) $(AM_MAKEFLAGS) all-recursive
 
-install-exec-am: install-binSCRIPTS
+install-exec-am:
 install-exec: install-exec-recursive
 
-install-data-am:
+install-data-am: install-pkgconfigDATA
 install-data: install-data-recursive
 
 install-am: all-am
        @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
 install: install-recursive
-uninstall-am: uninstall-binSCRIPTS
+uninstall-am: uninstall-pkgconfigDATA
 uninstall: uninstall-recursive
-all-am: Makefile $(SCRIPTS) config.h
+all-am: Makefile $(DATA) config.h
 all-redirect: all-recursive-am
 install-strip:
        $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
 installdirs: installdirs-recursive
 installdirs-am:
-       $(mkinstalldirs)  $(DESTDIR)$(bindir)
+       $(mkinstalldirs)  $(DESTDIR)$(pkgconfigdir)
 
 
 mostlyclean-generic:
@@ -403,7 +407,7 @@ maintainer-clean: maintainer-clean-recursive
        -rm -f config.status
 
 .PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
-uninstall-binSCRIPTS install-binSCRIPTS install-data-recursive \
+uninstall-pkgconfigDATA install-pkgconfigDATA install-data-recursive \
 uninstall-data-recursive install-exec-recursive \
 uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
 all-recursive check-recursive installcheck-recursive info-recursive \
diff --git a/helm/DEVEL/mathml_editor/TODO b/helm/DEVEL/mathml_editor/TODO
new file mode 100644 (file)
index 0000000..701ec46
--- /dev/null
@@ -0,0 +1,13 @@
+
+* add param node in the TML with the name of the parameter
+* add space node? active node?
+* add alt boolean to all deleting methods
+* implement a mechanism that allows the definition of new macros
+* add open-group close-group attributes in the dictionary and handle them
+* implement macro completion
+
+BUGS
+* $1\over{2}$ does not work
+
+* compare pure_subst/pure_diff/subst_diff performances
+
index be109d69c013a55db0db2074af5326291a9aff6f..2ea4dfb15b522723787c00285aa1c62c0876efbe 100644 (file)
@@ -1,9 +1,13 @@
 dnl Process this file with autoconf to produce a configure script.
-AC_INIT
-AC_CONFIG_SRCDIR([src/TToken.hh])
+AC_INIT(editex, [0.0.1])
+AC_CONFIG_SRCDIR(src/TToken.hh)
+AM_INIT_AUTOMAKE($AC_PACKAGE_NAME, $AC_PACKAGE_VERSION)
+
+PACKAGE=$AC_PACKAGE_NAME
+VERSION=$AC_PACKAGE_VERSION
+AC_SUBST(PACKAGE)
+AC_SUBST(VERSION)
 
-PACKAGE=editex
-VERSION=0.0.1
 EDITEX_VERSION_INFO=`echo $VERSION | awk -F. '{ printf "%d:%d:%d", $1+$2, $3, $2 }'`
 AC_SUBST(EDITEX_VERSION_INFO)
 
@@ -32,7 +36,6 @@ AC_ARG_WITH(gmetadom-prefix,
 )
 
 AC_CONFIG_HEADERS([config.h])
-AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
 AM_CONFIG_HEADER(config.h)
 
 AH_TOP([
@@ -83,6 +86,10 @@ AC_SUBST(LDFLAGS)
 
 AM_PROG_LIBTOOL
 
+PKG_CHECK_MODULES(GLIB2, glib-2.0)
+AC_SUBST(GLIB2_CFLAGS)
+AC_SUBST(GLIB2_LIBS)
+
 GMETADOM_CONFIG="gmetadom-config"
 GMETADOM_MIN_VERSION=0.1.0
 AC_MSG_CHECKING([for GMetaDOM C++ library] >= $GMETADOM_MIN_VERSION) 
@@ -243,7 +250,6 @@ AC_CONFIG_FILES([
  textomml/Makefile
  textomml/config.dirs
  ocaml/Makefile
- editex-config
+ editex.pc
 ])
-AC_CONFIG_COMMANDS([default],[[chmod +x editex-config]],[[]])
 AC_OUTPUT
index 4eff38632eeb5a789f1cc80e2886e6bb8a8effbf..fa9785111b59b6f2eacfa44d2030877793645a38 100644 (file)
   <entry name="longleftarrow"             class="o" val="????;"/>
   <entry name="Longleftarrow"             class="o" val="????"/>
   <entry name="longrightarrow"            class="o" val="????"/>
-  <entry name="Longrightarrow"            class="o" val="????"/>
+  <entry name="Longrightarrow"            class="o" val="&#x21d2;"/>
   <entry name="longleftrightarrow" class="o" val="????"/>
   <entry name="Longleftrightarrow" class="o" val="????"/>
   <entry name="longmapsto"                class="o" val="????"/>
diff --git a/helm/DEVEL/mathml_editor/editex-config.in b/helm/DEVEL/mathml_editor/editex-config.in
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/helm/DEVEL/mathml_editor/editex.pc.in b/helm/DEVEL/mathml_editor/editex.pc.in
new file mode 100644 (file)
index 0000000..ae286c2
--- /dev/null
@@ -0,0 +1,13 @@
+# This is a comment
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: EdiTeX
+Description: An XML/MathML editor based on TeX/LaTeX syntax
+Version: @VERSION@
+Requires: glib-2.0
+Libs: -L${libdir} -leditex
+Cflags: -I${includedir}/editex
+
index 7dd6bd050f21ad5948159f5c1202752b6f647e90..2da2526ef35329cb5a725e33e8ea5b26afa8c570 100644 (file)
@@ -1,16 +1,14 @@
 
+#include <assert.h>
+
 #include <caml/memory.h>
 #include <caml/custom.h>
 #include <caml/callback.h>
-#include <assert.h>
 
 #include "mlgdomevalue.h"
 
 #include "c_mathml_editor.h"
 
-#undef assert
-#define assert(x) {}
-
 typedef struct
 {
   Editor* c_editor;
index 7224cad3f6adc2c267b3ed92a771c91475ceb11a..4d88a334a78a3a0e325b6ce4fa25553147e1aec5 100644 (file)
@@ -3,6 +3,11 @@ lib_LTLIBRARIES = libeditex.la
 
 libeditex_la_LDFLAGS = -version-info @EDITEX_VERSION_INFO@
 
+libeditex_la_LDADDS = \
+  $(GLIB2_LIBS) \
+  $(GMETADOM_LIBS) \
+  $(GDOMEXSLT_LIBS)
+
 libeditex_la_SOURCES = \
   Diff.cc \
   CLoggerConsole.cc \
@@ -36,5 +41,8 @@ pkginclude_HEADERS = \
   TListener.hh \
   dom.hh
 
-INCLUDES = $(GMETADOM_CFLAGS) $(GDOMEXSLT_CFLAGS)
+INCLUDES = \
+  $(GLIB2_CFLAGS) \
+  $(GMETADOM_CFLAGS) \
+  $(GDOMEXSLT_CFLAGS)
 
index 793d7145161341f1b4a2c066d1dcf3481c05794d..3b01a42bdd24a4c27aa0d88a744174169d771c71 100644 (file)
@@ -70,6 +70,8 @@ EDITEX_VERSION_INFO = @EDITEX_VERSION_INFO@
 EXEEXT = @EXEEXT@
 GDOMEXSLT_CFLAGS = @GDOMEXSLT_CFLAGS@
 GDOMEXSLT_LIBS = @GDOMEXSLT_LIBS@
+GLIB2_CFLAGS = @GLIB2_CFLAGS@
+GLIB2_LIBS = @GLIB2_LIBS@
 GMETADOM_CFLAGS = @GMETADOM_CFLAGS@
 GMETADOM_LIBS = @GMETADOM_LIBS@
 GTKMATHVIEW_CFLAGS = @GTKMATHVIEW_CFLAGS@
@@ -95,6 +97,7 @@ OCAMLSTDLIBDIR = @OCAMLSTDLIBDIR@
 OCAMLSTUBDIR = @OCAMLSTUBDIR@
 OCAML_INCLUDE_DIR = @OCAML_INCLUDE_DIR@
 PACKAGE = @PACKAGE@
+PKG_CONFIG = @PKG_CONFIG@
 RANLIB = @RANLIB@
 STRIP = @STRIP@
 VERSION = @VERSION@
@@ -103,13 +106,17 @@ lib_LTLIBRARIES = libeditex.la
 
 libeditex_la_LDFLAGS = -version-info @EDITEX_VERSION_INFO@
 
+libeditex_la_LDADDS =    $(GLIB2_LIBS)   $(GMETADOM_LIBS)   $(GDOMEXSLT_LIBS)
+
+
 libeditex_la_SOURCES =    Diff.cc   CLoggerConsole.cc   TPushLexer.cc   LPushLexer.cc   APushParser.cc   TPushParser.cc   CMathMLFactoryXSLT.cc   CMathMLFactoryXSLTDiff.cc   TDictionary.cc   TDocument.cc   TNode.cc   TTokenizer.cc
 
 
 pkginclude_HEADERS =    Diff.hh   ALogger.hh   CLoggerConsole.hh   APushLexer.hh   APushParser.hh   AMathMLFactory.hh   CMathMLFactoryXSLT.hh   CMathMLFactoryXSLTDiff.hh   TPushLexer.hh   LPushLexer.hh   TPushParser.hh   TTokenizer.hh   TDictionary.hh   TDocument.hh   TNode.hh   TListener.hh   dom.hh
 
 
-INCLUDES = $(GMETADOM_CFLAGS) $(GDOMEXSLT_CFLAGS)
+INCLUDES =    $(GLIB2_CFLAGS)   $(GMETADOM_CFLAGS)   $(GDOMEXSLT_CFLAGS)
+
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = ../config.h
 CONFIG_CLEAN_FILES = 
index ad439908c66a036dd5d0767901ace9c8ba39b477..4c36b026581ed3f93b133dd013e4dbdb310234ed 100644 (file)
@@ -36,12 +36,21 @@ TPushParser::reset()
   if (factory) factory->documentModified(doc);
 }
 
-std::string
-TPushParser::PRIME() const
+TNode
+TPushParser::PRIME()
 {
   const TDictionary::Entry entry = dictionary.find("prime");
-  if (entry.cls == TDictionary::OPERATOR) return entry.value;
-  else return "?";
+  if (entry.cls == TDictionary::OPERATOR)
+    {
+      TNode op = doc.createO(entry.value, nextId++);
+      op["name"] = "prime";
+      return op;
+    }
+  else
+    {
+      TNode op = doc.createO("?", nextId++);
+      return op;
+    }
 }
 
 bool
@@ -433,7 +442,7 @@ bool
 TPushParser::isPrimes(const TNode& node) const
 {
   assert(node);
-  return node.isG() && node.last() && node.last().is("o") && node.last()["val"] == PRIME();
+  return node.isG() && node.last() && node.last().is("o") && node.last()["name"] == "prime";
 }
 
 bool
@@ -445,14 +454,14 @@ TPushParser::do_apostrophe()
        {
          if (prev.isSp() && prev[1] && isPrimes(prev[1]))
            {
-             prev[1].append(doc.createO(PRIME(), nextId++));
+             prev[1].append(PRIME());
              return true;
            }
          else if (prev.isSb() && prev[0] &&
                   prev[0].isSp() && prev[0][1] &&
                   isPrimes(prev[0][1]))
            {
-             prev[0][1].append(doc.createO(PRIME(), nextId++));
+             prev[0][1].append(PRIME());
              return true;
            }
          else
@@ -462,7 +471,7 @@ TPushParser::do_apostrophe()
              prev.replace(elem);
              elem.append(prev);
              elem.append(g);
-             g.append(doc.createO(PRIME(), nextId++));
+             g.append(PRIME());
              return true;
            }
        }
index 04edacb6378c465e483085adec42df4e1ac15acb..091e25e89b793cf4232baca6c539c592dc21f20d 100644 (file)
@@ -31,10 +31,8 @@ public:
 private:
   void init(void);
 
-  std::string PRIME(void) const;
+  TNode PRIME(void);
   bool isPrimes(const TNode&) const;
-
-  
   
   bool do_begin(void);
   bool do_end(void);
index dae4241b2119293e7d599355a930c4de112619b0..8198901853a1142ebcb092514fac0845d0df259a 100644 (file)
@@ -70,6 +70,8 @@ EDITEX_VERSION_INFO = @EDITEX_VERSION_INFO@
 EXEEXT = @EXEEXT@
 GDOMEXSLT_CFLAGS = @GDOMEXSLT_CFLAGS@
 GDOMEXSLT_LIBS = @GDOMEXSLT_LIBS@
+GLIB2_CFLAGS = @GLIB2_CFLAGS@
+GLIB2_LIBS = @GLIB2_LIBS@
 GMETADOM_CFLAGS = @GMETADOM_CFLAGS@
 GMETADOM_LIBS = @GMETADOM_LIBS@
 GTKMATHVIEW_CFLAGS = @GTKMATHVIEW_CFLAGS@
@@ -95,6 +97,7 @@ OCAMLSTDLIBDIR = @OCAMLSTDLIBDIR@
 OCAMLSTUBDIR = @OCAMLSTUBDIR@
 OCAML_INCLUDE_DIR = @OCAML_INCLUDE_DIR@
 PACKAGE = @PACKAGE@
+PKG_CONFIG = @PKG_CONFIG@
 RANLIB = @RANLIB@
 STRIP = @STRIP@
 VERSION = @VERSION@
index 181dbf540657817d1421d9db1abaae7dd37a3401..b22bd3beda42b021a979814678083699dce614a4 100644 (file)
@@ -2,6 +2,7 @@
 #include "dom.hh"
 #include "TPushParser.hh"
 #include "TPushLexer.hh"
+#include "LPushLexer.hh"
 #include "TDictionary.hh"
 #include "CLoggerConsole.hh"
 #include "CMathMLFactoryXSLT.hh"
@@ -14,18 +15,17 @@ extern void *parseMathMLFile(char *);
 
 struct Context
 {
-  Context(const std::string& s, TPushLexer& l, TPushParser& p, DOMX::XSLTStylesheet& ts) 
+  Context(const std::string& s, APushLexer& l, TPushParser& p, DOMX::XSLTStylesheet& ts) 
     : buffer(s), i(0), lexer(l), parser(p), texStyle(ts) { };
 
   void send(void)
   {
     if (i < buffer.length()) lexer.push(buffer[i++]);
-    else lexer.push('\n');
   }
 
   std::string buffer;
   unsigned i;
-  TPushLexer& lexer;
+  APushLexer& lexer;
   TPushParser& parser;
   DOMX::XSLTStylesheet& texStyle;
 };
@@ -63,16 +63,28 @@ edit_push_char(Context* context, gchar ch)
   GUI_thaw();
 }
 
+#include <unistd.h>
+
 extern "C" void
 edit_push_string(Context* context, const gchar* s)
 {
   assert(context != NULL);
   assert(s != NULL);
-  GUI_freeze();
-  context->parser.freeze();
-  for (unsigned i = 0; s[i]; i++) context->lexer.push(s[i]);
-  context->parser.thaw();
-  GUI_thaw();
+#if 0
+//   GUI_freeze();
+//   context->parser.freeze();
+  for (unsigned i = 0; s[i]; i++)
+    {
+      GUI_freeze();
+      context->lexer.push(s[i]);
+      GUI_thaw();
+      usleep(100000);
+      usleep(100000);
+    }
+//   context->parser.thaw();
+//   GUI_thaw();
+#endif
+  context->buffer = s;
 }
 
 extern "C" void
@@ -112,9 +124,9 @@ main(int argc, char* argv[])
   DOM::Document texStyleDoc = di.createDocumentFromURI("./xsl/tml-tex.xsl");
   DOMX::XSLTStylesheet texStyle(texStyleDoc);
 
-  CMathMLFactoryXSLTDiff factory(logger, mmlStyle);
+  CMathMLFactoryXSLT factory(logger, mmlStyle);
   TPushParser parser(logger, factory, dictionary);
-  TPushLexer lexer(logger, parser);
+  LPushLexer lexer(logger, parser);
 
 #if 0
   lexer.push('$');
index 306ec67facf52439422a7797db4c85984c9153bb..74a34608b6da86decca8acbfd30e21e09a5b11a3 100644 (file)
@@ -137,6 +137,9 @@ load_error_msg(const char* name)
   g_free(msg);
 }
 
+static guint edit_timeout_id;
+extern void edit_timeout(gpointer);
+
 void
 GUI_init(int* argc, char*** argv, char* title, guint width, guint height, gpointer c)
 {
@@ -151,7 +154,7 @@ GUI_init(int* argc, char*** argv, char* title, guint width, guint height, gpoint
   gtk_widget_show(window);
 
   context = c;
-  /*edit_timeout_id = gtk_timeout_add(400, edit_timeout, context);*/
+  /*edit_timeout_id = gtk_timeout_add(50, edit_timeout, context);*/
 }
 
 void
index 8c9b8ead19ca45b35f138f5de16d0b900add3cc2..19a88113b0ec84ced4ffd706353a4cb304455820 100644 (file)
@@ -80,7 +80,7 @@
     </m:mo>
   </xsl:template>
 
-  <xsl:template name="cursor">
+  <xsl:template match="tml:cursor[@visible='1']">
     <xsl:choose>
       <xsl:when test="substring(@val,1,1)='\'">
         <m:mrow>
            <xsl:attribute name="xref">
              <xsl:value-of select="@id"/>
            </xsl:attribute>
-         </xsl:if>I</m:mtext>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-
-  <xsl:template match="tml:cursor[@visible='1']">
-    <xsl:param name="annotation" select="/.."/>
-    <xsl:choose>
-      <xsl:when test="$annotation">
-        <m:msub>
-         <xsl:call-template name="cursor"/>
-         <m:mtext>
-           <xsl:value-of select="$annotation"/>
-         </m:mtext>
-       </m:msub>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:call-template name="cursor"/>
+         </xsl:if><xsl:value-of select="@val"/>I</m:mtext>
       </xsl:otherwise>
     </xsl:choose>
   </xsl:template>
   </xsl:template>
 
   <xsl:template match="tml:g">
-    <xsl:param name="annotation" select="/.."/>
     <xsl:choose>
       <xsl:when test="not(@id) and count(*) = 1">
-        <xsl:apply-templates select="*[1]">
-         <xsl:with-param name="annotation" select="$annotation"/>
-       </xsl:apply-templates>
+        <xsl:apply-templates select="*[1]"/>
       </xsl:when>
       <xsl:when test="tml:cursor">
        <m:mstyle mathbackground="#e0e0e0">
             </xsl:attribute>
          </xsl:if>
          <m:mrow>
-           <xsl:apply-templates select="*">
-             <xsl:with-param name="annotation" select="$annotation"/>
-           </xsl:apply-templates>
+           <xsl:apply-templates select="*"/>
          </m:mrow>
        </m:mstyle>
       </xsl:when>
               <xsl:value-of select="@id"/>
             </xsl:attribute>
          </xsl:if>
-         <xsl:apply-templates select="*">
-           <xsl:with-param name="annotation" select="$annotation"/>
-         </xsl:apply-templates>
+         <xsl:apply-templates select="*"/>
        </m:mrow>
       </xsl:otherwise>
     </xsl:choose>
     </m:mfrac>
   </xsl:template>
 
+  <xsl:template match="tml:c[@name='space']">
+    <m:mspace width="veryverythickmathspace">
+    </m:mspace>
+  </xsl:template>
+
 </xsl:stylesheet>
index a8b9878d82f74258ed9e55182e39468f19e5668a..b5c6fdf3c418b6da8d0cdf4e838d3bd6a62a5df7 100644 (file)
@@ -45,7 +45,7 @@
   <xsl:template match="tml:n">
     <xsl:choose>
       <xsl:when test="@name">\<xsl:value-of select="@name"/>
-        <xsl:if test="parent::tml:g and following-sibling::tml:n"><xsl:value-of select="' '"/></xsl:if>
+        <xsl:if test="parent::tml:g and following-sibling::tml:i"><xsl:value-of select="' '"/></xsl:if>
       </xsl:when>
       <xsl:when test="string-length(@val)=1"><xsl:value-of select="@val"/></xsl:when>
       <xsl:otherwise>{\rm <xsl:value-of select="@val"/>}</xsl:otherwise>
@@ -54,7 +54,9 @@
 
   <xsl:template match="tml:o">
     <xsl:choose>
-      <xsl:when test="@name">\<xsl:value-of select="@name"/><xsl:value-of select="' '"/></xsl:when>
+      <xsl:when test="@name">\<xsl:value-of select="@name"/>
+        <xsl:if test="parent::tml:g and following-sibling::tml:i"><xsl:value-of select="' '"/></xsl:if>
+      </xsl:when>
       <xsl:when test="string-length(@val)=1"><xsl:value-of select="@val"/></xsl:when>
       <xsl:otherwise><xsl:value-of select="@val"/></xsl:otherwise>
     </xsl:choose>
@@ -84,6 +86,8 @@
 
   <xsl:template match="tml:g[@id]">{<xsl:apply-templates select="*"/>}</xsl:template>
 
+  <xsl:template match="tml:g[count(*)&gt;1]">{<xsl:apply-templates select="*"/>}</xsl:template>
+
   <xsl:template match="tml:g">
     <xsl:apply-templates select="*"/>
   </xsl:template>