Request for feedback on tex filter
- From: MrJ Man <auxsvr yahoo com>
- To: dashboard-hackers gnome org
- Subject: Request for feedback on tex filter
- Date: Sat, 25 Feb 2006 11:53:14 -0800 (PST)
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);
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]