/itexToMML

To download this project, use:
bzr branch http://golem.ph.utexas.edu/~distler/code/itexToMML/

« back to all changes in this revision

Viewing changes to itex-src/itex2MML.cc

  • Committer: Jacques Distler
  • Date: 2007-10-25 07:18:39 UTC
  • Revision ID: distler@golem.ph.utexas.edu-20071025071839-5qk7wd33pomcda57
Angle Brackets
In the stream filter, the default behaviour is now to allow angle bracket in itex equations.
To forbid them, use the --forbid-markup commandline flag.

Show diffs side-by-side

added added

removed removed

1
 
/*             itex2MML 1.1.8
2
 
 *   itex2MML.cc last modified 9/15/2005
 
1
/*             itex2MML 1.3.1
 
2
 *   itex2MML.cc last modified 10/24/2007
3
3
 */
4
4
 
5
5
#include <cstdio>
16
16
        bool bDisplay   = false;
17
17
 
18
18
        bool bStop = false;
 
19
        bool bForbidMarkup = false;
19
20
 
20
21
        for (int arg = 1; arg < argc; arg++)
21
22
                {
39
40
                                                   "\n"
40
41
                                                   "itex2MML Options:\n"
41
42
                                                   "\n"
42
 
                                                   "  --raw-filter  filter input stream, converting equations as found to MathML [stops on error]\n"
43
 
                                                   "  --inline      converts a single itex equation, without any $ symbols, to inline MathML\n"
44
 
                                                   "  --display     converts a single itex equation, without any $ symbols, to display-mode MathML\n"
45
 
                                                   "  --print-itex  used in conjuction with --inline or --display: prints the itex string\n"
 
43
                                                   "  --raw-filter    filter input stream, converting equations as found to MathML [stops on error]\n"
 
44
                                                   "  --inline        converts a single itex equation, without any $ symbols, to inline MathML\n"
 
45
                                                   "  --display       converts a single itex equation, without any $ symbols, to display-mode MathML\n"
 
46
                                                   "  --forbid-markup forbid markup (more precisely, the '<' and '>' characters) in itex equations\n"
 
47
                                                   "  --print-itex    used in conjuction with --inline or --display: prints the itex string\n"
46
48
                                                   "\n"
47
49
                                                   "For further information, see http://golem.ph.utexas.edu/~distler/blog/itex2MML.html\n", stdout);
48
50
 
55
57
                                        bRawFilter = false;
56
58
                                        continue;
57
59
                                }
 
60
                        if (args == "--forbid-markup")
 
61
                                {
 
62
                                        bRawFilter = false;
 
63
                                        bForbidMarkup = true;
 
64
                                        continue;
 
65
                                }
58
66
                        if (args == "--inline")
59
67
                                {
60
68
                                        bRawFilter = false;
104
112
                        if (bRawFilter)
105
113
                                itex2MML_filter (itex.c_str(), itex.size());
106
114
                        else
107
 
                                itex2MML_html_filter (itex.c_str(), itex.size());
 
115
                                if (bForbidMarkup)
 
116
                                        itex2MML_strict_html_filter (itex.c_str(), itex.size());
 
117
                                else
 
118
                                        itex2MML_html_filter (itex.c_str(), itex.size());
108
119
                        return 0;
109
120
                }
110
121