diff options
Diffstat (limited to 'src/interp/i-output.boot')
-rw-r--r-- | src/interp/i-output.boot | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/interp/i-output.boot b/src/interp/i-output.boot index 2a625592..be25b4ac 100644 --- a/src/interp/i-output.boot +++ b/src/interp/i-output.boot @@ -2677,3 +2677,23 @@ inputForm2String x == inputForm2OutputForm x == INTERN inputForm2String x +-- function for turning strings in tex format + +str2Outform s == + parse := ncParseFromString s or systemError '"String for TeX will not parse" + parse2Outform parse + +parse2Outform x == + x is [op,:argl] => + nargl := [parse2Outform y for y in argl] + op = 'construct => ['BRACKET,['ARGLST,:[parse2Outform y for y in argl]]] + op = 'brace and nargl is [[BRACKET,:r]] => ['BRACE,:r] + [op,:nargl] + x + +str2Tex s == + outf := str2Outform s + val := coerceInt(objNew(wrap outf, '(OutputForm)), '(TexFormat)) + val := objValUnwrap val + CAR val.1 + |