tex.spad line 1 [edit on github]
TexFormat provides a coercion from OutputForm to TeX format. The particular dialect of TeX used is LaTeX. The basic object consists of three parts: a prologue, a tex part and an epilogue. The functions prologue, tex and epilogue extract these parts, respectively. The main guts of the expression go into the tex part. The other parts can be set (setPrologue!, setEpilogue!) so that contain the appropriate tags for printing. For example, the prologue and epilogue might simply contain ``
\spad{\[}''
and ``
\spad{\]}''
, respectively, so that the TeX section will be printed in LaTeX display math mode.
coerce(o)
changes o
in the standard output format to TeX format.
convert(o, step)
changes o
in standard output format to TeX format and also adds the given step number. This is useful if you want to create equations with given numbers or have the equation numbers correspond to the interpreter step numbers.
convert(o, step, type)
changes o
in standard output format to TeX format and also adds the given step
number and type. This is useful if you want to create equations with given numbers or have the equation numbers correspond to the interpreter step
numbers.
display(t)
outputs the TeX formatted code t
so that each line has length less than or equal to the value set by the system command )set output length.
display(t, width)
outputs the TeX formatted code t
so that each line has length less than or equal to width.
epilogue(t)
extracts the epilogue section of a TeX form t
.
getDialect()
return current dialect setting.
new()
create a new, empty object. Use setPrologue!, setTex! and setEpilogue! to set the various components of this object.
prologue(t)
extracts the prologue section of a TeX form t
.
setDialect(d)
sets s
as current dialect and returns previous setting. Possible values are tex
meaning using mostly plain TeX constructs and latex
which means more idiomatic LaTeX.
setEpilogue!(t, strings)
sets the epilogue section of a TeX form t
to strings.
setPrologue!(t, strings)
sets the prologue section of a TeX form t
to strings.
setTex!(t, strings)
sets the TeX section of a TeX form t
to strings.
tex(t)
extracts the TeX section of a TeX form t
.