{-# LANGUAGE GeneralizedNewtypeDeriving, ViewPatterns, GADTs, OverloadedStrings #-}
{-
Copyright (C) 2023 John MacFarlane <jgm@berkeley.edu>

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

-}

module Text.TeXMath.Writers.Typst (writeTypst) where

import Data.List (transpose)
import qualified Data.Map as M
import qualified Data.Text as T
import Text.TeXMath.Types
import qualified Text.TeXMath.Shared as S
import Data.Generics (everywhere, mkT)
import Data.Text (Text)
import Data.Char (isDigit, isAlpha)

-- import Debug.Trace
-- tr' x = trace (show x) x

-- | Transforms an expression tree to equivalent Typst
writeTypst :: DisplayType -> [Exp] -> Text
writeTypst :: DisplayType -> [Exp] -> Text
writeTypst DisplayType
dt [Exp]
exprs =
  [Text] -> Text
T.unwords forall a b. (a -> b) -> a -> b
$ forall a b. (a -> b) -> [a] -> [b]
map Exp -> Text
writeExp forall a b. (a -> b) -> a -> b
$ (forall a. Data a => a -> a) -> forall a. Data a => a -> a
everywhere (forall a b. (Typeable a, Typeable b) => (b -> b) -> a -> a
mkT forall a b. (a -> b) -> a -> b
$ DisplayType -> Exp -> Exp
S.handleDownup DisplayType
dt) [Exp]
exprs

writeExps :: [Exp] -> Text
writeExps :: [Exp] -> Text
writeExps = Text -> [Text] -> Text
T.intercalate Text
" " forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a -> b) -> [a] -> [b]
map Exp -> Text
writeExp

inParens :: Text -> Text
inParens :: Text -> Text
inParens Text
s = Text
"(" forall a. Semigroup a => a -> a -> a
<> Text
s forall a. Semigroup a => a -> a -> a
<> Text
")"

inQuotes :: Text -> Text
inQuotes :: Text -> Text
inQuotes Text
s = Text
"\"" forall a. Semigroup a => a -> a -> a
<> Text
s forall a. Semigroup a => a -> a -> a
<> Text
"\""

esc :: Text -> Text
esc :: Text -> Text
esc Text
t =
  if (Char -> Bool) -> Text -> Bool
T.any Char -> Bool
needsEscape Text
t
     then (Char -> Text) -> Text -> Text
T.concatMap Char -> Text
escapeChar Text
t
     else Text
t
  where
    escapeChar :: Char -> Text
escapeChar Char
c
      | Char -> Bool
needsEscape Char
c = Text
"\\" forall a. Semigroup a => a -> a -> a
<> Char -> Text
T.singleton Char
c
      | Bool
otherwise = Char -> Text
T.singleton Char
c
    needsEscape :: Char -> Bool
needsEscape Char
'[' = Bool
True
    needsEscape Char
']' = Bool
True
    needsEscape Char
'|' = Bool
True
    needsEscape Char
'#' = Bool
True
    needsEscape Char
'$' = Bool
True
    needsEscape Char
'(' = Bool
True
    needsEscape Char
')' = Bool
True
    needsEscape Char
'_' = Bool
True
    needsEscape Char
_ = Bool
False

writeExpS :: Exp -> Text
writeExpS :: Exp -> Text
writeExpS (EGrouped [Exp]
es) = Text
"(" forall a. Semigroup a => a -> a -> a
<> [Exp] -> Text
writeExps [Exp]
es forall a. Semigroup a => a -> a -> a
<> Text
")"
writeExpS Exp
e =
  case Exp -> Text
writeExp Exp
e of
    Text
t | (Char -> Bool) -> Text -> Bool
T.all (\Char
c -> Char -> Bool
isDigit Char
c Bool -> Bool -> Bool
|| Char
c forall a. Eq a => a -> a -> Bool
== Char
'.') Text
t -> Text
t
      | (Char -> Bool) -> Text -> Bool
T.all (\Char
c -> Char -> Bool
isAlpha Char
c Bool -> Bool -> Bool
|| Char
c forall a. Eq a => a -> a -> Bool
== Char
'.') Text
t -> Text
t
      | Bool
otherwise -> Text
"(" forall a. Semigroup a => a -> a -> a
<> Text
t forall a. Semigroup a => a -> a -> a
<> Text
")"

writeExpB :: Exp -> Text
writeExpB :: Exp -> Text
writeExpB Exp
e =
  case Exp -> Text
writeExp Exp
e of
    Text
"" -> Text
"zws"
    Text
t -> Text
t

writeExp :: Exp -> Text
writeExp :: Exp -> Text
writeExp (ENumber Text
s) = Text
s
writeExp (ESymbol TeXSymbolType
_t Text
s) =
  forall b a. b -> (a -> b) -> Maybe a -> b
maybe (Text -> Text
esc Text
s) forall a. a -> a
id forall a b. (a -> b) -> a -> b
$ forall k a. Ord k => k -> Map k a -> Maybe a
M.lookup Text
s Map Text Text
typstSymbols
writeExp (EIdentifier Text
s) =
  if Text -> Int
T.length Text
s forall a. Eq a => a -> a -> Bool
== Int
1
     then Exp -> Text
writeExp (TeXSymbolType -> Text -> Exp
ESymbol TeXSymbolType
Ord Text
s)
     else Text -> Text
inQuotes Text
s
writeExp (EMathOperator Text
s)
  | Text
s forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
`elem` [Text
"arccos", Text
"arcsin", Text
"arctan", Text
"arg", Text
"cos", Text
"cosh",
              Text
"cot", Text
"ctg", Text
"coth", Text
"csc", Text
"deg", Text
"det", Text
"dim", Text
"exp",
              Text
"gcd", Text
"hom", Text
"mod", Text
"inf", Text
"ker", Text
"lg", Text
"lim", Text
"ln",
              Text
"log", Text
"max", Text
"min", Text
"Pr", Text
"sec", Text
"sin", Text
"sinh", Text
"sup",
              Text
"tan", Text
"tg", Text
"tanh", Text
"liminf", Text
"and", Text
"limsup"]
    = Text
s
  | Bool
otherwise = Text
"\"" forall a. Semigroup a => a -> a -> a
<> Text
s forall a. Semigroup a => a -> a -> a
<> Text
"\""
writeExp (EGrouped [Exp]
es) = [Exp] -> Text
writeExps [Exp]
es
writeExp (EFraction FractionType
_fractype Exp
e1 Exp
e2) =
  case (Exp
e1, Exp
e2) of
    (EGrouped [Exp]
_, Exp
_) -> Text
"frac(" forall a. Semigroup a => a -> a -> a
<> Exp -> Text
writeExp Exp
e1 forall a. Semigroup a => a -> a -> a
<> Text
", " forall a. Semigroup a => a -> a -> a
<> Exp -> Text
writeExp Exp
e2 forall a. Semigroup a => a -> a -> a
<> Text
")"
    (Exp
_, EGrouped [Exp]
_) -> Text
"frac(" forall a. Semigroup a => a -> a -> a
<> Exp -> Text
writeExp Exp
e1 forall a. Semigroup a => a -> a -> a
<> Text
", " forall a. Semigroup a => a -> a -> a
<> Exp -> Text
writeExp Exp
e2 forall a. Semigroup a => a -> a -> a
<> Text
")"
    (Exp, Exp)
_ -> Exp -> Text
writeExp Exp
e1 forall a. Semigroup a => a -> a -> a
<> Text
" / " forall a. Semigroup a => a -> a -> a
<> Exp -> Text
writeExp Exp
e2
writeExp (ESub Exp
b Exp
e1) = Exp -> Text
writeExpB Exp
b forall a. Semigroup a => a -> a -> a
<> Text
"_" forall a. Semigroup a => a -> a -> a
<> Exp -> Text
writeExpS Exp
e1
writeExp (ESuper Exp
b Exp
e1) = Exp -> Text
writeExpB Exp
b forall a. Semigroup a => a -> a -> a
<> Text
"^" forall a. Semigroup a => a -> a -> a
<> Exp -> Text
writeExpS Exp
e1
writeExp (ESubsup Exp
b Exp
e1 Exp
e2) = Exp -> Text
writeExpB Exp
b forall a. Semigroup a => a -> a -> a
<> Text
"_" forall a. Semigroup a => a -> a -> a
<> Exp -> Text
writeExpS Exp
e1 forall a. Semigroup a => a -> a -> a
<>
                                           Text
"^" forall a. Semigroup a => a -> a -> a
<> Exp -> Text
writeExpS Exp
e2
writeExp (EOver Bool
_ (EOver Bool
_ Exp
b (ESymbol TeXSymbolType
TOver Text
"\9182")) Exp
e1) =
  Text
"overbrace(" forall a. Semigroup a => a -> a -> a
<> Exp -> Text
writeExp Exp
b forall a. Semigroup a => a -> a -> a
<> Text
", " forall a. Semigroup a => a -> a -> a
<> Exp -> Text
writeExp Exp
e1 forall a. Semigroup a => a -> a -> a
<> Text
")"
writeExp (EOver Bool
_ (EOver Bool
_ Exp
b (ESymbol TeXSymbolType
TOver Text
"\9140")) Exp
e1) =
  Text
"overbracket(" forall a. Semigroup a => a -> a -> a
<> Exp -> Text
writeExp Exp
b forall a. Semigroup a => a -> a -> a
<> Text
", " forall a. Semigroup a => a -> a -> a
<> Exp -> Text
writeExp Exp
e1 forall a. Semigroup a => a -> a -> a
<> Text
")"
writeExp (EOver Bool
_ (EOver Bool
_ Exp
b (ESymbol TeXSymbolType
TOver Text
"_")) Exp
e1) =
  Text
"overline(" forall a. Semigroup a => a -> a -> a
<> Exp -> Text
writeExp Exp
b forall a. Semigroup a => a -> a -> a
<> Text
", " forall a. Semigroup a => a -> a -> a
<> Exp -> Text
writeExp Exp
e1 forall a. Semigroup a => a -> a -> a
<> Text
")"
writeExp (EOver Bool
_convertible Exp
b Exp
e1) =
  case Exp
e1 of
    ESymbol TeXSymbolType
Accent Text
"`" -> Text
"grave" forall a. Semigroup a => a -> a -> a
<> Text -> Text
inParens (Exp -> Text
writeExp Exp
b)
    ESymbol TeXSymbolType
Accent Text
"\xb4" -> Text
"acute" forall a. Semigroup a => a -> a -> a
<> Text -> Text
inParens (Exp -> Text
writeExp Exp
b)
    ESymbol TeXSymbolType
Accent Text
"^" -> Text
"hat" forall a. Semigroup a => a -> a -> a
<> Text -> Text
inParens (Exp -> Text
writeExp Exp
b)
    ESymbol TeXSymbolType
Accent Text
"~" -> Text
"tilde" forall a. Semigroup a => a -> a -> a
<> Text -> Text
inParens (Exp -> Text
writeExp Exp
b)
    ESymbol TeXSymbolType
Accent Text
"\xaf" -> Text
"macron" forall a. Semigroup a => a -> a -> a
<> Text -> Text
inParens (Exp -> Text
writeExp Exp
b)
    ESymbol TeXSymbolType
Accent Text
"\x2d8" -> Text
"breve" forall a. Semigroup a => a -> a -> a
<> Text -> Text
inParens (Exp -> Text
writeExp Exp
b)
    ESymbol TeXSymbolType
Accent Text
"." -> Text
"dot" forall a. Semigroup a => a -> a -> a
<> Text -> Text
inParens (Exp -> Text
writeExp Exp
b)
    ESymbol TeXSymbolType
Accent Text
"\xa8" -> Text
"diaer" forall a. Semigroup a => a -> a -> a
<> Text -> Text
inParens (Exp -> Text
writeExp Exp
b)
    ESymbol TeXSymbolType
Accent Text
"\x2218" -> Text
"circle" forall a. Semigroup a => a -> a -> a
<> Text -> Text
inParens (Exp -> Text
writeExp Exp
b)
    ESymbol TeXSymbolType
Accent Text
"\x2dd" -> Text
"acute.double" forall a. Semigroup a => a -> a -> a
<> Text -> Text
inParens (Exp -> Text
writeExp Exp
b)
    ESymbol TeXSymbolType
Accent Text
"\x2c7" -> Text
"caron" forall a. Semigroup a => a -> a -> a
<> Text -> Text
inParens (Exp -> Text
writeExp Exp
b)
    ESymbol TeXSymbolType
Accent Text
"\x2192" -> Text
"->" forall a. Semigroup a => a -> a -> a
<> Text -> Text
inParens (Exp -> Text
writeExp Exp
b)
    ESymbol TeXSymbolType
Accent Text
"\x2190" -> Text
"<-" forall a. Semigroup a => a -> a -> a
<> Text -> Text
inParens (Exp -> Text
writeExp Exp
b)
    ESymbol TeXSymbolType
TOver Text
"\9182" -> Text
"overbrace(" forall a. Semigroup a => a -> a -> a
<> Exp -> Text
writeExp Exp
b forall a. Semigroup a => a -> a -> a
<> Text
")"
    ESymbol TeXSymbolType
TOver Text
"\9140" -> Text
"overbracket(" forall a. Semigroup a => a -> a -> a
<> Exp -> Text
writeExp Exp
b forall a. Semigroup a => a -> a -> a
<> Text
")"
    ESymbol TeXSymbolType
TOver Text
"_" -> Text
"overline(" forall a. Semigroup a => a -> a -> a
<> Exp -> Text
writeExp Exp
b forall a. Semigroup a => a -> a -> a
<> Text
")"
    Exp
_ -> Exp -> Text
writeExpB Exp
b forall a. Semigroup a => a -> a -> a
<> Text
"^" forall a. Semigroup a => a -> a -> a
<> Exp -> Text
writeExpS Exp
e1
writeExp (EUnder Bool
_ (EUnder Bool
_ Exp
b (ESymbol TeXSymbolType
TUnder Text
"_")) Exp
e1) =
  Text
"underline(" forall a. Semigroup a => a -> a -> a
<> Exp -> Text
writeExp Exp
b forall a. Semigroup a => a -> a -> a
<> Text
", " forall a. Semigroup a => a -> a -> a
<> Exp -> Text
writeExp Exp
e1 forall a. Semigroup a => a -> a -> a
<> Text
")"
writeExp (EUnder Bool
_ (EUnder Bool
_ Exp
b (ESymbol TeXSymbolType
TUnder Text
"\9182")) Exp
e1) =
  Text
"underbrace(" forall a. Semigroup a => a -> a -> a
<> Exp -> Text
writeExp Exp
b forall a. Semigroup a => a -> a -> a
<> Text
", " forall a. Semigroup a => a -> a -> a
<> Exp -> Text
writeExp Exp
e1 forall a. Semigroup a => a -> a -> a
<> Text
")"
writeExp (EUnder Bool
_ (EUnder Bool
_ Exp
b (ESymbol TeXSymbolType
TUnder Text
"\9140")) Exp
e1) =
  Text
"underbrace(" forall a. Semigroup a => a -> a -> a
<> Exp -> Text
writeExp Exp
b forall a. Semigroup a => a -> a -> a
<> Text
", " forall a. Semigroup a => a -> a -> a
<> Exp -> Text
writeExp Exp
e1 forall a. Semigroup a => a -> a -> a
<> Text
")"
writeExp (EUnder Bool
_convertible Exp
b Exp
e1) =
  case Exp
e1 of
    ESymbol TeXSymbolType
TUnder Text
"_" -> Text
"underline(" forall a. Semigroup a => a -> a -> a
<> Exp -> Text
writeExp Exp
b forall a. Semigroup a => a -> a -> a
<> Text
")"
    ESymbol TeXSymbolType
TUnder Text
"\9182" -> Text
"underbrace(" forall a. Semigroup a => a -> a -> a
<> Exp -> Text
writeExp Exp
b forall a. Semigroup a => a -> a -> a
<> Text
")"
    ESymbol TeXSymbolType
TUnder Text
"\9140" -> Text
"underbracket(" forall a. Semigroup a => a -> a -> a
<> Exp -> Text
writeExp Exp
b forall a. Semigroup a => a -> a -> a
<> Text
")"
    Exp
_ -> Exp -> Text
writeExpB Exp
b forall a. Semigroup a => a -> a -> a
<> Text
"_" forall a. Semigroup a => a -> a -> a
<> Exp -> Text
writeExpS Exp
e1
writeExp (EUnderover Bool
convertible Exp
b Exp
e1 Exp
e2) =
  case (Exp
e1, Exp
e2) of
    (Exp
_, ESymbol TeXSymbolType
Accent Text
_) -> Exp -> Text
writeExp (Bool -> Exp -> Exp -> Exp
EUnder Bool
convertible (Bool -> Exp -> Exp -> Exp
EOver Bool
False Exp
b Exp
e2) Exp
e1)
    (Exp
_, ESymbol TeXSymbolType
TOver Text
_) -> Exp -> Text
writeExp (Bool -> Exp -> Exp -> Exp
EUnder Bool
convertible (Bool -> Exp -> Exp -> Exp
EOver Bool
False Exp
b Exp
e2) Exp
e1)
    (ESymbol TeXSymbolType
TUnder Text
_, Exp
_) -> Exp -> Text
writeExp (Bool -> Exp -> Exp -> Exp
EOver Bool
convertible (Bool -> Exp -> Exp -> Exp
EUnder Bool
False Exp
b Exp
e1) Exp
e2)
    (Exp, Exp)
_ -> Exp -> Text
writeExpB Exp
b forall a. Semigroup a => a -> a -> a
<> Text
"_" forall a. Semigroup a => a -> a -> a
<> Exp -> Text
writeExpS Exp
e1 forall a. Semigroup a => a -> a -> a
<> Text
"^" forall a. Semigroup a => a -> a -> a
<> Exp -> Text
writeExpS Exp
e2
writeExp (ESqrt Exp
e) = Text
"sqrt(" forall a. Semigroup a => a -> a -> a
<> Exp -> Text
writeExp Exp
e forall a. Semigroup a => a -> a -> a
<> Text
")"
writeExp (ERoot Exp
i Exp
e) = Text
"root(" forall a. Semigroup a => a -> a -> a
<> Exp -> Text
writeExp Exp
i forall a. Semigroup a => a -> a -> a
<> Text
", " forall a. Semigroup a => a -> a -> a
<> Exp -> Text
writeExp Exp
e forall a. Semigroup a => a -> a -> a
<> Text
")"
writeExp (ESpace Rational
width) =
  case (forall a b. (RealFrac a, Integral b) => a -> b
floor (Rational
width forall a. Num a => a -> a -> a
* Rational
18) :: Int) of
    Int
0 -> Text
"zws"
    Int
3 -> Text
"thin"
    Int
4 -> Text
"med"
    Int
6 -> Text
"thick"
    Int
18 -> Text
"quad"
    Int
n -> Text
"#h(" forall a. Semigroup a => a -> a -> a
<> forall a. Show a => a -> Text
tshow (Int
n forall a. Integral a => a -> a -> a
`div` Int
18) forall a. Semigroup a => a -> a -> a
<> Text
"em)"
writeExp (EText TextType
ttype Text
s) =
  case TextType
ttype of
       TextType
TextNormal -> Text
"upright" forall a. Semigroup a => a -> a -> a
<> Text -> Text
inParens (Text -> Text
inQuotes Text
s)
       TextType
TextItalic -> Text
"italic" forall a. Semigroup a => a -> a -> a
<> Text -> Text
inParens (Text -> Text
inQuotes Text
s)
       TextType
TextBold   -> Text
"bold" forall a. Semigroup a => a -> a -> a
<> Text -> Text
inParens (Text -> Text
inQuotes Text
s)
       TextType
TextBoldItalic -> Text
"bold" forall a. Semigroup a => a -> a -> a
<> Text -> Text
inParens (Text
"italic" forall a. Semigroup a => a -> a -> a
<> Text -> Text
inParens (Text -> Text
inQuotes Text
s))
       TextType
TextMonospace -> Text
"mono" forall a. Semigroup a => a -> a -> a
<> Text -> Text
inParens (Text -> Text
inQuotes Text
s)
       TextType
TextSansSerif -> Text
"sans" forall a. Semigroup a => a -> a -> a
<> Text -> Text
inParens (Text -> Text
inQuotes Text
s)
       TextType
TextDoubleStruck -> Text
"bb" forall a. Semigroup a => a -> a -> a
<> Text -> Text
inParens (Text -> Text
inQuotes Text
s)
       TextType
TextScript -> Text
"cal" forall a. Semigroup a => a -> a -> a
<> Text -> Text
inParens (Text -> Text
inQuotes Text
s)
       TextType
TextFraktur -> Text
"frak" forall a. Semigroup a => a -> a -> a
<> Text -> Text
inParens (Text -> Text
inQuotes Text
s)
       TextType
TextSansSerifBold -> Text
"bold" forall a. Semigroup a => a -> a -> a
<> Text -> Text
inParens (Text
"sans" forall a. Semigroup a => a -> a -> a
<> Text -> Text
inParens (Text -> Text
inQuotes Text
s))
       TextType
TextSansSerifBoldItalic -> Text
"bold" forall a. Semigroup a => a -> a -> a
<>
         Text -> Text
inParens (Text
"italic" forall a. Semigroup a => a -> a -> a
<> Text -> Text
inParens (Text
"sans" forall a. Semigroup a => a -> a -> a
<> Text -> Text
inParens (Text -> Text
inQuotes Text
s)))
       TextType
TextBoldScript -> Text
"bold" forall a. Semigroup a => a -> a -> a
<> Text -> Text
inParens (Text
"cal" forall a. Semigroup a => a -> a -> a
<> Text -> Text
inParens (Text -> Text
inQuotes Text
s))
       TextType
TextBoldFraktur -> Text
"bold" forall a. Semigroup a => a -> a -> a
<> Text -> Text
inParens (Text
"frak" forall a. Semigroup a => a -> a -> a
<> Text -> Text
inParens (Text -> Text
inQuotes Text
s))
       TextType
TextSansSerifItalic -> Text
"italic" forall a. Semigroup a => a -> a -> a
<>
          Text -> Text
inParens (Text
"sans" forall a. Semigroup a => a -> a -> a
<> Text -> Text
inParens (Text -> Text
inQuotes Text
s))
writeExp (EStyled TextType
ttype [Exp]
es) =
  let contents :: Text
contents = [Exp] -> Text
writeExps [Exp]
es
  in case TextType
ttype of
       TextType
TextNormal -> Text
"upright" forall a. Semigroup a => a -> a -> a
<> Text -> Text
inParens Text
contents
       TextType
TextItalic -> Text
"italic" forall a. Semigroup a => a -> a -> a
<> Text -> Text
inParens Text
contents
       TextType
TextBold   -> Text
"bold" forall a. Semigroup a => a -> a -> a
<> Text -> Text
inParens Text
contents
       TextType
TextBoldItalic -> Text
"bold" forall a. Semigroup a => a -> a -> a
<> Text -> Text
inParens (Text
"italic" forall a. Semigroup a => a -> a -> a
<> Text -> Text
inParens Text
contents)
       TextType
TextMonospace -> Text
"mono" forall a. Semigroup a => a -> a -> a
<> Text -> Text
inParens Text
contents
       TextType
TextSansSerif -> Text
"sans" forall a. Semigroup a => a -> a -> a
<> Text -> Text
inParens Text
contents
       TextType
TextDoubleStruck -> Text
"bb" forall a. Semigroup a => a -> a -> a
<> Text -> Text
inParens Text
contents
       TextType
TextScript -> Text
"cal" forall a. Semigroup a => a -> a -> a
<> Text -> Text
inParens Text
contents
       TextType
TextFraktur -> Text
"frak" forall a. Semigroup a => a -> a -> a
<> Text -> Text
inParens Text
contents
       TextType
TextSansSerifBold -> Text
"bold" forall a. Semigroup a => a -> a -> a
<> Text -> Text
inParens (Text
"sans" forall a. Semigroup a => a -> a -> a
<> Text -> Text
inParens Text
contents)
       TextType
TextSansSerifBoldItalic -> Text
"bold" forall a. Semigroup a => a -> a -> a
<>
         Text -> Text
inParens (Text
"italic" forall a. Semigroup a => a -> a -> a
<> Text -> Text
inParens (Text
"sans" forall a. Semigroup a => a -> a -> a
<> Text -> Text
inParens Text
contents))
       TextType
TextBoldScript -> Text
"bold" forall a. Semigroup a => a -> a -> a
<> Text -> Text
inParens (Text
"cal" forall a. Semigroup a => a -> a -> a
<> Text -> Text
inParens Text
contents)
       TextType
TextBoldFraktur -> Text
"bold" forall a. Semigroup a => a -> a -> a
<> Text -> Text
inParens (Text
"frak" forall a. Semigroup a => a -> a -> a
<> Text -> Text
inParens Text
contents)
       TextType
TextSansSerifItalic -> Text
"italic" forall a. Semigroup a => a -> a -> a
<> Text -> Text
inParens (Text
"sans" forall a. Semigroup a => a -> a -> a
<> Text -> Text
inParens Text
contents)
writeExp (EBoxed Exp
e) = Text
"#box([" forall a. Semigroup a => a -> a -> a
<> Exp -> Text
writeExp Exp
e forall a. Semigroup a => a -> a -> a
<> Text
"])"
writeExp (EPhantom Exp
e) = Text
"#hide[" forall a. Semigroup a => a -> a -> a
<> Exp -> Text
writeExp Exp
e forall a. Semigroup a => a -> a -> a
<> Text
"]"
writeExp (EScaled Rational
size Exp
e) =
  Text
"#scale(x: " forall a. Semigroup a => a -> a -> a
<> forall a. Show a => a -> Text
tshow (forall a b. (RealFrac a, Integral b) => a -> b
floor (Rational
100 forall a. Num a => a -> a -> a
* Rational
size) :: Int) forall a. Semigroup a => a -> a -> a
<>
          Text
"%, y: " forall a. Semigroup a => a -> a -> a
<> forall a. Show a => a -> Text
tshow (forall a b. (RealFrac a, Integral b) => a -> b
floor (Rational
100 forall a. Num a => a -> a -> a
* Rational
size) :: Int) forall a. Semigroup a => a -> a -> a
<>
          Text
"%)[" forall a. Semigroup a => a -> a -> a
<> Exp -> Text
writeExp Exp
e forall a. Semigroup a => a -> a -> a
<> Text
"]"
writeExp (EDelimited Text
"(" Text
")" [Right (EArray [Alignment]
_aligns [ArrayLine]
rows)])
  | forall (t :: * -> *) a. Foldable t => (a -> Bool) -> t a -> Bool
all (\ArrayLine
row -> forall (t :: * -> *) a. Foldable t => t a -> Int
length ArrayLine
row forall a. Eq a => a -> a -> Bool
== Int
1) [ArrayLine]
rows = -- vector
  Text
"vec(" forall a. Semigroup a => a -> a -> a
<> [ArrayLine] -> Text
mkArray (forall a. [[a]] -> [[a]]
transpose [ArrayLine]
rows) forall a. Semigroup a => a -> a -> a
<> Text
")"
writeExp (EDelimited Text
"(" Text
")" [Right (EArray [Alignment]
_aligns [[[Exp]
xs],[[Exp]
ys]])]) =
  Text
"binom(" forall a. Semigroup a => a -> a -> a
<> [Exp] -> Text
writeExps [Exp]
xs forall a. Semigroup a => a -> a -> a
<> Text
", " forall a. Semigroup a => a -> a -> a
<> [Exp] -> Text
writeExps [Exp]
ys forall a. Semigroup a => a -> a -> a
<> Text
")"
writeExp (EDelimited Text
"(" Text
")" [Right (EArray [Alignment]
_aligns [ArrayLine]
rows)]) =
  Text
"mat(delim: \"(\", " forall a. Semigroup a => a -> a -> a
<> [ArrayLine] -> Text
mkArray [ArrayLine]
rows forall a. Semigroup a => a -> a -> a
<> Text
")"
writeExp (EDelimited Text
"[" Text
"]" [Right (EArray [Alignment]
_aligns [ArrayLine]
rows)]) =
  Text
"mat(delim: \"[\", " forall a. Semigroup a => a -> a -> a
<> [ArrayLine] -> Text
mkArray [ArrayLine]
rows forall a. Semigroup a => a -> a -> a
<> Text
")"
writeExp (EDelimited Text
"{" Text
"}" [Right (EArray [Alignment]
_aligns [ArrayLine]
rows)]) =
  Text
"mat(delim: \"{\", " forall a. Semigroup a => a -> a -> a
<> [ArrayLine] -> Text
mkArray [ArrayLine]
rows forall a. Semigroup a => a -> a -> a
<> Text
")"
writeExp (EDelimited Text
"|" Text
"|" [Right (EArray [Alignment]
_aligns [ArrayLine]
rows)]) =
  Text
"mat(delim: \"|\", " forall a. Semigroup a => a -> a -> a
<> [ArrayLine] -> Text
mkArray [ArrayLine]
rows forall a. Semigroup a => a -> a -> a
<> Text
")"
writeExp (EDelimited Text
"||" Text
"||" [Right (EArray [Alignment]
_aligns [ArrayLine]
rows)]) =
  Text
"mat(delim: \"||\", " forall a. Semigroup a => a -> a -> a
<> [ArrayLine] -> Text
mkArray [ArrayLine]
rows forall a. Semigroup a => a -> a -> a
<> Text
")"
writeExp (EDelimited Text
"\x2223" Text
"\x2223" [Right (EArray [Alignment]
_aligns [ArrayLine]
rows)]) =
  Text
"mat(delim: \"||\", " forall a. Semigroup a => a -> a -> a
<> [ArrayLine] -> Text
mkArray [ArrayLine]
rows forall a. Semigroup a => a -> a -> a
<> Text
")"
writeExp (EDelimited Text
"\x2225" Text
"\x2225" [Right (EArray [Alignment]
_aligns [ArrayLine]
rows)]) =
  Text
"mat(delim: \"||\", " forall a. Semigroup a => a -> a -> a
<> [ArrayLine] -> Text
mkArray [ArrayLine]
rows forall a. Semigroup a => a -> a -> a
<> Text
")"
writeExp (EDelimited Text
op Text
"" [Right (EArray [Alignment
AlignLeft, Alignment
AlignLeft] [ArrayLine]
rows)]) =
  Text
"cases" forall a. Semigroup a => a -> a -> a
<> Text -> Text
inParens(Text
"delim: " forall a. Semigroup a => a -> a -> a
<> Text -> Text
inQuotes Text
op forall a. Semigroup a => a -> a -> a
<> forall a. Monoid a => [a] -> a
mconcat (forall a b. (a -> b) -> [a] -> [b]
map ArrayLine -> Text
toCase [ArrayLine]
rows))
   where toCase :: ArrayLine -> Text
toCase = (Text
", " forall a. Semigroup a => a -> a -> a
<>) forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> [Text] -> Text
T.intercalate Text
" & " forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a -> b) -> [a] -> [b]
map [Exp] -> Text
writeExps
writeExp (EDelimited Text
open Text
close [InEDelimited]
es) =
  if forall {a}. (Eq a, IsString a) => a -> Bool
isDelim Text
open Bool -> Bool -> Bool
&& forall {a}. (Eq a, IsString a) => a -> Bool
isDelim Text
close
     then Text
"lr" forall a. Semigroup a => a -> a -> a
<> Text -> Text
inParens (Text
open forall a. Semigroup a => a -> a -> a
<> Text
body forall a. Semigroup a => a -> a -> a
<> Text
close)
     else Text -> Text
esc Text
open forall a. Semigroup a => a -> a -> a
<> Text
body forall a. Semigroup a => a -> a -> a
<> Text -> Text
esc Text
close
  where fromDelimited :: InEDelimited -> Text
fromDelimited (Left Text
e)  = Text
e
        fromDelimited (Right Exp
e) = Exp -> Text
writeExp Exp
e
        isDelim :: a -> Bool
isDelim a
c = a
c forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
`elem` [a
"(",a
")",a
"[",a
"]",a
"{",a
"}",a
"|",a
"||"]
        body :: Text
body = [Text] -> Text
T.unwords (forall a b. (a -> b) -> [a] -> [b]
map InEDelimited -> Text
fromDelimited [InEDelimited]
es)
writeExp (EArray [Alignment]
_aligns [ArrayLine]
rows)
  = Text -> [Text] -> Text
T.intercalate Text
"\\\n" forall a b. (a -> b) -> a -> b
$ forall a b. (a -> b) -> [a] -> [b]
map ArrayLine -> Text
mkRow [ArrayLine]
rows
     where mkRow :: ArrayLine -> Text
mkRow = Text -> [Text] -> Text
T.intercalate Text
" & " forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a -> b) -> [a] -> [b]
map [Exp] -> Text
writeExps

mkArray :: [[[Exp]]] -> Text
mkArray :: [ArrayLine] -> Text
mkArray [ArrayLine]
rows =
  Text -> [Text] -> Text
T.intercalate Text
"; " forall a b. (a -> b) -> a -> b
$ forall a b. (a -> b) -> [a] -> [b]
map ArrayLine -> Text
mkRow [ArrayLine]
rows
 where
   mkRow :: ArrayLine -> Text
mkRow = Text -> [Text] -> Text
T.intercalate Text
", " forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a -> b) -> [a] -> [b]
map [Exp] -> Text
mkCell
   mkCell :: [Exp] -> Text
mkCell = [Exp] -> Text
writeExps

tshow :: Show a => a -> Text
tshow :: forall a. Show a => a -> Text
tshow = String -> Text
T.pack forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Show a => a -> String
show

typstSymbols :: M.Map Text Text
typstSymbols :: Map Text Text
typstSymbols = forall k a. Ord k => [(k, a)] -> Map k a
M.fromList
  [ (Text
"\x1d538",Text
"AA")
  , (Text
"\x391",Text
"Alpha")
  , (Text
"\x1d539",Text
"BB")
  , (Text
"\x392",Text
"Beta")
  , (Text
"\x2102",Text
"CC")
  , (Text
"\x3A7",Text
"Chi")
  , (Text
"\x1d53b",Text
"DD")
  , (Text
"\x394",Text
"Delta")
  , (Text
"\x1d53c",Text
"EE")
  , (Text
"\x395",Text
"Epsilon")
  , (Text
"\x397",Text
"Eta")
  , (Text
"\x1d53d",Text
"FF")
  , (Text
"\x1d53e",Text
"GG")
  , (Text
"\x393",Text
"Gamma")
  , (Text
"\x210d",Text
"HH")
  , (Text
"\x1d540",Text
"II")
  , (Text
"\x2111",Text
"Im")
  , (Text
"\x399",Text
"Iota")
  , (Text
"\x1d541",Text
"JJ")
  , (Text
"\x1d542",Text
"KK")
  , (Text
"\x3CF",Text
"Kai")
  , (Text
"\x39A",Text
"Kappa")
  , (Text
"\x1d543",Text
"LL")
  , (Text
"\x39B",Text
"Lambda")
  , (Text
"\x1d544",Text
"MM")
  , (Text
"\x39C",Text
"Mu")
  , (Text
"\x2115",Text
"NN")
  , (Text
"\x39D",Text
"Nu")
  , (Text
"\x1d546",Text
"OO")
  , (Text
"\x3A9",Text
"Omega")
  , (Text
"\x39F",Text
"Omicron")
  , (Text
"\x2119",Text
"PP")
  , (Text
"\x3A6",Text
"Phi")
  , (Text
"\x3A0",Text
"Pi")
  , (Text
"\x3A8",Text
"Psi")
  , (Text
"\x211a",Text
"QQ")
  , (Text
"\x211d",Text
"RR")
  , (Text
"\x211c",Text
"Re")
  , (Text
"\x3A1",Text
"Rho")
  , (Text
"\x1d54a",Text
"SS")
  , (Text
"\x3A3",Text
"Sigma")
  , (Text
"\x1d54b",Text
"TT")
  , (Text
"\x3A4",Text
"Tau")
  , (Text
"\x398",Text
"Theta")
  , (Text
"\x1d54c",Text
"UU")
  , (Text
"\x3A5",Text
"Upsilon")
  , (Text
"\x1d54d",Text
"VV")
  , (Text
"\x1d54e",Text
"WW")
  , (Text
"\x1d54f",Text
"XX")
  , (Text
"\x39E",Text
"Xi")
  , (Text
"\x1d550",Text
"YY")
  , (Text
"\x2124",Text
"ZZ")
  , (Text
"\x396",Text
"Zeta")
  , (Text
"\xb4",Text
"acute")
  , (Text
"\x2dd",Text
"acute.double")
  , (Text
"\x5d0",Text
"alef")
  , (Text
"\x3b1",Text
"alpha")
  , (Text
"&",Text
"amp")
  , (Text
"\x214b",Text
"amp.inv")
  , (Text
"\x2227",Text
"and")
  , (Text
"\x22c0",Text
"and.big")
  , (Text
"\x22cf",Text
"and.curly")
  , (Text
"\x27d1",Text
"and.dot")
  , (Text
"\x2a53",Text
"and.double")
  , (Text
"\x2220",Text
"angle")
  , (Text
"\x2329",Text
"angle.l")
  , (Text
"\x232a",Text
"angle.r")
  , (Text
"\x300a",Text
"angle.l.double")
  , (Text
"\x300b",Text
"angle.r.double")
  , (Text
"\x299f",Text
"angle.acute")
  , (Text
"\x2221",Text
"angle.arc")
  , (Text
"\x299b",Text
"angle.arc.rev")
  , (Text
"\x29a3",Text
"angle.rev")
  , (Text
"\x221f",Text
"angle.right")
  , (Text
"\11262",Text
"angle.right.rev")
  , (Text
"\x22be",Text
"angle.right.arc")
  , (Text
"\x299d",Text
"angle.right.dot")
  , (Text
"\x299c",Text
"angle.right.sq")
  , (Text
"\x27c0",Text
"angle.spatial")
  , (Text
"\x2222",Text
"angle.spheric")
  , (Text
"\x29a0",Text
"angle.spheric.rev")
  , (Text
"\x29a1",Text
"angle.spheric.top")
  , (Text
"\x212B",Text
"angstrom")
  , (Text
"\x2248",Text
"approx")
  , (Text
"\x224a",Text
"approx.eq")
  , (Text
"\x2249",Text
"approx.not")
  , (Text
"\x2192",Text
"arrow.r")
  , (Text
"\x27fc",Text
"arrow.r.long.bar")
  , (Text
"\x21a6",Text
"arrow.r.bar")
  , (Text
"\x2937",Text
"arrow.r.curve")
  , (Text
"\x21e2",Text
"arrow.r.dashed")
  , (Text
"\x2911",Text
"arrow.r.dotted")
  , (Text
"\x21d2",Text
"arrow.r.double")
  , (Text
"\x2907",Text
"arrow.r.double.bar")
  , (Text
"\x27f9",Text
"arrow.r.double.long")
  , (Text
"\x27fe",Text
"arrow.r.double.long.bar")
  , (Text
"\x21cf",Text
"arrow.r.double.not")
  , (Text
"\x27a1",Text
"arrow.r.filled")
  , (Text
"\x21aa",Text
"arrow.r.hook")
  , (Text
"\x27f6",Text
"arrow.r.long")
  , (Text
"\x27ff",Text
"arrow.r.long.squiggly")
  , (Text
"\x21ac",Text
"arrow.r.loop")
  , (Text
"\x219b",Text
"arrow.r.not")
  , (Text
"\x2b46",Text
"arrow.r.quad")
  , (Text
"\x21dd",Text
"arrow.r.squiggly")
  , (Text
"\x21e5",Text
"arrow.r.stop")
  , (Text
"\x21e8",Text
"arrow.r.stroked")
  , (Text
"\x21a3",Text
"arrow.r.tail")
  , (Text
"\x21db",Text
"arrow.r.triple")
  , (Text
"\x2905",Text
"arrow.r.twohead.bar")
  , (Text
"\x21a0",Text
"arrow.r.twohead")
  , (Text
"\x219d",Text
"arrow.r.wave")
  , (Text
"\x2190",Text
"arrow.l")
  , (Text
"\x21a4",Text
"arrow.l.bar")
  , (Text
"\x2936",Text
"arrow.l.curve")
  , (Text
"\x21e0",Text
"arrow.l.dashed")
  , (Text
"\x2b38",Text
"arrow.l.dotted")
  , (Text
"\x21d0",Text
"arrow.l.double")
  , (Text
"\x2906",Text
"arrow.l.double.bar")
  , (Text
"\x27f8",Text
"arrow.l.double.long")
  , (Text
"\x27fd",Text
"arrow.l.double.long.bar")
  , (Text
"\x21cd",Text
"arrow.l.double.not")
  , (Text
"\x2b05",Text
"arrow.l.filled")
  , (Text
"\x21a9",Text
"arrow.l.hook")
  , (Text
"\x27f5",Text
"arrow.l.long")
  , (Text
"\x27fb",Text
"arrow.l.long.bar")
  , (Text
"\x2b33",Text
"arrow.l.long.squiggly")
  , (Text
"\x21ab",Text
"arrow.l.loop")
  , (Text
"\x219a",Text
"arrow.l.not")
  , (Text
"\x2b45",Text
"arrow.l.quad")
  , (Text
"\x21dc",Text
"arrow.l.squiggly")
  , (Text
"\x21e4",Text
"arrow.l.stop")
  , (Text
"\x21e6",Text
"arrow.l.stroked")
  , (Text
"\x21a2",Text
"arrow.l.tail")
  , (Text
"\x21da",Text
"arrow.l.triple")
  , (Text
"\x2b36",Text
"arrow.l.twohead.bar")
  , (Text
"\x219e",Text
"arrow.l.twohead")
  , (Text
"\x219c",Text
"arrow.l.wave")
  , (Text
"\x2191",Text
"arrow.t")
  , (Text
"\x21a5",Text
"arrow.t.bar")
  , (Text
"\x2934",Text
"arrow.t.curve")
  , (Text
"\x21e1",Text
"arrow.t.dashed")
  , (Text
"\x21d1",Text
"arrow.t.double")
  , (Text
"\x2b06",Text
"arrow.t.filled")
  , (Text
"\x27f0",Text
"arrow.t.quad")
  , (Text
"\x2912",Text
"arrow.t.stop")
  , (Text
"\x21e7",Text
"arrow.t.stroked")
  , (Text
"\x290a",Text
"arrow.t.triple")
  , (Text
"\x219f",Text
"arrow.t.twohead")
  , (Text
"\x2193",Text
"arrow.b")
  , (Text
"\x21a7",Text
"arrow.b.bar")
  , (Text
"\x2935",Text
"arrow.b.curve")
  , (Text
"\x21e3",Text
"arrow.b.dashed")
  , (Text
"\x21d3",Text
"arrow.b.double")
  , (Text
"\x2b07",Text
"arrow.b.filled")
  , (Text
"\x27f1",Text
"arrow.b.quad")
  , (Text
"\x2913",Text
"arrow.b.stop")
  , (Text
"\x21e9",Text
"arrow.b.stroked")
  , (Text
"\x290b",Text
"arrow.b.triple")
  , (Text
"\x21a1",Text
"arrow.b.twohead")
  , (Text
"\x2194",Text
"arrow.l.r")
  , (Text
"\x21d4",Text
"arrow.l.r.double")
  , (Text
"\x27fa",Text
"arrow.l.r.double.long")
  , (Text
"\x21ce",Text
"arrow.l.r.double.not")
  , (Text
"\x2b0c",Text
"arrow.l.r.filled")
  , (Text
"\x27f7",Text
"arrow.l.r.long")
  , (Text
"\x21ae",Text
"arrow.l.r.not")
  , (Text
"\x2b04",Text
"arrow.l.r.stroked")
  , (Text
"\x21ad",Text
"arrow.l.r.wave")
  , (Text
"\x2195",Text
"arrow.t.b")
  , (Text
"\x21d5",Text
"arrow.t.b.double")
  , (Text
"\x2b0d",Text
"arrow.t.b.filled")
  , (Text
"\x21f3",Text
"arrow.t.b.stroked")
  , (Text
"\x2197",Text
"arrow.tr")
  , (Text
"\x21d7",Text
"arrow.tr.double")
  , (Text
"\x2b08",Text
"arrow.tr.filled")
  , (Text
"\x2924",Text
"arrow.tr.hook")
  , (Text
"\x2b00",Text
"arrow.tr.stroked")
  , (Text
"\x2198",Text
"arrow.br")
  , (Text
"\x21d8",Text
"arrow.br.double")
  , (Text
"\x2b0a",Text
"arrow.br.filled")
  , (Text
"\x2925",Text
"arrow.br.hook")
  , (Text
"\x2b02",Text
"arrow.br.stroked")
  , (Text
"\x2196",Text
"arrow.tl")
  , (Text
"\x21d6",Text
"arrow.tl.double")
  , (Text
"\x2b09",Text
"arrow.tl.filled")
  , (Text
"\x2923",Text
"arrow.tl.hook")
  , (Text
"\x2b01",Text
"arrow.tl.stroked")
  , (Text
"\x2199",Text
"arrow.bl")
  , (Text
"\x21d9",Text
"arrow.bl.double")
  , (Text
"\x2b0b",Text
"arrow.bl.filled")
  , (Text
"\x2926",Text
"arrow.bl.hook")
  , (Text
"\x2b03",Text
"arrow.bl.stroked")
  , (Text
"\x2921",Text
"arrow.tl.br")
  , (Text
"\x2922",Text
"arrow.tr.bl")
  , (Text
"\x21ba",Text
"arrow.ccw")
  , (Text
"\x21b6",Text
"arrow.ccw.half")
  , (Text
"\x21bb",Text
"arrow.cw")
  , (Text
"\x21b7",Text
"arrow.cw.half")
  , (Text
"\x21af",Text
"arrow.zigzag")
  , (Text
"\x2303",Text
"arrowhead.t")
  , (Text
"\x2304",Text
"arrowhead.b")
  , (Text
"\x21c9",Text
"arrows.rr")
  , (Text
"\x21c7",Text
"arrows.ll")
  , (Text
"\x21c8",Text
"arrows.tt")
  , (Text
"\x21ca",Text
"arrows.bb")
  , (Text
"\x21c6",Text
"arrows.lr")
  , (Text
"\x21b9",Text
"arrows.lr.stop")
  , (Text
"\x21c4",Text
"arrows.rl")
  , (Text
"\x21c5",Text
"arrows.tb")
  , (Text
"\x21f5",Text
"arrows.bt")
  , (Text
"\x21f6",Text
"arrows.rrr")
  , (Text
"\x2b31",Text
"arrows.lll")
  , (Text
"*",Text
"ast")
  , (Text
"\x204e",Text
"ast.low")
  , (Text
"\x2051",Text
"ast.double")
  , (Text
"\x2042",Text
"ast.triple")
  , (Text
"\xfe61",Text
"ast.small")
  , (Text
"\x2217",Text
"ast.op")
  , (Text
"\x229b",Text
"ast.circle")
  , (Text
"\x29c6",Text
"ast.sq")
  , (Text
"@",Text
"at")
  , (Text
"\\",Text
"backslash")
  , (Text
"\x29b8",Text
"backslash.circle")
  , (Text
"\x29f7",Text
"backslash.not")
  , (Text
"\x2610",Text
"ballot")
  , (Text
"\x2612",Text
"ballot.x")
  , (Text
"|",Text
"bar.v")
  , (Text
"\x2016",Text
"bar.v.double")
  , (Text
"\x2980",Text
"bar.v.triple")
  , (Text
"\xa6",Text
"bar.v.broken")
  , (Text
"\x29b6",Text
"bar.v.circle")
  , (Text
"\x2015",Text
"bar.h")
  , (Text
"\x2235",Text
"because")
  , (Text
"\x5d1",Text
"bet")
  , (Text
"\x3b2",Text
"beta")
  , (Text
"\x3d0",Text
"beta.alt")
  , (Text
"\x20bf",Text
"bitcoin")
  , (Text
"\x22a5",Text
"bot")
  , (Text
"{",Text
"brace.l")
  , (Text
"}",Text
"brace.r")
  , (Text
"\x23de",Text
"brace.t")
  , (Text
"\x23df",Text
"brace.b")
  , (Text
"[",Text
"bracket.l")
  , (Text
"]",Text
"bracket.r")
  , (Text
"\x23b4",Text
"bracket.t")
  , (Text
"\x23b5",Text
"bracket.b")
  , (Text
"\x2d8",Text
"breve")
  , (Text
"\x2038",Text
"caret")
  , (Text
"\x2c7",Text
"caron")
  , (Text
"\x2713",Text
"checkmark")
  , (Text
"\x1f5f8",Text
"checkmark.light")
  , (Text
"\x3c7",Text
"chi")
  , (Text
"\x25cb",Text
"circle.stroked")
  , (Text
"\x2218",Text
"circle.stroked.tiny")
  , (Text
"\x26ac",Text
"circle.stroked.small")
  , (Text
"\x25ef",Text
"circle.stroked.big")
  , (Text
"\x25cf",Text
"circle.filled")
  , (Text
"\x2981",Text
"circle.filled.tiny")
  , (Text
"\x2219",Text
"circle.filled.small")
  , (Text
"\x2b24",Text
"circle.filled.big")
  , (Text
"\x25cc",Text
"circle.dotted")
  , (Text
"\x229a",Text
"circle.nested")
  , (Text
"\x2105",Text
"co")
  , (Text
":",Text
"colon")
  , (Text
"\x2254",Text
"colon.eq")
  , (Text
"\x2a74",Text
"colon.double.eq")
  , (Text
",",Text
"comma")
  , (Text
"\x2201",Text
"complement")
  , (Text
"\x2218",Text
"compose")
  , (Text
"\x2217",Text
"convolve")
  , (Text
"\xa9",Text
"copyright")
  , (Text
"\x2117",Text
"copyright.sound")
  , (Text
"\x2020",Text
"dagger")
  , (Text
"\x2021",Text
"dagger.double")
  , (Text
"\x2013",Text
"dash.en")
  , (Text
"\x2014",Text
"dash.em")
  , (Text
"\x2012",Text
"dash.fig")
  , (Text
"\x301c",Text
"dash.wave")
  , (Text
"\x2239",Text
"dash.colon")
  , (Text
"\x229d",Text
"dash.circle")
  , (Text
"\x3030",Text
"dash.wave.double")
  , (Text
"\xb0",Text
"degree")
  , (Text
"\x2103",Text
"degree.c")
  , (Text
"\x2109",Text
"degree.f")
  , (Text
"\x3b4",Text
"delta")
  , (Text
"\xa8",Text
"diaer")
  , (Text
"\x2300",Text
"diameter")
  , (Text
"\x25c7",Text
"diamond.stroked")
  , (Text
"\x22c4",Text
"diamond.stroked.small")
  , (Text
"\x2b26",Text
"diamond.stroked.medium")
  , (Text
"\x27d0",Text
"diamond.stroked.dot")
  , (Text
"\x25c6",Text
"diamond.filled")
  , (Text
"\x2b25",Text
"diamond.filled.medium")
  , (Text
"\x2b29",Text
"diamond.filled.small")
  , (Text
"\x2202",Text
"diff")
  , (Text
"\xf7",Text
"div")
  , (Text
"\x2a38",Text
"div.circle")
  , (Text
"\x2223",Text
"divides")
  , (Text
"\x2224",Text
"divides.not")
  , (Text
"$",Text
"dollar")
  , (Text
".",Text
"dot")
  , (Text
"\x22c5",Text
"dot.op")
  , (Text
"\xb7",Text
"dot.c")
  , (Text
"\x2299",Text
"dot.circle")
  , (Text
"\x2a00",Text
"dot.circle.big")
  , (Text
"\x22a1",Text
"dot.square")
  , (Text
"\x2026",Text
"dots.h")
  , (Text
"\x22ef",Text
"dots.h.c")
  , (Text
"\x22ee",Text
"dots.v")
  , (Text
"\x22f1",Text
"dots.down")
  , (Text
"\x22f0",Text
"dots.up")
  , (Text
"\x2113",Text
"ell")
  , (Text
"\x2b2d",Text
"ellipse.stroked.h")
  , (Text
"\x2b2f",Text
"ellipse.stroked.v")
  , (Text
"\x2b2c",Text
"ellipse.filled.h")
  , (Text
"\x2b2e",Text
"ellipse.filled.v")
  , (Text
"\x3b5",Text
"epsilon")
  , (Text
"\x3f5",Text
"epsilon.alt")
  , (Text
"=",Text
"eq")
  , (Text
"\x225b",Text
"eq.star")
  , (Text
"\x229c",Text
"eq.circle")
  , (Text
"\x2255",Text
"eq.colon")
  , (Text
"\x225d",Text
"eq.def")
  , (Text
"\x225c",Text
"eq.delta")
  , (Text
"\x225a",Text
"eq.equi")
  , (Text
"\x2259",Text
"eq.est")
  , (Text
"\x22dd",Text
"eq.gt")
  , (Text
"\x22dc",Text
"eq.lt")
  , (Text
"\x225e",Text
"eq.m")
  , (Text
"\x2260",Text
"eq.not")
  , (Text
"\x22de",Text
"eq.prec")
  , (Text
"\x225f",Text
"eq.quest")
  , (Text
"\xfe66",Text
"eq.small")
  , (Text
"\x22df",Text
"eq.succ")
  , (Text
"\x3b7",Text
"eta")
  , (Text
"\x20ac",Text
"euro")
  , (Text
"!",Text
"excl")
  , (Text
"\x203c",Text
"excl.double")
  , (Text
"\xa1",Text
"excl.inv")
  , (Text
"\x2049",Text
"excl.quest")
  , (Text
"\x2203",Text
"exists")
  , (Text
"\x2204",Text
"exists.not")
  , (Text
"\x29d8",Text
"fence.l")
  , (Text
"\x29da",Text
"fence.l.double")
  , (Text
"\x29d9",Text
"fence.r")
  , (Text
"\x29db",Text
"fence.r.double")
  , (Text
"\x2999",Text
"fence.dotted")
  , (Text
"\x2766",Text
"floral")
  , (Text
"\x2619",Text
"floral.l")
  , (Text
"\x2767",Text
"floral.r")
  , (Text
"\x2200",Text
"forall")
  , (Text
"\x20a3",Text
"franc")
  , (Text
"\x3b3",Text
"gamma")
  , (Text
"\x5d2",Text
"gimel")
  , (Text
"`",Text
"grave")
  , (Text
">",Text
"gt")
  , (Text
"\x29c1",Text
"gt.circle")
  , (Text
"\x22d7",Text
"gt.dot")
  , (Text
"\x226b",Text
"gt.double")
  , (Text
"\x2265",Text
"gt.eq")
  , (Text
"\x22db",Text
"gt.eq.lt")
  , (Text
"\x2271",Text
"gt.eq.not")
  , (Text
"\x2267",Text
"gt.eqq")
  , (Text
"\x2277",Text
"gt.lt")
  , (Text
"\x2279",Text
"gt.lt.not")
  , (Text
"\x2269",Text
"gt.neqq")
  , (Text
"\x226f",Text
"gt.not")
  , (Text
"\x22e7",Text
"gt.ntilde")
  , (Text
"\xfe65",Text
"gt.small")
  , (Text
"\x2273",Text
"gt.tilde")
  , (Text
"\x2275",Text
"gt.tilde.not")
  , (Text
"\x22d9",Text
"gt.triple")
  , (Text
"\x2af8",Text
"gt.triple.nested")
  , (Text
"\x21c0",Text
"harpoon.rt")
  , (Text
"\x295b",Text
"harpoon.rt.bar")
  , (Text
"\x2953",Text
"harpoon.rt.stop")
  , (Text
"\x21c1",Text
"harpoon.rb")
  , (Text
"\x295f",Text
"harpoon.rb.bar")
  , (Text
"\x2957",Text
"harpoon.rb.stop")
  , (Text
"\x21bc",Text
"harpoon.lt")
  , (Text
"\x295a",Text
"harpoon.lt.bar")
  , (Text
"\x2952",Text
"harpoon.lt.stop")
  , (Text
"\x21bd",Text
"harpoon.lb")
  , (Text
"\x295e",Text
"harpoon.lb.bar")
  , (Text
"\x2956",Text
"harpoon.lb.stop")
  , (Text
"\x21bf",Text
"harpoon.tl")
  , (Text
"\x2960",Text
"harpoon.tl.bar")
  , (Text
"\x2958",Text
"harpoon.tl.stop")
  , (Text
"\x21be",Text
"harpoon.tr")
  , (Text
"\x295c",Text
"harpoon.tr.bar")
  , (Text
"\x2954",Text
"harpoon.tr.stop")
  , (Text
"\x21c3",Text
"harpoon.bl")
  , (Text
"\x2961",Text
"harpoon.bl.bar")
  , (Text
"\x2959",Text
"harpoon.bl.stop")
  , (Text
"\x21c2",Text
"harpoon.br")
  , (Text
"\x295d",Text
"harpoon.br.bar")
  , (Text
"\x2955",Text
"harpoon.br.stop")
  , (Text
"\x294e",Text
"harpoon.lt.rt")
  , (Text
"\x2950",Text
"harpoon.lb.rb")
  , (Text
"\x294b",Text
"harpoon.lb.rt")
  , (Text
"\x294a",Text
"harpoon.lt.rb")
  , (Text
"\x2951",Text
"harpoon.tl.bl")
  , (Text
"\x294f",Text
"harpoon.tr.br")
  , (Text
"\x294d",Text
"harpoon.tl.br")
  , (Text
"\x294c",Text
"harpoon.tr.bl")
  , (Text
"\x2964",Text
"harpoons.rtrb")
  , (Text
"\x2965",Text
"harpoons.blbr")
  , (Text
"\x296f",Text
"harpoons.bltr")
  , (Text
"\x2967",Text
"harpoons.lbrb")
  , (Text
"\x2962",Text
"harpoons.ltlb")
  , (Text
"\x21cb",Text
"harpoons.ltrb")
  , (Text
"\x2966",Text
"harpoons.ltrt")
  , (Text
"\x2969",Text
"harpoons.rblb")
  , (Text
"\x21cc",Text
"harpoons.rtlb")
  , (Text
"\x2968",Text
"harpoons.rtlt")
  , (Text
"\x296e",Text
"harpoons.tlbr")
  , (Text
"\x2963",Text
"harpoons.tltr")
  , (Text
"#",Text
"hash")
  , (Text
"^",Text
"hat")
  , (Text
"\x2b21",Text
"hexa.stroked")
  , (Text
"\x2b22",Text
"hexa.filled")
  , (Text
"\x2010",Text
"hyph")
  , (Text
"-",Text
"hyph.minus")
  , (Text
"\x2011",Text
"hyph.nobreak")
  , (Text
"\x2027",Text
"hyph.point")
  , (Text
"\173",Text
"hyph.soft")
  , (Text
"\x2261",Text
"ident")
  , (Text
"\x2262",Text
"ident.not")
  , (Text
"\x2263",Text
"ident.strict")
  , (Text
"\x2208",Text
"in")
  , (Text
"\x2209",Text
"in.not")
  , (Text
"\x220b",Text
"in.rev")
  , (Text
"\x220c",Text
"in.rev.not")
  , (Text
"\x220d",Text
"in.rev.small")
  , (Text
"\x220a",Text
"in.small")
  , (Text
"\x221e",Text
"infinity")
  , (Text
"\x222b",Text
"integral")
  , (Text
"\x2a17",Text
"integral.arrow.hook")
  , (Text
"\x2a11",Text
"integral.ccw")
  , (Text
"\x222e",Text
"integral.cont")
  , (Text
"\x2233",Text
"integral.cont.ccw")
  , (Text
"\x2232",Text
"integral.cont.cw")
  , (Text
"\x2231",Text
"integral.cw")
  , (Text
"\x222c",Text
"integral.double")
  , (Text
"\x2a0c",Text
"integral.quad")
  , (Text
"\x2a19",Text
"integral.sect")
  , (Text
"\x2a16",Text
"integral.sq")
  , (Text
"\x222f",Text
"integral.surf")
  , (Text
"\x2a18",Text
"integral.times")
  , (Text
"\x222d",Text
"integral.triple")
  , (Text
"\x2a1a",Text
"integral.union")
  , (Text
"\x2230",Text
"integral.vol")
  , (Text
"\x203d",Text
"interrobang")
  , (Text
"\x3b9",Text
"iota")
  , (Text
"\x2a1d",Text
"join")
  , (Text
"\x27d6",Text
"join.r")
  , (Text
"\x27d5",Text
"join.l")
  , (Text
"\x27d7",Text
"join.l.r")
  , (Text
"\x3d7",Text
"kai")
  , (Text
"\x3ba",Text
"kappa")
  , (Text
"\x3f0",Text
"kappa.alt")
  , (Text
"\x212a",Text
"kelvin")
  , (Text
"\x3bb",Text
"lambda")
  , (Text
"\x20ba",Text
"lira")
  , (Text
"\x25ca",Text
"lozenge.stroked")
  , (Text
"\x2b2b",Text
"lozenge.stroked.small")
  , (Text
"\x2b28",Text
"lozenge.stroked.medium")
  , (Text
"\x29eb",Text
"lozenge.filled")
  , (Text
"\x2b2a",Text
"lozenge.filled.small")
  , (Text
"\x2b27",Text
"lozenge.filled.medium")
  , (Text
"<",Text
"lt")
  , (Text
"\x29c0",Text
"lt.circle")
  , (Text
"\x22d6",Text
"lt.dot")
  , (Text
"\x226a",Text
"lt.double")
  , (Text
"\x2264",Text
"lt.eq")
  , (Text
"\x22da",Text
"lt.eq.gt")
  , (Text
"\x2270",Text
"lt.eq.not")
  , (Text
"\x2266",Text
"lt.eqq")
  , (Text
"\x2276",Text
"lt.gt")
  , (Text
"\x2278",Text
"lt.gt.not")
  , (Text
"\x2268",Text
"lt.neqq")
  , (Text
"\x226e",Text
"lt.not")
  , (Text
"\x22e6",Text
"lt.ntilde")
  , (Text
"\xfe64",Text
"lt.small")
  , (Text
"\x2272",Text
"lt.tilde")
  , (Text
"\x2274",Text
"lt.tilde.not")
  , (Text
"\x22d8",Text
"lt.triple")
  , (Text
"\x2af7",Text
"lt.triple.nested")
  , (Text
"\xaf",Text
"macron")
  , (Text
"\x2720",Text
"maltese")
  , (Text
"\x2212",Text
"minus")
  , (Text
"\x2296",Text
"minus.circle")
  , (Text
"\x2238",Text
"minus.dot")
  , (Text
"\x2213",Text
"minus.plus")
  , (Text
"\x229f",Text
"minus.square")
  , (Text
"\x2242",Text
"minus.tilde")
  , (Text
"\x2a3a",Text
"minus.triangle")
  , (Text
"\x22a7",Text
"models")
  , (Text
"\x3bc",Text
"mu")
  , (Text
"\x22b8",Text
"multimap")
  , (Text
"\x2207",Text
"nabla")
  , (Text
"\xac",Text
"not")
  , (Text
"\x1f39c",Text
"notes.up")
  , (Text
"\x1f39d",Text
"notes.down")
  , (Text
"\x2205",Text
"nothing")
  , (Text
"\x29b0",Text
"nothing.rev")
  , (Text
"\x3bd",Text
"nu")
  , (Text
"\x2126",Text
"ohm")
  , (Text
"\x2127",Text
"ohm.inv")
  , (Text
"\x3c9",Text
"omega")
  , (Text
"\x3bf",Text
"omicron")
  , (Text
"\x221e",Text
"oo")
  , (Text
"\x2228",Text
"or")
  , (Text
"\x22c1",Text
"or.big")
  , (Text
"\x22ce",Text
"or.curly")
  , (Text
"\x27c7",Text
"or.dot")
  , (Text
"\x2a54",Text
"or.double")
  , (Text
"\x2225",Text
"parallel")
  , (Text
"\x29b7",Text
"parallel.circle")
  , (Text
"\x2226",Text
"parallel.not")
  , (Text
"(",Text
"paren.l")
  , (Text
")",Text
"paren.r")
  , (Text
"\x23dc",Text
"paren.t")
  , (Text
"\x23dd",Text
"paren.b")
  , (Text
"\x2b20",Text
"penta.stroked")
  , (Text
"\x2b1f",Text
"penta.filled")
  , (Text
"%",Text
"percent")
  , (Text
"\x2030",Text
"permille")
  , (Text
"\x27c2",Text
"perp")
  , (Text
"\x29b9",Text
"perp.circle")
  , (Text
"\x20b1",Text
"peso")
  , (Text
"\x3c6",Text
"phi")
  , (Text
"\x3d5",Text
"phi.alt")
  , (Text
"\x3c0",Text
"pi")
  , (Text
"\x3d6",Text
"pi.alt")
  , (Text
"\xb6",Text
"pilcrow")
  , (Text
"\x204b",Text
"pilcrow.rev")
  , (Text
"\x210e",Text
"planck")
  , (Text
"\x210f",Text
"planck.reduce")
  , (Text
"+",Text
"plus")
  , (Text
"\x2295",Text
"plus.circle")
  , (Text
"\x27f4",Text
"plus.circle.arrow")
  , (Text
"\x2a01",Text
"plus.circle.big")
  , (Text
"\x2214",Text
"plus.dot")
  , (Text
"\xb1",Text
"plus.minus")
  , (Text
"\xfe62",Text
"plus.small")
  , (Text
"\x229e",Text
"plus.square")
  , (Text
"\x2a39",Text
"plus.triangle")
  , (Text
"\xa3",Text
"pound")
  , (Text
"\x227a",Text
"prec")
  , (Text
"\x2ab7",Text
"prec.approx")
  , (Text
"\x2abb",Text
"prec.double")
  , (Text
"\x227c",Text
"prec.eq")
  , (Text
"\x22e0",Text
"prec.eq.not")
  , (Text
"\x2ab3",Text
"prec.eqq")
  , (Text
"\x2ab9",Text
"prec.napprox")
  , (Text
"\x2ab5",Text
"prec.neqq")
  , (Text
"\x2280",Text
"prec.not")
  , (Text
"\x22e8",Text
"prec.ntilde")
  , (Text
"\x227e",Text
"prec.tilde")
  , (Text
"\x2032",Text
"prime")
  , (Text
"\x2035",Text
"prime.rev")
  , (Text
"\x2033",Text
"prime.double")
  , (Text
"\x2036",Text
"prime.double.rev")
  , (Text
"\x2034",Text
"prime.triple")
  , (Text
"\x2037",Text
"prime.triple.rev")
  , (Text
"\x2057",Text
"prime.quad")
  , (Text
"\x220f",Text
"product")
  , (Text
"\x2210",Text
"product.co")
  , (Text
"\x221d",Text
"prop")
  , (Text
"\x3c8",Text
"psi")
  , (Text
"\x220e",Text
"qed")
  , (Text
"?",Text
"quest")
  , (Text
"\x2047",Text
"quest.double")
  , (Text
"\x2048",Text
"quest.excl")
  , (Text
"\xbf",Text
"quest.inv")
  , (Text
"\"",Text
"quote.double")
  , (Text
"'",Text
"quote.single")
  , (Text
"\x201c",Text
"quote.l.double")
  , (Text
"\x2018",Text
"quote.l.single")
  , (Text
"\x201d",Text
"quote.r.double")
  , (Text
"\x2019",Text
"quote.r.single")
  , (Text
"\xab",Text
"quote.angle.l.double")
  , (Text
"\x2039",Text
"quote.angle.l.single")
  , (Text
"\xbb",Text
"quote.angle.r.double")
  , (Text
"\x203a",Text
"quote.angle.r.single")
  , (Text
"\x201f",Text
"quote.high.double")
  , (Text
"\x201b",Text
"quote.high.single")
  , (Text
"\x201e",Text
"quote.low.double")
  , (Text
"\x201a",Text
"quote.low.single")
  , (Text
"\x2236",Text
"ratio")
  , (Text
"\x25ad",Text
"rect.stroked.h")
  , (Text
"\x25af",Text
"rect.stroked.v")
  , (Text
"\x25ac",Text
"rect.filled.h")
  , (Text
"\x25ae",Text
"rect.filled.v")
  , (Text
"\x203b",Text
"refmark")
  , (Text
"\x3c1",Text
"rho")
  , (Text
"\x3f1",Text
"rho.alt")
  , (Text
"\x20bd",Text
"ruble")
  , (Text
"\x20b9",Text
"rupee")
  , (Text
"\x2229",Text
"sect")
  , (Text
"\x2a44",Text
"sect.and")
  , (Text
"\x22c2",Text
"sect.big")
  , (Text
"\x2a40",Text
"sect.dot")
  , (Text
"\x22d2",Text
"sect.double")
  , (Text
"\x2293",Text
"sect.sq")
  , (Text
"\x2a05",Text
"sect.sq.big")
  , (Text
"\x2a4e",Text
"sect.sq.double")
  , (Text
"\xa7",Text
"section")
  , (Text
";",Text
"semi")
  , (Text
"\x204f",Text
"semi.rev")
  , (Text
"\x2120",Text
"servicemark")
  , (Text
"\x5e9",Text
"shin")
  , (Text
"\x3c3",Text
"sigma")
  , (Text
"/",Text
"slash")
  , (Text
"\x2afd",Text
"slash.double")
  , (Text
"\x2afb",Text
"slash.triple")
  , (Text
"\x2a33",Text
"smash")
  , (Text
"s",Text
"space")
  , (Text
"\xa0",Text
"space.nobreak")
  , (Text
"\x2002",Text
"space.en")
  , (Text
"\x2003",Text
"space.quad")
  , (Text
"\x2004",Text
"space.third")
  , (Text
"\x2005",Text
"space.quarter")
  , (Text
"\x2006",Text
"space.sixth")
  , (Text
"\x205f",Text
"space.med")
  , (Text
"\x2007",Text
"space.fig")
  , (Text
"\x2008",Text
"space.punct")
  , (Text
"\x2009",Text
"space.thin")
  , (Text
"\x200a",Text
"space.hair")
  , (Text
"\x25a1",Text
"square.stroked")
  , (Text
"\x25ab",Text
"square.stroked.tiny")
  , (Text
"\x25fd",Text
"square.stroked.small")
  , (Text
"\x25fb",Text
"square.stroked.medium")
  , (Text
"\x2b1c",Text
"square.stroked.big")
  , (Text
"\x2b1a",Text
"square.stroked.dotted")
  , (Text
"\x25a2",Text
"square.stroked.rounded")
  , (Text
"\x25a0",Text
"square.filled")
  , (Text
"\x25aa",Text
"square.filled.tiny")
  , (Text
"\x25fe",Text
"square.filled.small")
  , (Text
"\x25fc",Text
"square.filled.medium")
  , (Text
"\x2b1b",Text
"square.filled.big")
  , (Text
"\x22c6",Text
"star.op")
  , (Text
"\x2605",Text
"star.stroked")
  , (Text
"\x2605",Text
"star.filled")
  , (Text
"\x2282",Text
"subset")
  , (Text
"\x2abd",Text
"subset.dot")
  , (Text
"\x22d0",Text
"subset.double")
  , (Text
"\x2286",Text
"subset.eq")
  , (Text
"\x2288",Text
"subset.eq.not")
  , (Text
"\x2291",Text
"subset.eq.sq")
  , (Text
"\x22e2",Text
"subset.eq.sq.not")
  , (Text
"\x228a",Text
"subset.neq")
  , (Text
"\x2284",Text
"subset.not")
  , (Text
"\x228f",Text
"subset.sq")
  , (Text
"\x22e4",Text
"subset.sq.neq")
  , (Text
"\x227b",Text
"succ")
  , (Text
"\x2ab8",Text
"succ.approx")
  , (Text
"\x2abc",Text
"succ.double")
  , (Text
"\x227d",Text
"succ.eq")
  , (Text
"\x22e1",Text
"succ.eq.not")
  , (Text
"\x2ab4",Text
"succ.eqq")
  , (Text
"\x2aba",Text
"succ.napprox")
  , (Text
"\x2ab6",Text
"succ.neqq")
  , (Text
"\x2281",Text
"succ.not")
  , (Text
"\x22e9",Text
"succ.ntilde")
  , (Text
"\x227f",Text
"succ.tilde")
  , (Text
"\x2663",Text
"suit.club")
  , (Text
"\x2666",Text
"suit.diamond")
  , (Text
"\x2665",Text
"suit.heart")
  , (Text
"\x2660",Text
"suit.spade")
  , (Text
"\x2211",Text
"sum")
  , (Text
"\x2a0b",Text
"sum.integral")
  , (Text
"\x2283",Text
"supset")
  , (Text
"\x2abe",Text
"supset.dot")
  , (Text
"\x22d1",Text
"supset.double")
  , (Text
"\x2287",Text
"supset.eq")
  , (Text
"\x2289",Text
"supset.eq.not")
  , (Text
"\x2292",Text
"supset.eq.sq")
  , (Text
"\x22e3",Text
"supset.eq.sq.not")
  , (Text
"\x228b",Text
"supset.neq")
  , (Text
"\x2285",Text
"supset.not")
  , (Text
"\x2290",Text
"supset.sq")
  , (Text
"\x22e5",Text
"supset.sq.neq")
  , (Text
"\x22a2",Text
"tack.r")
  , (Text
"\x27dd",Text
"tack.r.long")
  , (Text
"\x22a3",Text
"tack.l")
  , (Text
"\x27de",Text
"tack.l.long")
  , (Text
"\x2ade",Text
"tack.l.short")
  , (Text
"\x22a5",Text
"tack.t")
  , (Text
"\x27d8",Text
"tack.t.big")
  , (Text
"\x2aeb",Text
"tack.t.double")
  , (Text
"\x2ae0",Text
"tack.t.short")
  , (Text
"\x22a4",Text
"tack.b")
  , (Text
"\x27d9",Text
"tack.b.big")
  , (Text
"\x2aea",Text
"tack.b.double")
  , (Text
"\x2adf",Text
"tack.b.short")
  , (Text
"\x27db",Text
"tack.l.r")
  , (Text
"\x3c4",Text
"tau")
  , (Text
"\x2234",Text
"therefore")
  , (Text
"\x3b8",Text
"theta")
  , (Text
"\x3d1",Text
"theta.alt")
  , (Text
"~",Text
"tilde")
  , (Text
"\x223c",Text
"tilde.op")
  , (Text
"\x2243",Text
"tilde.eq")
  , (Text
"\x2244",Text
"tilde.eq.not")
  , (Text
"\x22cd",Text
"tilde.eq.rev")
  , (Text
"\x2245",Text
"tilde.eqq")
  , (Text
"\x2247",Text
"tilde.eqq.not")
  , (Text
"\x2246",Text
"tilde.neqq")
  , (Text
"\x2241",Text
"tilde.not")
  , (Text
"\x223d",Text
"tilde.rev")
  , (Text
"\x224c",Text
"tilde.rev.eqq")
  , (Text
"\x224b",Text
"tilde.triple")
  , (Text
"\xd7",Text
"times")
  , (Text
"\x2a09",Text
"times.big")
  , (Text
"\x2297",Text
"times.circle")
  , (Text
"\x2a02",Text
"times.circle.big")
  , (Text
"\x22c7",Text
"times.div")
  , (Text
"\x22cb",Text
"times.l")
  , (Text
"\x22cc",Text
"times.r")
  , (Text
"\x22a0",Text
"times.square")
  , (Text
"\x2a3b",Text
"times.triangle")
  , (Text
"\x22a4",Text
"top")
  , (Text
"\x25b7",Text
"triangle.stroked.r")
  , (Text
"\x25c1",Text
"triangle.stroked.l")
  , (Text
"\x25b3",Text
"triangle.stroked.t")
  , (Text
"\x25bd",Text
"triangle.stroked.b")
  , (Text
"\x25fa",Text
"triangle.stroked.bl")
  , (Text
"\x25ff",Text
"triangle.stroked.br")
  , (Text
"\x25f8",Text
"triangle.stroked.tl")
  , (Text
"\x25f9",Text
"triangle.stroked.tr")
  , (Text
"\x25b9",Text
"triangle.stroked.small.r")
  , (Text
"\x25bf",Text
"triangle.stroked.small.b")
  , (Text
"\x25c3",Text
"triangle.stroked.small.l")
  , (Text
"\x25b5",Text
"triangle.stroked.small.t")
  , (Text
"\x1f6c6",Text
"triangle.stroked.rounded")
  , (Text
"\x27c1",Text
"triangle.stroked.nested")
  , (Text
"\x25ec",Text
"triangle.stroked.dot")
  , (Text
"\x25b6",Text
"triangle.filled.r")
  , (Text
"\x25c0",Text
"triangle.filled.l")
  , (Text
"\x25b2",Text
"triangle.filled.t")
  , (Text
"\x25bc",Text
"triangle.filled.b")
  , (Text
"\x25e3",Text
"triangle.filled.bl")
  , (Text
"\x25e2",Text
"triangle.filled.br")
  , (Text
"\x25e4",Text
"triangle.filled.tl")
  , (Text
"\x25e5",Text
"triangle.filled.tr")
  , (Text
"\x25b8",Text
"triangle.filled.small.r")
  , (Text
"\x25be",Text
"triangle.filled.small.b")
  , (Text
"\x25c2",Text
"triangle.filled.small.l")
  , (Text
"\x25b4",Text
"triangle.filled.small.t")
  , (Text
"\x3014",Text
"turtle.l")
  , (Text
"\x3015",Text
"turtle.r")
  , (Text
"\x23e0",Text
"turtle.t")
  , (Text
"\x23e1",Text
"turtle.b")
  , (Text
"\x222a",Text
"union")
  , (Text
"\x228c",Text
"union.arrow")
  , (Text
"\x22c3",Text
"union.big")
  , (Text
"\x228d",Text
"union.dot")
  , (Text
"\x2a03",Text
"union.dot.big")
  , (Text
"\x22d3",Text
"union.double")
  , (Text
"\x2a41",Text
"union.minus")
  , (Text
"\x2a45",Text
"union.or")
  , (Text
"\x228e",Text
"union.plus")
  , (Text
"\x2a04",Text
"union.plus.big")
  , (Text
"\x2294",Text
"union.sq")
  , (Text
"\x2a06",Text
"union.sq.big")
  , (Text
"\x2a4f",Text
"union.sq.double")
  , (Text
"\x3c5",Text
"upsilon")
  , (Text
"\x2216",Text
"without")
  , (Text
"\8288",Text
"wj")
  , (Text
"\x20a9",Text
"won")
  , (Text
"\x2240",Text
"wreath")
  , (Text
"\x3be",Text
"xi")
  , (Text
"\xa5",Text
"yen")
  , (Text
"\x3b6",Text
"zeta")
  , (Text
"\x200d",Text
"zwj")
  , (Text
"\x200c",Text
"zwnj")
  , (Text
"\x200b",Text
"zws") ]