Hi MrJ Man,

A   wiki page is    devoted to  the   Latex   filter, please  check  :
http://www.beagle-project.org/FilterLaTeX_Spec

This page contains  a link to  another simple  filterTex code  (with a
more complete  keyword list).   It would be  great to  merge these two
codes.

dav


MrJ Man writes:
 > I am currently working on a tex filter and, since it's
 > my first program in C# I could use some help. Please
 > check the attached file and send me your comments.
 > 
 > __________________________________________________
 > Do You Yahoo!?
 > Tired of spam?  Yahoo! Mail has the best spam protection around 
 > http://mail.yahoo.com using System;
 > using System.Collections;
 > using System.IO;
 > using System.Text;
 > using Beagle.Daemon;
 > 
 > // Set author, title, abstract, email etc properties.
 > // Set section, chapter titles, index, bibliography as hotcontent.
 > 
 > namespace Beagle.Filters {
 >     public class FilterTex : FilterSource {
 > 
 >      protected StreamReader reader;
 > 
 >         // TODO: Make it a class
 >        // public string author, title, abstract, email;
 > 
 >      static string [] strKeyWords = {"\\begin", "\\end", "\\documentclass", 
 > "\\usepackage",
 >                                      "\\frenchspacing", "\\author", 
 > "\\email", "\\title",
 >                                      "\\abstract", "\\chapter", "\\section", 
 > "\\subsection",
 >                                      "\\paragraph" };
 > 
 >      public FilterTex ()
 >      {
 >          AddSupportedFlavor (FilterFlavor.NewFromMimeType 
 > ("application/x-tex"));
 >          AddSupportedFlavor (FilterFlavor.NewFromMimeType ("text/x-tex"));
 >          AddSupportedFlavor (FilterFlavor.NewFromMimeType ("text/x-latex"));
 >          AddSupportedFlavor (FilterFlavor.NewFromMimeType 
 > ("application/x-latex"));
 >      }
 >  
 >      override protected void DoOpen (FileInfo info)
 >      {
 > //           TeXDocument temp_doc = new TeXDocument ();
 > //           Encoding enc = temp_doc.DetectEncoding (Stream);
 > //           temp_doc=null;
 > //           Stream.Seek (0,SeekOrigin.Begin);
 >  
 >              foreach (string keyword in strKeyWords)
 >                      KeyWordsHash [keyword] = true;
 >              SrcLangType = LangType.Matlab_Style;
 >      }
 >  
 > //   override protected void DoPullProperties ()
 > //   {
 > //       AddProperty (Beagle.Property.New ("TeX:author", author));
 > //       AddProperty (Beagle.Property.New ("TeX:title", title));
 > //       AddProperty (Beagle.Property.New ("TeX:abstract", abstract));
 > //   }
 >      
 >      override protected void DoPull ()
 >      {
 >              string str = TextReader.ReadLine ();
 >              if (str == null)
 >                      Finished ();
 >              else
 >                      ExtractTokens (str);
 >      }
 >      }
 > }
 > _______________________________________________
 > Dashboard-hackers mailing list
 > [email protected]
 > http://mail.gnome.org/mailman/listinfo/dashboard-hackers

_______________________________________________
Dashboard-hackers mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/dashboard-hackers

Reply via email to