Пример #1
0
        /// <summary>
        /// What I'm thinking is that you pass the entire
        /// \begin{thing} to \end{thing} and it'll work
        /// everything else out from that. We can handle
        /// subfigures as well.
        /// </summary>
        /// <param name="teX"></param>
        public Diagram(string teX)
        {
            // We need to know which figure number we are.
            Number  = ++_Number;
            Files   = new List <FileInfo>();
            Caption = new Dictionary <string, List <string> >();
            Label   = new List <string>();
            string line = teX.Replace("\n", "").Replace("\r", "");

            line = Regex.Replace(line, "\\s+", " ");

            List <string> optionalCaption = TeX.GetTeXPart(line, "caption", '[', ']');

            foreach (string file in TeX.GetTeXPart(line, "includegraphics"))
            {
                Files.Add(new FileInfo(file));
            }

            Label = TeX.GetTeXPart(line, "label");

            foreach (string c in TeX.GetTeXPart(line, "caption"))
            {
                Caption.Add(c, optionalCaption);
            }
        }