Пример #1
0
        private void trackBar1_ValueChanged(object sender, EventArgs e)
        {
            string url = "";

            laTeXDisplay1.size = trackBar1.Value;
            try
            {
                // url = @"http://www.texrendr.com/cgi-bin/mathtex.cgi?\dpi{" + trackBar1.Value.ToString() + @"}" + LaTeX.Print(Infix.ParseOrThrow(fastColoredTextBox1.Text));
                //Console.WriteLine(url);
                laTeXDisplay1.LoadLatex(LaTeX.Print(Infix.ParseOrThrow(fastColoredTextBox1.Text)));
            }
            catch
            {
                //url = @"http://www.texrendr.com/cgi-bin/mathtex.cgi?\dpi{" + trackBar1.Value.ToString() + @"}" + fastColoredTextBox1.Text;
                laTeXDisplay1.LoadLatex(fastColoredTextBox1.Text);
                // Console.WriteLine(char.MinValue);
                //  int no = (int)char.MinValue;
                // while (no != char.MaxValue)
                //{
                //  char c = (char)no;
                //System.Console.WriteLine("CharID: " + no + " | Bin: "
                //  + string.Join(" ", System.Text.Encoding.UTF8.GetBytes(c.ToString()).Select(byt =>
                //    System.Convert.ToString(byt, 2).PadLeft(8, '0')))
                //+ " | Display: " + c);
                //no++;
                //}
            }
            //   laTeXDisplay1.LoadLatex(new Uri(url));
        }
Пример #2
0
 private void fastColoredTextBox1_TextChanged(object sender, FastColoredTextBoxNS.TextChangedEventArgs e)
 {
     //  lasttext = fastColoredTextBox1.Text;
     if (MATH2.MasterForm.Clear)
     {
         Console.Clear();
     }
     comboBox1.Items.Clear();
     try
     {
         OnTextChanged(fastColoredTextBox1.Text);
     }
     catch { }
     try
     {
         // url = @"http://www.texrendr.com/cgi-bin/mathtex.cgi?\dpi{" + trackBar1.Value.ToString() + @"}" + LaTeX.Print(Infix.ParseOrThrow(fastColoredTextBox1.Text));
         //Console.WriteLine(url);
         laTeXDisplay1.LoadLatex(LaTeX.Print(Infix.ParseOrThrow(fastColoredTextBox1.Text)));
     }
     catch
     {
         //url = @"http://www.texrendr.com/cgi-bin/mathtex.cgi?\dpi{" + trackBar1.Value.ToString() + @"}" + fastColoredTextBox1.Text;
         laTeXDisplay1.LoadLatex(fastColoredTextBox1.Text);
     }
 }
Пример #3
0
 public static List <Expression> ParseSequence(string raw)
 {
     try
     {
         List <Expression> ret = new List <Expression>();
         StringBuilder     sb  = new StringBuilder();
         foreach (var item in raw.Split(',').ToList())
         {
             ret.Add(Infix.ParseOrThrow(item.Replace(",", "")));
             sb.Append(LaTeX.Print(Infix.ParseOrThrow(item.Replace(",", ""))) + ",");
         }
         System.Windows.Forms.Clipboard.SetText(sb.ToString());
         // Console.WriteLine("Successfully parsed sequence: " + sb.ToString());
         return(ret);
     }
     catch
     {
         Console.WriteLine("Sequence was in the incorrect format, remember to seperate items by a comma!");
         return(null);
     }
 }
Пример #4
0
        public void LoadLatex()
        {
            string url = "";

            try
            {
                url = @"http://www.texrendr.com/cgi-bin/mathtex.cgi?\dpi{" + size.ToString() + @"}" + LaTeX.Print(Infix.ParseOrThrow(LaTex));
                //Console.WriteLine(url);
            }
            catch
            {
                url = @"http://www.texrendr.com/cgi-bin/mathtex.cgi?\dpi{" + size.ToString() + @"}" + LaTex;
            }
            pictureBox1.Load(url);
        }