summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwl <wl>2007-02-05 15:24:56 +0000
committerwl <wl>2007-02-05 15:24:56 +0000
commit6a2c6dcc6a598f020d849c0d7ad821b8982c3dd5 (patch)
treec88605901e2cfcddcd2a4b832e38c39e6e9a3742
parent924b12a1804c4e8034a57a7e8472f3a89547a442 (diff)
downloadgroff-6a2c6dcc6a598f020d849c0d7ad821b8982c3dd5.tar.gz
* src/preproc/eqn/eqn.man: Revised.
* src/preproc/eqn/text.cpp (map, special_char_boc::output): Use `const'. (spacing_type): Fix typo. (special_to_entity): Use `const'. Remove unused variable. * src/preproc/eqn/other.cpp (font_box::output): Use `const'. Formatting, copyright years.
-rw-r--r--ChangeLog86
-rw-r--r--MORE.STUFF1
-rw-r--r--src/preproc/eqn/box.cpp9
-rw-r--r--src/preproc/eqn/delim.cpp6
-rw-r--r--src/preproc/eqn/eqn.h3
-rw-r--r--src/preproc/eqn/eqn.man238
-rw-r--r--src/preproc/eqn/lex.cpp7
-rw-r--r--src/preproc/eqn/limit.cpp12
-rw-r--r--src/preproc/eqn/list.cpp2
-rw-r--r--src/preproc/eqn/main.cpp5
-rw-r--r--src/preproc/eqn/other.cpp58
-rw-r--r--src/preproc/eqn/over.cpp5
-rw-r--r--src/preproc/eqn/pile.cpp39
-rw-r--r--src/preproc/eqn/script.cpp12
-rw-r--r--src/preproc/eqn/special.cpp2
-rw-r--r--src/preproc/eqn/sqrt.cpp5
-rw-r--r--src/preproc/eqn/text.cpp740
17 files changed, 689 insertions, 541 deletions
diff --git a/ChangeLog b/ChangeLog
index 35573706..15a0ca9e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2007-02-05 Werner LEMBERG <wl@gnu.org>
+
+ * src/preproc/eqn/eqn.man: Revised.
+
+ * src/preproc/eqn/text.cpp (map, special_char_boc::output): Use
+ `const'.
+ (spacing_type): Fix typo.
+ (special_to_entity): Use `const'.
+ Remove unused variable.
+ * src/preproc/eqn/other.cpp (font_box::output): Use `const'.
+
2007-02-05 Eric S. Raymond <esr@snark.thyrsus.com>
* src/devices/grotty/grotty.man: \m[] and \M[] aren't portable,
@@ -23,6 +34,79 @@
* MORE.STUFF: More-stuff entries for doclifter and pic2plot.
+
+ Add support for MathML output to eqn.
+
+ The strategy used is very simple and relies on the fact that the box
+ models of eqn and Presentation MathML differ in only trivial ways.
+ It leaves the grammar and existing internal object structures
+ unchanged. A new global, `output_format', is defined as an
+ enumerated type with values {troff, mathml}. Most of the functions
+ and methods that emit actual output acquire a top-level conditional,
+ dispatching on this global, which has one arm for troff mode and one
+ for MathML mode. In most cases the MathML arm is drastically
+ simpler.
+
+ (This strategy could be easily generalized to support other output
+ formats. TeX is a possibility that leaps to mind.)
+
+ The only even moderately tricky changes are in the lexer. Some of
+ the predefined macros used constructs like `up', `down', `fwd',
+ `back', and `vcenter' that have no equivalents in MathML. I
+ attacked this problem in these ways:
+
+ 1. I eliminated three uses of `back' to compose characters in favor
+ of using equivalent groff specials `\(<<', `\(>>', and `\(<>'
+ that did not exist when these macros were written. (This will be
+ a quality improvement for troff users.)
+
+ 2. I eliminated one use of `vcenter' by using \\(md. (Likewise...)
+
+ 3. I then split the table of pre-definitions in three; one large
+ common table and two small troff-specific and MathML-specific
+ tables. Use of troff-only operations (up, down, back, fwd,
+ vcenter) is now confined to the former. The latter now uses
+ `size big' and drops out the explicit positioning operations,
+ counting on MathML processors to do them.
+
+ POTENTIAL TROUBLE SPOTS:
+
+ Here are notes for reviewers on places I'm not 100% sure I've done
+ the right thing:
+
+ * In the process of preparing the troff table, I translated three
+ definitions (dot_def, dotdot_def, and utilde def) that previously
+ used explicit \v escapes to use `up' and `down' instead. I
+ modeled the new definitions on the way `vec' and `dyad' work, but
+ it's possible I got something subtle wrong.
+
+ * I'm not certain the MathML implementation of font_box::output() is
+ right, because I don't quite get what the switcheroo between
+ `current_roman_font' and `old_roman_font' is supposed to
+ accomplish. It does seem to generare good MathML, though.
+
+ Finally, I made one purely cosmetic change in `text.cpp'; I replaced
+ with an enum some magic numbers for spacing types that I thought
+ were too ugly to live.
+
+ REMAINING ISSUES:
+
+ The entirety of eqn is translated when `-TMathML' is specified,
+ with the following exceptions...
+
+ Limitations that cannot be fixed include non-support for special,
+ up/down/fwd/back, and vcenter.
+
+ Limitations that might be fixable include non-support for mark and
+ lineup. I will investigate further, but if these can be implemented
+ at all it's going to be in a very complicated and nasty way.
+
+ The way character boxes are output means that each digit of a
+ multi-digit number gets its own <mn></mn> tag pair in the MathHTML.
+ While this is not technically wrong for Presentation MathML, it is
+ ugly and inefficient. Fixing this will require implementing a
+ little state machine in the `text.cpp' output method.
+
* src/preproc/eqn/box.cpp, src/preproc/eqn/delim.cpp,
src/preproc/eqn/eqn.h, src/preproc/eqn/eqn.man,
src/preproc/eqn/lex.cpp, src/preproc/eqn/limit.cpp,
@@ -32,6 +116,8 @@
src/preproc/eqn/sqrt.cpp, src/preproc/eqn/text.cpp,
src/preproc/eqn/eqn.man: MathML output mode.
+ * NEWS: Document it.
+
2007-02-02 Eric S. Raymond <esr@snark.thyrsus.com>
* src/roff/groff/groff.man: Converted to use .SY/.OP/.YS
diff --git a/MORE.STUFF b/MORE.STUFF
index 307558f4..c8c22cc8 100644
--- a/MORE.STUFF
+++ b/MORE.STUFF
@@ -151,6 +151,7 @@ pic2plot, part of the GNU plotutils package, can lift pic markup to SVG.
The plotutils package is available at
http://www.gnu.org/software/plotutils/
+
miscellaneous
-------------
diff --git a/src/preproc/eqn/box.cpp b/src/preproc/eqn/box.cpp
index 85a55b4d..df31bf22 100644
--- a/src/preproc/eqn/box.cpp
+++ b/src/preproc/eqn/box.cpp
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2002, 2004
+/* Copyright (C) 1989, 1990, 1991, 1992, 2002, 2004, 2007
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -253,9 +253,9 @@ void do_text(const char *s)
printf(".eo\n");
printf(".as " LINE_STRING " \"%s\n", s);
printf(".ec\n");
- } else if (output_format == mathml) {
- fputs(s, stdout);
}
+ else if (output_format == mathml)
+ fputs(s, stdout);
}
void set_minimum_size(int n)
@@ -349,7 +349,8 @@ void box::top_level()
printf(".ne \\n[" HEIGHT_FORMAT "]u-%dM>?0+(\\n["
DEPTH_FORMAT "]u-%dM>?0)\n",
b->uid, body_height, b->uid, body_depth);
- } else if (output_format == mathml) {
+ }
+ else if (output_format == mathml) {
printf("<math>");
b->output();
printf("</math>");
diff --git a/src/preproc/eqn/delim.cpp b/src/preproc/eqn/delim.cpp
index a48c0535..83de7202 100644
--- a/src/preproc/eqn/delim.cpp
+++ b/src/preproc/eqn/delim.cpp
@@ -1,5 +1,6 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1989, 1990, 1991, 1992, 2003, 2007
+ Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -384,7 +385,8 @@ void delim_box::output()
p->output();
if (right)
printf("\\*[" RIGHT_DELIM_STRING_FORMAT "]", uid);
- } else if (output_format == mathml) {
+ }
+ else if (output_format == mathml) {
printf("<mrow><mo>%s</mo>", left);
p->output();
printf("<mo>%s</mo></mrow>", right);
diff --git a/src/preproc/eqn/eqn.h b/src/preproc/eqn/eqn.h
index a977fe72..8d655b38 100644
--- a/src/preproc/eqn/eqn.h
+++ b/src/preproc/eqn/eqn.h
@@ -1,5 +1,6 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1989, 1990, 1991, 1992, 2001, 2007
+ Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
diff --git a/src/preproc/eqn/eqn.man b/src/preproc/eqn/eqn.man
index bff0e00c..bbdeacaa 100644
--- a/src/preproc/eqn/eqn.man
+++ b/src/preproc/eqn/eqn.man
@@ -1,5 +1,6 @@
.ig
-Copyright (C) 1989-2000, 2001, 2004, 2005 Free Software Foundation, Inc.
+Copyright (C) 1989-2000, 2001, 2004, 2005, 2007
+ Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@@ -32,13 +33,6 @@ the original English.
..
.
.
-.de TQ
-. br
-. ns
-. TP \\$1
-..
-.
-.
.\" The BSD man macros can't handle " in arguments to font change macros,
.\" so use \(ts instead of ".
.tr \(ts"
@@ -48,20 +42,11 @@ the original English.
.
.
.SH NAME
-@g@eqn \- format equations for troff
+@g@eqn \- format equations for troff or MathML
.
.
.SH SYNOPSIS
-.nr a \n(.j
-.ad l
-.nr i \n(.i
-.in +\w'\fB@g@eqn 'u
-.ti \niu
-.B @g@eqn
-.de OP
-. ie \\n(.$-1 .RI "[\ \fB\\$1\fP" "\\$2" "\ ]"
-. el .RB "[\ " "\\$1" "\ ]"
-..
+.SY @g@eqn
.OP \-rvCNR
.OP \-d xy
.OP \-T name
@@ -70,9 +55,8 @@ the original English.
.OP \-s n
.OP \-p n
.OP \-m n
-.RI "[\ " files\|.\|.\|. "\ ]"
-.br
-.ad \na
+.RI [ files\|.\|.\|. ]
+.YS
.
.LP
It is possible to have whitespace between a command line option and its
@@ -97,11 +81,10 @@ The output of GNU
.B eqn
cannot be processed with Unix troff;
it must be processed with GNU troff.
-If no files are given on the command line, the standard input
-will be read.
+If no files are given on the command line, the standard input is read.
A filename of
.B \-
-will cause the standard input to be read.
+causes the standard input to be read.
.
.LP
.B eqn
@@ -116,7 +99,7 @@ and finally in the standard macro directory
.BR @MACRODIR@ .
If it exists,
.B eqn
-will process it before the other input files.
+processes it before the other input files.
The
.B \-R
option prevents this.
@@ -130,6 +113,7 @@ it does not support low-resolution, typewriter-like devices
.
.
.SH OPTIONS
+.
.TP
.BI \-d xy
Specify delimiters
@@ -168,7 +152,7 @@ Only one size reduction.
The minimum point-size is\~\c
.IR n .
.B eqn
-will not reduce the size of subscripts or superscripts to
+does not reduce the size of subscripts or superscripts to
a smaller size than\~\c
.IR n .
.
@@ -181,11 +165,11 @@ Normally, the only effect of this is to define a macro
with a value of\~\c
.BR 1 ;
.B eqnrc
-will use this to provide definitions appropriate for the output device.
-However, if the specified device is "MathML", the output will be
+uses this to provide definitions appropriate for the output device.
+However, if the specified device is \[lq]MathML\[rq], the output is
MathML markup rather than troff commands, and
.B eqnrc
-will not be loaded at all.
+is not loaded at all.
The default output device is
.BR @DEVICE@ .
.
@@ -215,7 +199,7 @@ This is equivalent to a
command.
This option is deprecated.
.B eqn
-will normally set equations at whatever the current point size
+normally sets equations at whatever the current point size
is when the equation is encountered.
.
.TP
@@ -226,8 +210,8 @@ points smaller than the surrounding text.
This option is deprecated.
Normally
.B eqn
-makes sets subscripts and superscripts at 70%
-of the size of the surrounding text.
+sets subscripts and superscripts at 70% of the size of the
+surrounding text.
.
.
.SH USAGE
@@ -238,7 +222,7 @@ and Unix eqn are described here.
GNU
.B eqn
emits Presentation MathML output when invoked with the
-,B -T MathML
+.B "-T\~MathML"
option.
.
.LP
@@ -358,11 +342,20 @@ subsection.
.
.SS New primitives
.TP
-.IB big\ e1
+.BI big\ e
Enlarges the expression it modifies; intended to have semantics like
-CSS 'large'. In troff output, the point size is increased by 5; in
-MathML output, the expression is wrapped in an <mstyle mathsize='big'>
-pair.
+CSS `large'.
+In troff output, the point size is increased by\~5;
+in MathML output, the expression uses
+.
+.RS
+.IP
+.EX
+<mstyle \%mathsize='big'>
+.EE
+.RE
+.
+.TP
.IB e1\ smallover\ e2
This is similar to
.BR over ;
@@ -404,6 +397,7 @@ is defined as
{ type "operator" vcenter size +5 \e(*S }
.RE
.
+.IP
(Note that vcenter is silently ignored when generating MathML.)
.
.TP
@@ -415,7 +409,7 @@ as an accent over
.I e2
is assumed to be at the correct height for a lowercase letter;
.I e2
-will be moved down according if
+is moved down according to whether
.I e1
is taller or shorter than a lowercase letter.
For example,
@@ -448,7 +442,7 @@ as an accent under
.I e2
is assumed to be at the correct height for a character without a descender;
.I e2
-will be moved down if
+is moved down if
.I e1
has a descender.
.B utilde
@@ -470,8 +464,7 @@ but
.I text
is not subject to macro expansion because it is quoted;
.I text
-will be split up and the spacing between individual characters
-will be adjusted.
+is split up and the spacing between individual characters is adjusted.
.
.TP
.BI nosplit\ text
@@ -485,10 +478,10 @@ This has the same effect as
.IP
but because
.I text
-is not quoted it will be subject to macro expansion;
+is not quoted it is subject to macro expansion;
.I text
-will not be split up
-and the spacing between individual characters will not be adjusted.
+is not split up
+and the spacing between individual characters is not adjusted.
.
.TP
.IB e\ opprime
@@ -504,14 +497,14 @@ with
.B opprime
the\~\c
.B 1
-will be tucked under the prime as a subscript to the\~\c
+is tucked under the prime as a subscript to the\~\c
.B A
(as is conventional in mathematical typesetting),
whereas with
.B prime
the\~\c
.B 1
-will be a subscript to the prime character.
+is a subscript to the prime character.
The precedence of
.B opprime
is the same as that of
@@ -524,7 +517,7 @@ and
.BR uaccent .
In unquoted text a\~\c
.B '
-that is not the first character will be treated like
+that is not the first character is treated like
.BR opprime .
.
.TP
@@ -538,7 +531,7 @@ macro named
When the macro is called,
the string
.B 0s
-will contain the output for\~\c
+contains the output for\~\c
.IR e ,
and the number registers
.BR 0w ,
@@ -547,7 +540,7 @@ and the number registers
.BR 0skern ,
and
.BR 0skew
-will contain the width, height, depth, subscript kern, and skew of\~\c
+contain the width, height, depth, subscript kern, and skew of\~\c
.IR e .
(The
.I "subscript kern"
@@ -558,7 +551,7 @@ of an object says how far to the right of the center of the object an
accent over the object should be placed.)
The macro must modify
.B 0s
-so that it will output the desired result with its origin at the current
+so that it outputs the desired result with its origin at the current
point, and increase the current horizontal position by the width
of the object.
The number registers must also be modified so that they correspond to the
@@ -732,7 +725,7 @@ definitive.
. TP
.B minimum_size
.B eqn
-will not set anything at a smaller point-size than this.
+doesn't set anything at a smaller point-size than this.
The value is in points.
.
.TP
@@ -742,14 +735,20 @@ The
primitive emboldens an equation
by overprinting two copies of the equation
horizontally offset by this amount.
-(This parameter is not used in MathML mode; instead, fat text is
-wrapped in an <mstyle mathvariant='bold'> tag pair.)
+This parameter is not used in MathML mode; instead, fat text uses
+.
+.RS
+.IP
+.EX
+<mstyle mathvariant='bold'>
+.EE
+.RE
.
.TP
.B over_hang
-A fraction bar will be longer by twice this amount than
+A fraction bar is longer by twice this amount than
the maximum of the widths of the numerator and denominator;
-in other words, it will overhang the numerator and
+in other words, it overhangs the numerator and
denominator by at least this amount.
.
.TP
@@ -759,7 +758,7 @@ When
or
.B under
is applied to a single character,
-the line will be this long.
+the line is this long.
Normally,
.B bar
or
@@ -774,7 +773,7 @@ Extensible delimiters produced with the
.B left
and
.B right
-primitives will have a combined height and depth of at least this many
+primitives have a combined height and depth of at least this many
thousandths of twice the maximum amount by which the sub-equation that
the delimiters enclose extends away from the axis.
.
@@ -784,7 +783,7 @@ Extensible delimiters produced with the
.B left
and
.B right
-primitives will have a combined height and depth
+primitives have a combined height and depth
not less than the difference of
twice the maximum amount by which the sub-equation that
the delimiters enclose extends away from the axis
@@ -837,29 +836,29 @@ escape sequence.
.B num1
The
.B over
-command will shift up the numerator by at least this amount.
+command shifts up the numerator by at least this amount.
.
.TP
.B num2
The
.B smallover
-command will shift up the numerator by at least this amount.
+command shifts up the numerator by at least this amount.
.
.TP
.B denom1
The
.B over
-command will shift down the denominator by at least this amount.
+command shifts down the denominator by at least this amount.
.
.TP
.B denom2
The
.B smallover
-command will shift down the denominator by at least this amount.
+command shifts down the denominator by at least this amount.
.
.TP
.B sup1
-Normally superscripts will be shifted up by at least this amount.
+Normally superscripts are shifted up by at least this amount.
.
.TP
.B sup2
@@ -867,63 +866,63 @@ Superscripts within superscripts or upper limits
or numerators of
.B smallover
fractions
-will be shifted up by at least this amount.
+are shifted up by at least this amount.
This is usually less than sup1.
.
.TP
.B sup3
Superscripts within denominators or square roots
-or subscripts or lower limits will be shifted up by at least
+or subscripts or lower limits are shifted up by at least
this amount.
This is usually less than sup2.
.
.TP
.B sub1
-Subscripts will normally be shifted down by at least this amount.
+Subscripts are normally shifted down by at least this amount.
.
.TP
.B sub2
When there is both a subscript and a superscript, the subscript
-will be shifted down by at least this amount.
+is shifted down by at least this amount.
.
.TP
.B sup_drop
-The baseline of a superscript will be no more
+The baseline of a superscript is no more
than this much amount below the top of the object on
which the superscript is set.
.
.TP
.B sub_drop
-The baseline of a subscript will be at least this much below
+The baseline of a subscript is at least this much below
the bottom of the object on which the subscript is set.
.
.TP
.B big_op_spacing1
-The baseline of an upper limit will be at least this
+The baseline of an upper limit is at least this
much above the top of the object on which the limit is set.
.
.TP
.B big_op_spacing2
-The baseline of a lower limit will be at least this
+The baseline of a lower limit is at least this
much below the bottom of the object on which the limit is set.
.
.TP
.B big_op_spacing3
-The bottom of an upper limit will be at least this much above the
+The bottom of an upper limit is at least this much above the
top of the object on which the limit is set.
.
.TP
.B big_op_spacing4
-The top of a lower limit will be at least this much below
+The top of a lower limit is at least this much below
the bottom of the object on which the limit is set.
.
.TP
.B big_op_spacing5
-This much vertical space will be added above and below limits.
+This much vertical space is added above and below limits.
.
.TP
.B baseline_sep
-The baselines of the rows in a pile or matrix will normally be
+The baselines of the rows in a pile or matrix are normally
this far apart.
In most cases this should be equal to the sum of
.B num1
@@ -933,21 +932,21 @@ and
.TP
.B shift_down
The midpoint between the top baseline and the bottom baseline
-in a matrix or pile will be shifted down by this much from the axis.
+in a matrix or pile is shifted down by this much from the axis.
In most cases this should be equal to
.BR axis_height .
.
.TP
.B column_sep
-This much space will be added between columns in a matrix.
+This much space is added between columns in a matrix.
.
.TP
.B matrix_side_sep
-This much space will be added at each side of a matrix.
+This much space is added at each side of a matrix.
.
.TP
.B draw_lines
-If this is non-zero, lines will be drawn using the
+If this is non-zero, lines are drawn using the
.B \eD
escape sequence, rather than with the
.B \el
@@ -958,7 +957,7 @@ character.
.TP
.B body_height
The amount by which the height of the equation exceeds this
-will be added as extra space before the line containing the equation
+is added as extra space before the line containing the equation
(using
.BR \ex ).
The default value is 85.
@@ -966,7 +965,7 @@ The default value is 85.
.TP
.B body_depth
The amount by which the depth of the equation exceeds this
-will be added as extra space after the line containing the equation
+is added as extra space after the line containing the equation
(using
.BR \ex ).
The default value is 35.
@@ -976,18 +975,18 @@ The default value is 35.
If this is non-zero,
then
.B ndefine
-will behave like
+behaves like
.B define
and
.B tdefine
-will be ignored,
+is ignored,
otherwise
.B tdefine
-will behave like
+behaves like
.B define
and
.B ndefine
-will be ignored.
+is ignored.
The default value is\~0
(This is typically changed to\~1 by the
.B eqnrc
@@ -1012,19 +1011,19 @@ In a macro body,
where
.I n
is between 1 and\~9,
-will be replaced by the
+is replaced by the
.IR n-th
argument if the macro is called with arguments;
if there are fewer than
.I n\~\c
-arguments, it will be replaced by nothing.
+arguments, it is replaced by nothing.
A word containing a left parenthesis where the part of the word
before the left parenthesis has been defined using the
.B define
command
-will be recognized as a macro call with arguments;
+is recognized as a macro call with arguments;
characters following the left parenthesis
-up to a matching right parenthesis will be treated as comma-separated
+up to a matching right parenthesis are treated as comma-separated
arguments;
commas inside nested parentheses do not terminate an argument.
.
@@ -1034,7 +1033,7 @@ This is like the
.B define
command, but
.I name
-will not be recognized if called with arguments.
+is not recognized if called with arguments.
.
.TP
.BI include\ \(ts file \(ts
@@ -1052,7 +1051,7 @@ beginning with
.B .EQ
or
.B .EN
-will be ignored.
+are ignored.
.
.TP
.BI ifdef\ name\ X\ anything\ X
@@ -1149,10 +1148,10 @@ You can control which characters are treated as letters
command described above.
A type of
.B letter
-will cause a character to be set in italic type.
+causea a character to be set in italic type.
A type of
.B digit
-will cause a character to be set in roman type.
+causea a character to be set in roman type.
.
.
.SH FILES
@@ -1163,12 +1162,15 @@ Initialization file.
.SH MATHML MODE LIMITATIONS
MathML is designed on the assumption that it cannot know the exact
physical characteristics of the media and devices on which it will
-be rendered. It does not support fine control of motions and sizes
-to the same degree troff does. Thus:
+be rendered.
+It does not support fine control of motions and sizes to the same
+degree troff does.
+Thus:
+.
.IP *
.B eqn
parameters have no effect on the generated MathML.
-.LP
+.
.IP *
The
.BR special,
@@ -1176,46 +1178,56 @@ The
.BR down ,
.BR fwd ,
and
-.BR back ,
-operations cannot be implemented, and will yield a
-MathML <merror> message instead.
+.B back
+operations cannot be implemented, and yields a
+MathML `<merror>' message instead.
+.
.IP *
The
.B vcenter
keyword is silently ignored, as centering on the math axis is the
MathML default.
+.
.IP *
-Characters that eqn over troff sets extra large - notably the integral
-sign - may appear too small and need to have their <mstyle> wrappers
+Characters that
+.B eqn
+over troff sets extra large \(en notably the integral sign \(en
+may appear too small and need to have their `<mstyle>' wrappers
adjusted by hand.
+.
.LP
As in its troff mode,
.B eqn
-in MathML mode leaves the .EQ and .EN delimiters in place for
-displayed equations, but emits no explicit delimiters around
-inline equations. They can, however, be recognized as strings
-that begin with <math> and end with </math> and do not cross
-line boundaries.
+in MathML mode leaves the
+.B .EQ
+and
+.B .EN
+delimiters in place for displayed equations, but emits no explicit
+delimiters around inline equations.
+They can, however, be recognized as strings that begin with `<math>'
+and end with `</math>' and do not cross line boundaries.
+.
.LP
See the
.B BUGS
section for translation limits specific to
.BR eqn .
.
+.
.SH BUGS
-Inline equations will be set at the point size that is current at the
+Inline equations are set at the point size that is current at the
beginning of the input line.
.
In MathML mode, the
-.BR mark,
+.B mark
and
.B lineup
-features don't work. These could, in theory, be implemented with
-<maligngroup> elements.
+features don't work.
+These could, in theory, be implemented with `<maligngroup>' elements.
.
In MathML mode, each digit of a numeric literal gets a separate
-<mn></mn> pair and decimal points get an <mo></mo>. This is
-allowed by the specification, but inefficient.
+`<mn>\:</mn>' pair, and decimal points are tagged with `<mo>\:</mo>'.
+This is allowed by the specification, but inefficient.
.
.
.SH "SEE ALSO"
diff --git a/src/preproc/eqn/lex.cpp b/src/preproc/eqn/lex.cpp
index a5f0f9bd..5c27a5a2 100644
--- a/src/preproc/eqn/lex.cpp
+++ b/src/preproc/eqn/lex.cpp
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003, 2005
+/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003, 2005, 2007
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -120,7 +120,7 @@ static struct {
{ "special", SPECIAL },
};
-struct builtin_def {
+struct builtin_def {
const char *name;
const char *def;
};
@@ -301,7 +301,8 @@ void init_table(const char *device)
def->is_simple = 1;
macro_table.define(troff_defs[i].name, def);
}
- } else if (output_format == mathml) {
+ }
+ else if (output_format == mathml) {
for (i = 0; i < sizeof(mathml_defs)/sizeof(mathml_defs[0]); i++) {
definition *def = new definition[1];
def->is_macro = 1;
diff --git a/src/preproc/eqn/limit.cpp b/src/preproc/eqn/limit.cpp
index 72989202..cdda1c1d 100644
--- a/src/preproc/eqn/limit.cpp
+++ b/src/preproc/eqn/limit.cpp
@@ -1,5 +1,6 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1989, 1990, 1991, 1992, 2002, 2007
+ Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -167,19 +168,22 @@ void limit_box::output()
p->output();
printf(DELIMITER_CHAR);
printf("\\h'\\n[" WIDTH_FORMAT "]u'", uid);
- } else if (output_format == mathml) {
+ }
+ else if (output_format == mathml) {
if (from != 0 && to != 0) {
printf("<munderover>");
p->output();
from->output();
to->output();
printf("</munderover>");
- } else if (from != 0) {
+ }
+ else if (from != 0) {
printf("<munder>");
p->output();
from->output();
printf("</munder>");
- } else if (to != 0) {
+ }
+ else if (to != 0) {
printf("<mover>");
p->output();
to->output();
diff --git a/src/preproc/eqn/list.cpp b/src/preproc/eqn/list.cpp
index 81a2343e..4a9d0a7e 100644
--- a/src/preproc/eqn/list.cpp
+++ b/src/preproc/eqn/list.cpp
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
+/* Copyright (C) 1989, 1990, 1991, 1992, 2007 Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
diff --git a/src/preproc/eqn/main.cpp b/src/preproc/eqn/main.cpp
index b711a920..9bd3ce3b 100644
--- a/src/preproc/eqn/main.cpp
+++ b/src/preproc/eqn/main.cpp
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2005
+/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2005, 2007
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -309,7 +309,8 @@ int main(int argc, char **argv)
if (strcmp(device, "ps:html") == 0) {
device = "ps";
html = 1;
- } else if (strcmp(device, "MathML") == 0) {
+ }
+ else if (strcmp(device, "MathML") == 0) {
output_format = mathml;
load_startup_file = 0;
}
diff --git a/src/preproc/eqn/other.cpp b/src/preproc/eqn/other.cpp
index 9497dbf6..b9989146 100644
--- a/src/preproc/eqn/other.cpp
+++ b/src/preproc/eqn/other.cpp
@@ -1,5 +1,6 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1989, 1990, 1991, 1992, 2002, 2007
+ Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -77,7 +78,8 @@ void accent_box::output()
SKEW_FORMAT "]u)'",
p->uid, ab->uid, p->uid);
p->output();
- } else if (output_format == mathml) {
+ }
+ else if (output_format == mathml) {
printf("<mover accent='true'>");
p->output();
ab->output();
@@ -131,7 +133,8 @@ void accent_box::output()
p->output();
printf(DELIMITER_CHAR);
printf("\\h'\\n[" WIDTH_FORMAT "]u'", uid);
- } else if (output_format == mathml) {
+ }
+ else if (output_format == mathml) {
printf("<mover accent='true'>");
p->output();
ab->output();
@@ -172,9 +175,9 @@ void overline_char_box::output()
printf((draw_flag ? "\\D'l%dM 0'" : "\\l'%dM\\&\\(ru'"),
accent_width);
printf("\\v'%dM/2u+%dM'", 7*default_rule_thickness, x_height);
- } else if (output_format == mathml) {
- printf("<mo>&macr;</mo>");
}
+ else if (output_format == mathml)
+ printf("<mo>&macr;</mo>");
}
void overline_char_box::debug_print()
@@ -226,7 +229,8 @@ void overline_box::output()
printf("\\l'\\n[" WIDTH_FORMAT "]u\\&\\(ru'", p->uid);
printf(DELIMITER_CHAR);
p->output();
- } else if (output_format == mathml) {
+ }
+ else if (output_format == mathml) {
printf("<mover accent='false'>");
p->output();
printf("<mo>&macr;</mo></mover>");
@@ -304,7 +308,8 @@ void uaccent_box::output()
p->output();
printf(DELIMITER_CHAR);
printf("\\h'\\n[" WIDTH_FORMAT "]u'", uid);
- } else if (output_format == mathml) {
+ }
+ else if (output_format == mathml) {
printf("<munder accent='true'>");
p->output();
ab->output();
@@ -350,9 +355,9 @@ void underline_char_box::output()
printf((draw_flag ? "\\D'l%dM 0'" : "\\l'%dM\\&\\(ru'"),
accent_width);
printf("\\v'-%dM/2u'", 7*default_rule_thickness);
- } else if (output_format == mathml) {
- printf("<mo>&lowbar;</mo>");
}
+ else if (output_format == mathml)
+ printf("<mo>&lowbar;</mo>");
}
void underline_char_box::debug_print()
@@ -406,7 +411,8 @@ void underline_box::output()
printf("\\l'\\n[" WIDTH_FORMAT "]u\\&\\(ru'", p->uid);
printf(DELIMITER_CHAR);
p->output();
- } else if (output_format == mathml) {
+ }
+ else if (output_format == mathml) {
printf("<munder accent='true'>");
p->output();
printf("<mo>&macr;</mo></munder>");
@@ -450,7 +456,8 @@ void size_box::output()
printf("\\s[\\n[" SMALL_SIZE_FORMAT "]u]", uid);
p->output();
printf("\\s[\\n[" SIZE_FORMAT "]u]", uid);
- } else if (output_format == mathml) {
+ }
+ else if (output_format == mathml) {
printf("<mstyle mathsize='%s'>", size);
p->output();
printf("</mstyle>");
@@ -503,17 +510,21 @@ void font_box::output()
p->output();
current_roman_font = old_roman_font;
printf("\\f[\\n[" FONT_FORMAT "]]", uid);
- } else if (output_format == mathml) {
- char *mlfont = f;
+ }
+ else if (output_format == mathml) {
+ const char *mlfont = f;
// bold and italic are already in MathML; translate eqn roman here
switch (f[0]) {
- case 'I': case 'i':
+ case 'I':
+ case 'i':
mlfont = "italic";
break;
- case 'B': case 'b':
+ case 'B':
+ case 'b':
mlfont = "bold";
break;
- case 'R': case 'r':
+ case 'R':
+ case 'r':
default:
mlfont = "normal";
break;
@@ -552,7 +563,8 @@ void fat_box::output()
printf("\\h'-\\n[" WIDTH_FORMAT "]u'", p->uid);
printf("\\h'%dM'", fat_offset);
p->output();
- } else if (output_format == mathml) {
+ }
+ else if (output_format == mathml) {
printf("<mstyle mathvariant='double-struck'>");
p->output();
printf("</mstyle>");
@@ -596,8 +608,10 @@ void vmotion_box::output()
printf("\\v'%dM'", -n);
p->output();
printf("\\v'%dM'", n);
- } else if (output_format == mathml) {
- printf("<merror>eqn vertical motion cannot be expressed in MathML</merror>");
+ }
+ else if (output_format == mathml) {
+ printf("<merror>eqn vertical motion cannot be expressed "
+ "in MathML</merror>");
p->output();
}
}
@@ -633,8 +647,10 @@ void hmotion_box::output()
if (output_format == troff) {
printf("\\h'%dM'", n);
p->output();
- } else if (output_format == mathml) {
- printf("<merror>eqn horizontal motion cannot be expessed in MathML</merror>");
+ }
+ else if (output_format == mathml) {
+ printf("<merror>eqn horizontal motion cannot be expessed "
+ "in MathML</merror>");
p->output();
}
}
diff --git a/src/preproc/eqn/over.cpp b/src/preproc/eqn/over.cpp
index 95a95415..3eec6f04 100644
--- a/src/preproc/eqn/over.cpp
+++ b/src/preproc/eqn/over.cpp
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2001, 2002
+/* Copyright (C) 1989, 1990, 1991, 1992, 2001, 2002, 2007
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -177,7 +177,8 @@ void over_box::output()
fputs(draw_flag ? " 0'" : "\\&\\(ru'", stdout);
printf("\\v'%dM'", axis_height);
printf("\\h'%dM'", null_delimiter_space);
- } else if (output_format == mathml) {
+ }
+ else if (output_format == mathml) {
// FIXME: passing a displaystyle attribute doesn't validate.
printf("<mfrac>");
num->output();
diff --git a/src/preproc/eqn/pile.cpp b/src/preproc/eqn/pile.cpp
index 2ce4e4fb..eba09dc3 100644
--- a/src/preproc/eqn/pile.cpp
+++ b/src/preproc/eqn/pile.cpp
@@ -1,5 +1,6 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 1989, 1990, 1991, 1992, 2004, 2007
+ Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -96,13 +97,21 @@ void pile_box::output()
printf("\\v'\\n[" SUP_RAISE_FORMAT "]u'", uid);
printf("\\v'-(%du*\\n[" BASELINE_SEP_FORMAT "]u)'", col.len - 1, uid);
printf("\\h'\\n[" WIDTH_FORMAT "]u'", uid);
- } else if (output_format == mathml) {
+ }
+ else if (output_format == mathml) {
char *av;
switch (col.align) {
- case LEFT_ALIGN: av = "left"; break;
- case RIGHT_ALIGN: av = "right"; break;
- case CENTER_ALIGN: av = "center"; break;
- default: assert(0);
+ case LEFT_ALIGN:
+ av = "left";
+ break;
+ case RIGHT_ALIGN:
+ av = "right";
+ break;
+ case CENTER_ALIGN:
+ av = "center";
+ break;
+ default:
+ assert(0);
}
printf("<mtable columnalign='%s'>", av);
for (int i = 0; i < col.len; i++) {
@@ -226,7 +235,8 @@ void matrix_box::output()
printf("\\h'%dM'", column_sep);
}
printf("\\h'%dM'", matrix_side_sep);
- } else if (output_format == mathml) {
+ }
+ else if (output_format == mathml) {
int n = p[0]->len; // Each column must have the same number of rows in it
printf("<mtable>");
for (int i = 0; i < n; i++) {
@@ -234,10 +244,17 @@ void matrix_box::output()
for (int j = 0; j < len; j++) {
char *av;
switch (p[j]->align) {
- case LEFT_ALIGN: av = "left"; break;
- case RIGHT_ALIGN: av = "right"; break;
- case CENTER_ALIGN: av = "center"; break;
- default: assert(0);
+ case LEFT_ALIGN:
+ av = "left";
+ break;
+ case RIGHT_ALIGN:
+ av = "right";
+ break;
+ case CENTER_ALIGN:
+ av = "center";
+ break;
+ default:
+ assert(0);
}
printf("<mtd columnalign='%s'>", av);
p[j]->p[i]->output();
diff --git a/src/preproc/eqn/script.cpp b/src/preproc/eqn/script.cpp
index f5c56fee..71a5853f 100644
--- a/src/preproc/eqn/script.cpp
+++ b/src/preproc/eqn/script.cpp
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2002, 2004
+/* Copyright (C) 1989, 1990, 1991, 1992, 2002, 2004, 2007
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -189,25 +189,27 @@ void script_box::output()
}
printf("\\h'\\n[" WIDTH_FORMAT "]u-\\n[" WIDTH_FORMAT "]u'",
uid, p->uid);
- } else if (output_format == mathml) {
+ }
+ else if (output_format == mathml) {
if (sup != 0 and sub != 0) {
printf("<msubsup>");
p->output();
sub->output();
sup->output();
printf("</msubsup>");
- } else if (sup != 0) {
+ }
+ else if (sup != 0) {
printf("<msup>");
p->output();
sup->output();
printf("</msup>");
- } else if (sub != 0) {
+ }
+ else if (sub != 0) {
printf("<msub>");
p->output();
sub->output();
printf("</msub>");
}
-
}
}
diff --git a/src/preproc/eqn/special.cpp b/src/preproc/eqn/special.cpp
index 6e313d4f..f4305a89 100644
--- a/src/preproc/eqn/special.cpp
+++ b/src/preproc/eqn/special.cpp
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
+/* Copyright (C) 1989, 1990, 1991, 1992, 2007 Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
diff --git a/src/preproc/eqn/sqrt.cpp b/src/preproc/eqn/sqrt.cpp
index 1d45a765..b340bd4e 100644
--- a/src/preproc/eqn/sqrt.cpp
+++ b/src/preproc/eqn/sqrt.cpp
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2002, 2003
+/* Copyright (C) 1989, 1990, 1991, 1992, 2002, 2003, 2007
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -166,7 +166,8 @@ void sqrt_box::output()
printf(DELIMITER_CHAR);
printf("\\h'\\n[" WIDTH_FORMAT "]u'", uid);
- } else if (output_format == mathml) {
+ }
+ else if (output_format == mathml) {
printf("<msqrt>");
p->output();
printf("</msqrt>");
diff --git a/src/preproc/eqn/text.cpp b/src/preproc/eqn/text.cpp
index 176500dd..84dc873f 100644
--- a/src/preproc/eqn/text.cpp
+++ b/src/preproc/eqn/text.cpp
@@ -1,5 +1,6 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1989, 1990, 1991, 1992, 2003, 2007
+ Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -24,379 +25,378 @@ Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "ptable.h"
struct map {
- char *from;
- char *to;
+ const char *from;
+ const char *to;
};
struct map entity_table[] = {
- // Classic troff special characters
- {"%", "&shy;"}, // ISOnum
- {"'", "&acute;"}, // ISOdia
- {"!=", "&ne;"}, // ISOtech
- {"**", "&lowast;"}, // ISOtech
- {"*a", "&alpha;"}, // ISOgrk3
- {"*A", "A"},
- {"*b", "&beta;"}, // ISOgrk3
- {"*B", "B"},
- {"*d", "&delta;"}, // ISOgrk3
- {"*D", "&Delta;"}, // ISOgrk3
- {"*e", "&epsilon;"}, // ISOgrk3
- {"*E", "E"},
- {"*f", "&phi;"}, // ISOgrk3
- {"*F", "&Phi;"}, // ISOgrk3
- {"*g", "&gamma;"}, // ISOgrk3
- {"*G", "&Gamma;"}, // ISOgrk3
- {"*h", "&theta;"}, // ISOgrk3
- {"*H", "&Theta;"}, // ISOgrk3
- {"*i", "&iota;"}, // ISOgrk3
- {"*I", "I"},
- {"*k", "&kappa;"}, // ISOgrk3
- {"*K", "K;"},
- {"*l", "&lamda;"}, // ISOgrk3
- {"*L", "&Lambda;"}, // ISOgrk3
- {"*m", "&mu;"}, // ISOgrk3
- {"*M", "M"},
- {"*n", "&nu"}, // ISOgrk3
- {"*N", "N"},
- {"*o", "o"},
- {"*O", "O"},
- {"*p", "&pi;"}, // ISOgrk3
- {"*P", "&Pi;"}, // ISOgrk3
- {"*q", "&psi;"}, // ISOgrk3
- {"*Q", "&PSI;"}, // ISOgrk3
- {"*r", "&rho;"}, // ISOgrk3
- {"*R", "R"},
- {"*s", "&sigma;"}, // ISOgrk3
- {"*S", "&Sigma;"}, // ISOgrk3
- {"*t", "&tau;"}, // ISOgrk3
- {"*T", "&Tau;"}, // ISOgrk3
- {"*u", "&upsilon;"}, // ISOgrk3
- {"*U", "&Upsilon;"}, // ISOgrk3
- {"*w", "&omega;"}, // ISOgrk3
- {"*W", "&Omega;"}, // ISOgrk3
- {"*x", "&chi;"}, // ISOgrk3
- {"*X", "&Chi;"}, // ISOgrk3
- {"*y", "&eta;"}, // ISOgrk3
- {"*Y", "&Eta;"}, // ISOgrk3
- {"*z", "&zeta;"}, // ISOgrk3
- {"*Z", "&Zeta;"}, // ISOgrk3
- {"+-", "&plusmn;"}, // ISOnum
- {"->", "&rarr;"}, // ISOnum
- {"12", "&frac12;"}, // ISOnum
- {"14", "&frac14;"}, // ISOnum
- {"34", "&frac34;"}, // ISOnum
- {"<-", "&larr;"}, // ISOnum
- {"==", "&equiv;"}, // ISOtech
- {"Fi", "&ffilig;"}, // ISOpub
- {"Fl", "&ffllig;"}, // ISOpub
- {"aa", "&acute;"}, // ISOdia
- {"ap", "&sim;"}, // ISOtech
- {"bl", "&phonexb;"}, // ISOpub
- {"br", "&boxv;"}, // ISObox
- {"bs", "&phone;"}, // ISOpub (for the Bell logo)
- {"bu", "&bull;"}, // ISOpub
- {"bv", "&verbar;"}, // ISOnum
- {"ca", "&cap;"}, // ISOtech
- {"ci", "&cir;"}, // ISOpub
- {"co", "&copy;"}, // ISOnum
- {"ct", "&cent;"}, // ISOnum
- {"cu", "&cup;"}, // ISOtech
- {"da", "&darr;"}, // ISOnum
- {"de", "&deg;"}, // ISOnum
- {"dg", "&dagger;"}, // ISOpub
- {"dd", "&Dagger;"}, // ISOpub
- {"di", "&divide;"}, // ISOnum
- {"em", "&mdash;"}, // ISOpub
- {"eq", "&equals;"}, // ISOnum
- {"es", "&empty;"}, // ISOamso
- {"ff", "&fflig;"}, // ISOpub
- {"fi", "&filig;"}, // ISOpub
- {"fl", "&fllig;"}, // ISOpub
- {"fm", "&prime;"}, // ISOtech
- {"ge", "&ge;"}, // ISOtech
- {"gr", "&nabla;"}, // ISOtech
- {"hy", "&hyphen;"}, // ISOnum
- {"ib", "&sube;"}, // ISOtech
- {"if", "&infin;"}, // ISOtech
- {"ip", "&supe;"}, // ISOtech
- {"is", "&int;"}, // ISOtech
- {"le", "&le;"}, // ISOtech
- // Some pile characters go here
- {"mi", "&minus;"}, // ISOtech
- {"mo", "&isin;"}, // ISOtech
- {"mu", "&times;"}, // ISOnum
- {"no", "&not;"}, // ISOnum
- {"or", "&verbar;"}, // ISOnum
- {"pl", "&plus;"}, // ISOnum
- {"pt", "&prop;"}, // ISOtech
- {"rg", "&trade;"}, // ISOnum
- // More pile characters go here
- {"rn", "&macr;"}, // ISOdia
- {"ru", "&lowbar;"}, // ISOnum
- {"sb", "&sub;"}, // ISOtech
- {"sc", "&sect;"}, // ISOnum
- {"sl", "/"},
- {"sp", "&sup;"}, // ISOtech
- {"sq", "&squf;"}, // ISOpub
- {"sr", "&radic;"}, // ISOtech
- {"ts", "&sigmav;"}, // ISOgrk3
- {"ua", "&uarr;"}, // ISOnum
- {"ul", "_"},
- {"~=", "&cong;"}, // ISOtech
- // Extended specials supported by groff; see groff_char(7).
- // These are listed in the order they occur on that man page.
- {"-D", "&ETH;"}, // ISOlat: Icelandic uppercase eth
- {"Sd", "&eth;"}, // ISOlat1: Icelandic lowercase eth
- {"TP", "&THORN;"}, // ISOlat1: Icelandic uppercase thorn
- {"Tp", "&thorn;"}, // ISOlat1: Icelandic lowercase thorn
- {"ss", "&szlig;"}, // ISOlat1
- // Ligatures
- // ff, fi, fl, ffi, ffl from old troff go here
- {"AE", "&AElig;"}, // ISOlat1
- {"ae", "&aelig;"}, // ISOlat1
- {"OE", "&OElig;"}, // ISOlat2
- {"oe", "&oelig;"}, // ISOlat2
- {"IJ", "&ijlig;"}, // ISOlat2: Dutch IJ ligature
- {"ij", "&IJlig;"}, // ISOlat2: Dutch ij ligature
- {".i", "&inodot;"}, // ISOlat2,ISOamso
- {".j", "&jnodot;"}, // ISOamso (undocumented but in 1.19)
- // Accented characters
- {"'A", "&Aacute;"}, // ISOlat1
- {"'C", "&Cacute;"}, // ISOlat2
- {"'E", "&Eacute;"}, // ISOlat1
- {"'I", "&Iacute;"}, // ISOlat1
- {"'O", "&Oacute;"}, // ISOlat1
- {"'U", "&Uacute;"}, // ISOlat1
- {"'Y", "&Yacute;"}, // ISOlat1
- {"'a", "&aacute;"}, // ISOlat1
- {"'c", "&cacute;"}, // ISOlat2
- {"'e", "&eacute;"}, // ISOlat1
- {"'i", "&iacute;"}, // ISOlat1
- {"'o", "&oacute;"}, // ISOlat1
- {"'u", "&uacute;"}, // ISOlat1
- {"'y", "&yacute;"}, // ISOlat1
- {":A", "&Auml;"}, // ISOlat1
- {":E", "&Euml;"}, // ISOlat1
- {":I", "&Iuml;"}, // ISOlat1
- {":O", "&Ouml;"}, // ISOlat1
- {":U", "&Uuml;"}, // ISOlat1
- {":Y", "&Yuml;"}, // ISOlat2
- {":a", "&auml;"}, // ISOlat1
- {":e", "&euml;"}, // ISOlat1
- {":i", "&iuml;"}, // ISOlat1
- {":o", "&ouml;"}, // ISOlat1
- {":u", "&uuml;"}, // ISOlat1
- {":y", "&yuml;"}, // ISOlat1
- {"^A", "&Acirc;"}, // ISOlat1
- {"^E", "&Ecirc;"}, // ISOlat1
- {"^I", "&Icirc;"}, // ISOlat1
- {"^O", "&Ocirc;"}, // ISOlat1
- {"^U", "&Ucirc;"}, // ISOlat1
- {"^a", "&acirc;"}, // ISOlat1
- {"^e", "&ecirc;"}, // ISOlat1
- {"^i", "&icirc;"}, // ISOlat1
- {"^o", "&ocirc;"}, // ISOlat1
- {"^u", "&ucirc;"}, // ISOlat1
- {"`A", "&Agrave;"}, // ISOlat1
- {"`E", "&Egrave;"}, // ISOlat1
- {"`I", "&Igrave;"}, // ISOlat1
- {"`O", "&Ograve;"}, // ISOlat1
- {"`U", "&Ugrave;"}, // ISOlat1
- {"`a", "&agrave;"}, // ISOlat1
- {"`e", "&egrave;"}, // ISOlat1
- {"`i", "&igrave;"}, // ISOlat1
- {"`o", "&ograve;"}, // ISOlat1
- {"`u", "&ugrave;"}, // ISOlat1
- {"~A", "&Atilde;"}, // ISOlat1
- {"~N", "&Ntilde;"}, // ISOlat1
- {"~O", "&Otilde;"}, // ISOlat1
- {"~a", "&atilde;"}, // ISOlat1
- {"~n", "&ntilde;"}, // ISOlat1
- {"~o", "&otilde;"}, // ISOlat1
- {"vS", "&Scaron;"}, // ISOlat2
- {"vs", "&scaron;"}, // ISOlat2
- {"vZ", "&Zcaron;"}, // ISOlat2
- {"vz", "&zcaron;"}, // ISOlat2
- {",C", "&Ccedil;"}, // ISOlat1
- {",c", "&ccedil;"}, // ISOlat1
- {"/L", "&Lstrok;"}, // ISOlat2: Polish L with a slash
- {"/l", "&lstrok;"}, // ISOlat2: Polish l with a slash
- {"/O", "&Oslash;"}, // ISOlat1
- {"/o", "&oslash;"}, // ISOlat1
- {"oA", "&Aring;"}, // ISOlat1
- {"oa", "&aring;"}, // ISOlat1
- // Accents
- {"a\"","&dblac;"}, // ISOdia: double acute accent (Hungarian umlaut)
- {"a-", "&macr;"}, // ISOdia: macron or bar accent
- {"a.", "&dot;"}, // ISOdia: dot above
- {"a^", "&circ;"}, // ISOdia: circumflex accent
- {"aa", "&acute;"}, // ISOdia: acute accent
- {"ga", "&grave;"}, // ISOdia: grave accent
- {"ab", "&breve;"}, // ISOdia: breve accent
- {"ac", "&cedil;"}, // ISOdia: cedilla accent
- {"ad", "&uml;"}, // ISOdia: umlaut or dieresis
- {"ah", "&caron;"}, // ISOdia: caron (aka hacek accent)
- {"ao", "&ring;"}, // ISOdia: ring or circle accent
- {"a~", "&tilde;"}, // ISOdia: tilde accent
- {"ho", "&ogon;"}, // ISOdia: hook or ogonek accent
- {"ha", "^"}, // ASCII circumflex, hat, caret
- {"ti", "~"}, // ASCII tilde, large tilde
- // Quotes
- {"Bq", "&lsquor;"}, // ISOpub: low double comma quote
- {"bq", "&ldquor;"}, // ISOpub: low single comma quote
- {"lq", "&ldquo;"}, // ISOnum
- {"rq", "&rdquo;"}, // ISOpub
- {"oq", "&lsquo;"}, // ISOnum: single open quote
- {"cq", "&rsquo;"}, // ISOnum: single closing quote (ASCII 39)
- {"aq", "&zerosp;'"}, // apostrophe quote
- {"dq", "\""}, // double quote (ASCII 34)
- {"Fo", "&laquo;"}, // ISOnum
- {"Fc", "&raquo;"}, // ISOnum
- //{"fo", "&fo;"},
- //{"fc", "&fc;"},
- // Punctuation
- {"r!", "&iexcl;"}, // ISOnum
- {"r?", "&iquest;"}, // ISOnum
- // Old troff \(em goes here
- {"en", "&ndash;"}, // ISOpub: en dash
- // Old troff \(hy goes here
- // Brackets
- {"lB", "&lsqb;"}, // ISOnum: left (square) bracket
- {"rB", "&rsqb;"}, // ISOnum: right (square) bracket
- {"lC", "&lcub;"}, // ISOnum: left (curly) brace
- {"rC", "&rcub;"}, // ISOnum: right (curly) brace
- {"la", "&lang;"}, // ISOtech: left angle bracket
- {"ra", "&rang;"}, // ISOtech: right angle bracket
- // Old troff \(bv goes here
- // Bracket-pile characters could go here.
- // Arrows
- // Old troff \(<- and \(-> go here
- {"<>", "&harr;"}, // ISOamsa
- {"da", "&darr;"}, // ISOnum
- {"ua", "&uarr;"}, // ISOnum
- {"lA", "&lArr;"}, // ISOtech
- {"rA", "&rArr;"}, // ISOtech
- {"hA", "&iff;"}, // ISOtech: horizontal double-headed arrow
- {"dA", "&dArr;"}, // ISOamsa
- {"uA", "&uArr;"}, // ISOamsa
- {"vA", "&vArr;"}, // ISOamsa: vertical double-headed double arrow
- //{"an", "&an;"},
- // Lines
- {"-h", "&planck;"}, // ISOamso: h-bar (Planck's constant)
- // Old troff \(or goes here
- {"ba", "&verbar;"}, // ISOnum
- // Old troff \(br, \{u, \(ul, \(bv go here
- {"bb", "&brvbar;"}, // ISOnum
- {"sl", "/"},
- {"rs", "&bsol;"}, // ISOnum
- // Text markers
- // Old troff \(ci, \(bu, \(dd, \(dg go here
- {"lz", "&loz;"}, // ISOpub
- // Old troff sq goes here
- {"ps", "&para;"}, // ISOnum: paragraph or pilcrow sign
- {"sc", "&sect;"}, // ISOnum (in old troff)
- // Old troff \(lh, \{h go here
- {"at", "&commat;"}, // ISOnum
- {"sh", "&num;"}, // ISOnum
- //{"CR", "&CR;"},
- {"OK", "&check;"}, // ISOpub
- // Legalize
- // Old troff \(co, \{g go here
- {"tm", "&trade;"}, // ISOnum
- // Currency symbols
- {"Do", "&dollar;"}, // ISOnum
- {"ct", "&cent;"}, // ISOnum
- {"eu", "&euro;"},
- {"Eu", "&euro;"},
- {"Ye", "&yen;"}, // ISOnum
- {"Po", "&pound;"}, // ISOnum
- {"Cs", "&curren;"}, // ISOnum: currency sign
- {"Fn", "&fnof"}, // ISOtech
- // Units
- // Old troff de goes here
- {"%0", "&permil;"}, // ISOtech: per thousand, per mille sign
- // Old troff \(fm goes here
- {"sd", "&Prime;"}, // ISOtech
- {"mc", "&micro;"}, // ISOnum
- {"Of", "&ordf;"}, // ISOnum
- {"Om", "&ordm;"}, // ISOnum
- // Logical symbols
- {"AN", "&and;"}, // ISOtech
- {"OR", "&or;"}, // ISOtech
- // Old troff \(no goes here
- {"te", "&exist;"}, // ISOtech: there exists, existential quantifier
- {"fa", "&forall;"}, // ISOtech: for all, universal quantifier
- {"st", "&bepsi"}, // ISOamsr: such that
- {"3d", "&there4;"}, // ISOtech
- {"tf", "&there4;"}, // ISOtech
- // Mathematical symbols
- // Old troff "12", "14", "34" goes here
- {"S1", "&sup1;"}, // ISOnum
- {"S2", "&sup2;"}, // ISOnum
- {"S3", "&sup3;"}, // ISOnum
- // Old troff \(pl", \-, \(+- go here
- {"t+-", "&plusmn;"}, // ISOnum
- {"-+", "&mnplus;"}, // ISOtech
- {"pc", "&middot;"}, // ISOnum
- {"md", "&middot;"}, // ISOnum
- // Old troff \(mu goes here
- {"tmu", "&times;"}, // ISOnum
- {"c*", "&otimes;"}, // ISOamsb: multiply sign in a circle
- {"c+", "&oplus;"}, // ISOamsb: plus sign in a circle
- // Old troff \(di goes here
- {"tdi", "&divide;"}, // ISOnum
- {"f/", "&horbar;"}, // ISOnum: horizintal bar for fractions
- // Old troff \(** goes here
- {"<=", "&le;"}, // ISOtech
- {">=", "&ge;"}, // ISOtech
- {"<<", "&Lt;"}, // ISOamsr
- {">>", "&Gt;"}, // ISOamsr
- {"!=", "&ne;"}, // ISOtech
- // Old troff \(eq and \(== go here
- {"=~", "&cong;"}, // ISOamsr
- // Old troff \(ap goes here
- {"~~", "&ap;"}, // ISOtech
- // This appears to be an error in the groff table.
- // It clashes with the Bell Labs use of ~= for a congruence sign
- // {"~=", "&ap;"}, // ISOamsr
- // Old troff \(pt, \(es, \(mo go here
- {"nm", "&notin;"}, // ISOtech
- {"nb", "&nsub;"}, // ISOamsr
- {"nc", "&nsup;"}, // ISOamsn
- {"ne", "&nequiv;"}, // ISOamsn
- // Old troff \(sb, \(sp, \(ib, \(ip, \(ca, \(cu go here
- {"/_", "&ang;"}, // ISOamso
- {"pp", "&perp;"}, // ISOtech
- // Old troff \(is goes here
- {"sum", "&sum;"}, // ISOamsb
- {"product", "&prod;"}, // ISOamsb
- {"gr", "&nabla;"}, // ISOtech
- // Old troff \(sr. \{n, \(if go here
- {"Ah", "&aleph;"}, // ISOtech
- {"Im", "&image;"}, // ISOamso: Fraktur I, imaginary
- {"Re", "&real;"}, // ISOamso: Fraktur R, real
- {"wp", "&weierp;"}, // ISOamso
- {"pd", "&part;"}, // ISOtech: partial differentiation sign
- // Their table duplicates the Greek letters here.
- // We list only the variant forms here, mapping them into
- // the ISO Greek 4 variants (which may or may not be correct :-()
- {"+f", "&b.phiv;"}, // ISOgrk4: variant phi
- {"+h", "&b.thetas;"}, // ISOgrk4: variant theta
- {"+p", "&b.omega;"}, // ISOgrk4: variant pi, looking like omega
- // Card symbols
- {"CL", "&clubs;"}, // ISOpub: club suit
- {"SP", "&spades;"}, // ISOpub: spade suit
- {"HE", "&hearts;"}, // ISOpub: heart suit
- {"DI", "&diams;"}, // ISOpub: diamond suit
+ // Classic troff special characters
+ {"%", "&shy;"}, // ISOnum
+ {"'", "&acute;"}, // ISOdia
+ {"!=", "&ne;"}, // ISOtech
+ {"**", "&lowast;"}, // ISOtech
+ {"*a", "&alpha;"}, // ISOgrk3
+ {"*A", "A"},
+ {"*b", "&beta;"}, // ISOgrk3
+ {"*B", "B"},
+ {"*d", "&delta;"}, // ISOgrk3
+ {"*D", "&Delta;"}, // ISOgrk3
+ {"*e", "&epsilon;"}, // ISOgrk3
+ {"*E", "E"},
+ {"*f", "&phi;"}, // ISOgrk3
+ {"*F", "&Phi;"}, // ISOgrk3
+ {"*g", "&gamma;"}, // ISOgrk3
+ {"*G", "&Gamma;"}, // ISOgrk3
+ {"*h", "&theta;"}, // ISOgrk3
+ {"*H", "&Theta;"}, // ISOgrk3
+ {"*i", "&iota;"}, // ISOgrk3
+ {"*I", "I"},
+ {"*k", "&kappa;"}, // ISOgrk3
+ {"*K", "K;"},
+ {"*l", "&lamda;"}, // ISOgrk3
+ {"*L", "&Lambda;"}, // ISOgrk3
+ {"*m", "&mu;"}, // ISOgrk3
+ {"*M", "M"},
+ {"*n", "&nu"}, // ISOgrk3
+ {"*N", "N"},
+ {"*o", "o"},
+ {"*O", "O"},
+ {"*p", "&pi;"}, // ISOgrk3
+ {"*P", "&Pi;"}, // ISOgrk3
+ {"*q", "&psi;"}, // ISOgrk3
+ {"*Q", "&PSI;"}, // ISOgrk3
+ {"*r", "&rho;"}, // ISOgrk3
+ {"*R", "R"},
+ {"*s", "&sigma;"}, // ISOgrk3
+ {"*S", "&Sigma;"}, // ISOgrk3
+ {"*t", "&tau;"}, // ISOgrk3
+ {"*T", "&Tau;"}, // ISOgrk3
+ {"*u", "&upsilon;"}, // ISOgrk3
+ {"*U", "&Upsilon;"}, // ISOgrk3
+ {"*w", "&omega;"}, // ISOgrk3
+ {"*W", "&Omega;"}, // ISOgrk3
+ {"*x", "&chi;"}, // ISOgrk3
+ {"*X", "&Chi;"}, // ISOgrk3
+ {"*y", "&eta;"}, // ISOgrk3
+ {"*Y", "&Eta;"}, // ISOgrk3
+ {"*z", "&zeta;"}, // ISOgrk3
+ {"*Z", "&Zeta;"}, // ISOgrk3
+ {"+-", "&plusmn;"}, // ISOnum
+ {"->", "&rarr;"}, // ISOnum
+ {"12", "&frac12;"}, // ISOnum
+ {"14", "&frac14;"}, // ISOnum
+ {"34", "&frac34;"}, // ISOnum
+ {"<-", "&larr;"}, // ISOnum
+ {"==", "&equiv;"}, // ISOtech
+ {"Fi", "&ffilig;"}, // ISOpub
+ {"Fl", "&ffllig;"}, // ISOpub
+ {"aa", "&acute;"}, // ISOdia
+ {"ap", "&sim;"}, // ISOtech
+ {"bl", "&phonexb;"}, // ISOpub
+ {"br", "&boxv;"}, // ISObox
+ {"bs", "&phone;"}, // ISOpub (for the Bell logo)
+ {"bu", "&bull;"}, // ISOpub
+ {"bv", "&verbar;"}, // ISOnum
+ {"ca", "&cap;"}, // ISOtech
+ {"ci", "&cir;"}, // ISOpub
+ {"co", "&copy;"}, // ISOnum
+ {"ct", "&cent;"}, // ISOnum
+ {"cu", "&cup;"}, // ISOtech
+ {"da", "&darr;"}, // ISOnum
+ {"de", "&deg;"}, // ISOnum
+ {"dg", "&dagger;"}, // ISOpub
+ {"dd", "&Dagger;"}, // ISOpub
+ {"di", "&divide;"}, // ISOnum
+ {"em", "&mdash;"}, // ISOpub
+ {"eq", "&equals;"}, // ISOnum
+ {"es", "&empty;"}, // ISOamso
+ {"ff", "&fflig;"}, // ISOpub
+ {"fi", "&filig;"}, // ISOpub
+ {"fl", "&fllig;"}, // ISOpub
+ {"fm", "&prime;"}, // ISOtech
+ {"ge", "&ge;"}, // ISOtech
+ {"gr", "&nabla;"}, // ISOtech
+ {"hy", "&hyphen;"}, // ISOnum
+ {"ib", "&sube;"}, // ISOtech
+ {"if", "&infin;"}, // ISOtech
+ {"ip", "&supe;"}, // ISOtech
+ {"is", "&int;"}, // ISOtech
+ {"le", "&le;"}, // ISOtech
+ // Some pile characters go here
+ {"mi", "&minus;"}, // ISOtech
+ {"mo", "&isin;"}, // ISOtech
+ {"mu", "&times;"}, // ISOnum
+ {"no", "&not;"}, // ISOnum
+ {"or", "&verbar;"}, // ISOnum
+ {"pl", "&plus;"}, // ISOnum
+ {"pt", "&prop;"}, // ISOtech
+ {"rg", "&trade;"}, // ISOnum
+ // More pile characters go here
+ {"rn", "&macr;"}, // ISOdia
+ {"ru", "&lowbar;"}, // ISOnum
+ {"sb", "&sub;"}, // ISOtech
+ {"sc", "&sect;"}, // ISOnum
+ {"sl", "/"},
+ {"sp", "&sup;"}, // ISOtech
+ {"sq", "&squf;"}, // ISOpub
+ {"sr", "&radic;"}, // ISOtech
+ {"ts", "&sigmav;"}, // ISOgrk3
+ {"ua", "&uarr;"}, // ISOnum
+ {"ul", "_"},
+ {"~=", "&cong;"}, // ISOtech
+ // Extended specials supported by groff; see groff_char(7).
+ // These are listed in the order they occur on that man page.
+ {"-D", "&ETH;"}, // ISOlat: Icelandic uppercase eth
+ {"Sd", "&eth;"}, // ISOlat1: Icelandic lowercase eth
+ {"TP", "&THORN;"}, // ISOlat1: Icelandic uppercase thorn
+ {"Tp", "&thorn;"}, // ISOlat1: Icelandic lowercase thorn
+ {"ss", "&szlig;"}, // ISOlat1
+ // Ligatures
+ // ff, fi, fl, ffi, ffl from old troff go here
+ {"AE", "&AElig;"}, // ISOlat1
+ {"ae", "&aelig;"}, // ISOlat1
+ {"OE", "&OElig;"}, // ISOlat2
+ {"oe", "&oelig;"}, // ISOlat2
+ {"IJ", "&ijlig;"}, // ISOlat2: Dutch IJ ligature
+ {"ij", "&IJlig;"}, // ISOlat2: Dutch ij ligature
+ {".i", "&inodot;"}, // ISOlat2,ISOamso
+ {".j", "&jnodot;"}, // ISOamso (undocumented but in 1.19)
+ // Accented characters
+ {"'A", "&Aacute;"}, // ISOlat1
+ {"'C", "&Cacute;"}, // ISOlat2
+ {"'E", "&Eacute;"}, // ISOlat1
+ {"'I", "&Iacute;"}, // ISOlat1
+ {"'O", "&Oacute;"}, // ISOlat1
+ {"'U", "&Uacute;"}, // ISOlat1
+ {"'Y", "&Yacute;"}, // ISOlat1
+ {"'a", "&aacute;"}, // ISOlat1
+ {"'c", "&cacute;"}, // ISOlat2
+ {"'e", "&eacute;"}, // ISOlat1
+ {"'i", "&iacute;"}, // ISOlat1
+ {"'o", "&oacute;"}, // ISOlat1
+ {"'u", "&uacute;"}, // ISOlat1
+ {"'y", "&yacute;"}, // ISOlat1
+ {":A", "&Auml;"}, // ISOlat1
+ {":E", "&Euml;"}, // ISOlat1
+ {":I", "&Iuml;"}, // ISOlat1
+ {":O", "&Ouml;"}, // ISOlat1
+ {":U", "&Uuml;"}, // ISOlat1
+ {":Y", "&Yuml;"}, // ISOlat2
+ {":a", "&auml;"}, // ISOlat1
+ {":e", "&euml;"}, // ISOlat1
+ {":i", "&iuml;"}, // ISOlat1
+ {":o", "&ouml;"}, // ISOlat1
+ {":u", "&uuml;"}, // ISOlat1
+ {":y", "&yuml;"}, // ISOlat1
+ {"^A", "&Acirc;"}, // ISOlat1
+ {"^E", "&Ecirc;"}, // ISOlat1
+ {"^I", "&Icirc;"}, // ISOlat1
+ {"^O", "&Ocirc;"}, // ISOlat1
+ {"^U", "&Ucirc;"}, // ISOlat1
+ {"^a", "&acirc;"}, // ISOlat1
+ {"^e", "&ecirc;"}, // ISOlat1
+ {"^i", "&icirc;"}, // ISOlat1
+ {"^o", "&ocirc;"}, // ISOlat1
+ {"^u", "&ucirc;"}, // ISOlat1
+ {"`A", "&Agrave;"}, // ISOlat1
+ {"`E", "&Egrave;"}, // ISOlat1
+ {"`I", "&Igrave;"}, // ISOlat1
+ {"`O", "&Ograve;"}, // ISOlat1
+ {"`U", "&Ugrave;"}, // ISOlat1
+ {"`a", "&agrave;"}, // ISOlat1
+ {"`e", "&egrave;"}, // ISOlat1
+ {"`i", "&igrave;"}, // ISOlat1
+ {"`o", "&ograve;"}, // ISOlat1
+ {"`u", "&ugrave;"}, // ISOlat1
+ {"~A", "&Atilde;"}, // ISOlat1
+ {"~N", "&Ntilde;"}, // ISOlat1
+ {"~O", "&Otilde;"}, // ISOlat1
+ {"~a", "&atilde;"}, // ISOlat1
+ {"~n", "&ntilde;"}, // ISOlat1
+ {"~o", "&otilde;"}, // ISOlat1
+ {"vS", "&Scaron;"}, // ISOlat2
+ {"vs", "&scaron;"}, // ISOlat2
+ {"vZ", "&Zcaron;"}, // ISOlat2
+ {"vz", "&zcaron;"}, // ISOlat2
+ {",C", "&Ccedil;"}, // ISOlat1
+ {",c", "&ccedil;"}, // ISOlat1
+ {"/L", "&Lstrok;"}, // ISOlat2: Polish L with a slash
+ {"/l", "&lstrok;"}, // ISOlat2: Polish l with a slash
+ {"/O", "&Oslash;"}, // ISOlat1
+ {"/o", "&oslash;"}, // ISOlat1
+ {"oA", "&Aring;"}, // ISOlat1
+ {"oa", "&aring;"}, // ISOlat1
+ // Accents
+ {"a\"","&dblac;"}, // ISOdia: double acute accent (Hungarian umlaut)
+ {"a-", "&macr;"}, // ISOdia: macron or bar accent
+ {"a.", "&dot;"}, // ISOdia: dot above
+ {"a^", "&circ;"}, // ISOdia: circumflex accent
+ {"aa", "&acute;"}, // ISOdia: acute accent
+ {"ga", "&grave;"}, // ISOdia: grave accent
+ {"ab", "&breve;"}, // ISOdia: breve accent
+ {"ac", "&cedil;"}, // ISOdia: cedilla accent
+ {"ad", "&uml;"}, // ISOdia: umlaut or dieresis
+ {"ah", "&caron;"}, // ISOdia: caron (aka hacek accent)
+ {"ao", "&ring;"}, // ISOdia: ring or circle accent
+ {"a~", "&tilde;"}, // ISOdia: tilde accent
+ {"ho", "&ogon;"}, // ISOdia: hook or ogonek accent
+ {"ha", "^"}, // ASCII circumflex, hat, caret
+ {"ti", "~"}, // ASCII tilde, large tilde
+ // Quotes
+ {"Bq", "&lsquor;"}, // ISOpub: low double comma quote
+ {"bq", "&ldquor;"}, // ISOpub: low single comma quote
+ {"lq", "&ldquo;"}, // ISOnum
+ {"rq", "&rdquo;"}, // ISOpub
+ {"oq", "&lsquo;"}, // ISOnum: single open quote
+ {"cq", "&rsquo;"}, // ISOnum: single closing quote (ASCII 39)
+ {"aq", "&zerosp;'"}, // apostrophe quote
+ {"dq", "\""}, // double quote (ASCII 34)
+ {"Fo", "&laquo;"}, // ISOnum
+ {"Fc", "&raquo;"}, // ISOnum
+ //{"fo", "&fo;"},
+ //{"fc", "&fc;"},
+ // Punctuation
+ {"r!", "&iexcl;"}, // ISOnum
+ {"r?", "&iquest;"}, // ISOnum
+ // Old troff \(em goes here
+ {"en", "&ndash;"}, // ISOpub: en dash
+ // Old troff \(hy goes here
+ // Brackets
+ {"lB", "&lsqb;"}, // ISOnum: left (square) bracket
+ {"rB", "&rsqb;"}, // ISOnum: right (square) bracket
+ {"lC", "&lcub;"}, // ISOnum: left (curly) brace
+ {"rC", "&rcub;"}, // ISOnum: right (curly) brace
+ {"la", "&lang;"}, // ISOtech: left angle bracket
+ {"ra", "&rang;"}, // ISOtech: right angle bracket
+ // Old troff \(bv goes here
+ // Bracket-pile characters could go here.
+ // Arrows
+ // Old troff \(<- and \(-> go here
+ {"<>", "&harr;"}, // ISOamsa
+ {"da", "&darr;"}, // ISOnum
+ {"ua", "&uarr;"}, // ISOnum
+ {"lA", "&lArr;"}, // ISOtech
+ {"rA", "&rArr;"}, // ISOtech
+ {"hA", "&iff;"}, // ISOtech: horizontal double-headed arrow
+ {"dA", "&dArr;"}, // ISOamsa
+ {"uA", "&uArr;"}, // ISOamsa
+ {"vA", "&vArr;"}, // ISOamsa: vertical double-headed double arrow
+ //{"an", "&an;"},
+ // Lines
+ {"-h", "&planck;"}, // ISOamso: h-bar (Planck's constant)
+ // Old troff \(or goes here
+ {"ba", "&verbar;"}, // ISOnum
+ // Old troff \(br, \{u, \(ul, \(bv go here
+ {"bb", "&brvbar;"}, // ISOnum
+ {"sl", "/"},
+ {"rs", "&bsol;"}, // ISOnum
+ // Text markers
+ // Old troff \(ci, \(bu, \(dd, \(dg go here
+ {"lz", "&loz;"}, // ISOpub
+ // Old troff sq goes here
+ {"ps", "&para;"}, // ISOnum: paragraph or pilcrow sign
+ {"sc", "&sect;"}, // ISOnum (in old troff)
+ // Old troff \(lh, \{h go here
+ {"at", "&commat;"}, // ISOnum
+ {"sh", "&num;"}, // ISOnum
+ //{"CR", "&CR;"},
+ {"OK", "&check;"}, // ISOpub
+ // Legalize
+ // Old troff \(co, \{g go here
+ {"tm", "&trade;"}, // ISOnum
+ // Currency symbols
+ {"Do", "&dollar;"}, // ISOnum
+ {"ct", "&cent;"}, // ISOnum
+ {"eu", "&euro;"},
+ {"Eu", "&euro;"},
+ {"Ye", "&yen;"}, // ISOnum
+ {"Po", "&pound;"}, // ISOnum
+ {"Cs", "&curren;"}, // ISOnum: currency sign
+ {"Fn", "&fnof"}, // ISOtech
+ // Units
+ // Old troff de goes here
+ {"%0", "&permil;"}, // ISOtech: per thousand, per mille sign
+ // Old troff \(fm goes here
+ {"sd", "&Prime;"}, // ISOtech
+ {"mc", "&micro;"}, // ISOnum
+ {"Of", "&ordf;"}, // ISOnum
+ {"Om", "&ordm;"}, // ISOnum
+ // Logical symbols
+ {"AN", "&and;"}, // ISOtech
+ {"OR", "&or;"}, // ISOtech
+ // Old troff \(no goes here
+ {"te", "&exist;"}, // ISOtech: there exists, existential quantifier
+ {"fa", "&forall;"}, // ISOtech: for all, universal quantifier
+ {"st", "&bepsi"}, // ISOamsr: such that
+ {"3d", "&there4;"}, // ISOtech
+ {"tf", "&there4;"}, // ISOtech
+ // Mathematical symbols
+ // Old troff "12", "14", "34" goes here
+ {"S1", "&sup1;"}, // ISOnum
+ {"S2", "&sup2;"}, // ISOnum
+ {"S3", "&sup3;"}, // ISOnum
+ // Old troff \(pl", \-, \(+- go here
+ {"t+-", "&plusmn;"}, // ISOnum
+ {"-+", "&mnplus;"}, // ISOtech
+ {"pc", "&middot;"}, // ISOnum
+ {"md", "&middot;"}, // ISOnum
+ // Old troff \(mu goes here
+ {"tmu", "&times;"}, // ISOnum
+ {"c*", "&otimes;"}, // ISOamsb: multiply sign in a circle
+ {"c+", "&oplus;"}, // ISOamsb: plus sign in a circle
+ // Old troff \(di goes here
+ {"tdi", "&divide;"}, // ISOnum
+ {"f/", "&horbar;"}, // ISOnum: horizintal bar for fractions
+ // Old troff \(** goes here
+ {"<=", "&le;"}, // ISOtech
+ {">=", "&ge;"}, // ISOtech
+ {"<<", "&Lt;"}, // ISOamsr
+ {">>", "&Gt;"}, // ISOamsr
+ {"!=", "&ne;"}, // ISOtech
+ // Old troff \(eq and \(== go here
+ {"=~", "&cong;"}, // ISOamsr
+ // Old troff \(ap goes here
+ {"~~", "&ap;"}, // ISOtech
+ // This appears to be an error in the groff table.
+ // It clashes with the Bell Labs use of ~= for a congruence sign
+ // {"~=", "&ap;"}, // ISOamsr
+ // Old troff \(pt, \(es, \(mo go here
+ {"nm", "&notin;"}, // ISOtech
+ {"nb", "&nsub;"}, // ISOamsr
+ {"nc", "&nsup;"}, // ISOamsn
+ {"ne", "&nequiv;"}, // ISOamsn
+ // Old troff \(sb, \(sp, \(ib, \(ip, \(ca, \(cu go here
+ {"/_", "&ang;"}, // ISOamso
+ {"pp", "&perp;"}, // ISOtech
+ // Old troff \(is goes here
+ {"sum", "&sum;"}, // ISOamsb
+ {"product", "&prod;"}, // ISOamsb
+ {"gr", "&nabla;"}, // ISOtech
+ // Old troff \(sr. \{n, \(if go here
+ {"Ah", "&aleph;"}, // ISOtech
+ {"Im", "&image;"}, // ISOamso: Fraktur I, imaginary
+ {"Re", "&real;"}, // ISOamso: Fraktur R, real
+ {"wp", "&weierp;"}, // ISOamso
+ {"pd", "&part;"}, // ISOtech: partial differentiation sign
+ // Their table duplicates the Greek letters here.
+ // We list only the variant forms here, mapping them into
+ // the ISO Greek 4 variants (which may or may not be correct :-()
+ {"+f", "&b.phiv;"}, // ISOgrk4: variant phi
+ {"+h", "&b.thetas;"}, // ISOgrk4: variant theta
+ {"+p", "&b.omega;"}, // ISOgrk4: variant pi, looking like omega
+ // Card symbols
+ {"CL", "&clubs;"}, // ISOpub: club suit
+ {"SP", "&spades;"}, // ISOpub: spade suit
+ {"HE", "&hearts;"}, // ISOpub: heart suit
+ {"DI", "&diams;"}, // ISOpub: diamond suit
};
-char *special_to_entity(const char *sp)
+const char *special_to_entity(const char *sp)
{
struct map *mp;
- char *entity;
for (mp = entity_table;
mp < entity_table + sizeof(entity_table)/sizeof(entity_table[0]);
- mp++){
+ mp++) {
if (strcmp(mp->from, sp) == 0)
return mp->to;
}
@@ -438,7 +438,7 @@ enum spacing_type {
s_closing,
s_punctuation,
s_inner,
- s_suppress,
+ s_suppress
};
const char *spacing_type_table[] = {
@@ -589,7 +589,8 @@ void char_box::output()
fputs("\\&", stdout); // suppress ligaturing and kerning
if (font_type != LETTER_TYPE)
fputs("\\fP", stdout);
- } else if (output_format == mathml) {
+ }
+ else if (output_format == mathml) {
if (isdigit(c))
printf("<mn>");
else if (char_table[c].spacing_type)
@@ -660,8 +661,9 @@ void special_char_box::output()
printf("\\,\\[%s]\\/", s);
if (font_type != LETTER_TYPE)
printf("\\fP");
- } else if (output_format == mathml) {
- char *entity = special_to_entity(s);
+ }
+ else if (output_format == mathml) {
+ const char *entity = special_to_entity(s);
if (entity != NULL)
printf("<mo>%s</mo>", entity);
else