TexFormatΒΆ
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 ``
verb+\[
+''
and ``
verb+\]
+''
, respectively, so that the TeX section will be printed in LaTeX display math mode.
- coerce: % -> OutputForm
from CoercibleTo OutputForm
- coerce: OutputForm -> %
coerce(o)
changeso
in the standard output format to TeX format.
- convert: (OutputForm, Integer) -> %
convert(o, step)
changeso
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: (OutputForm, Integer, OutputForm) -> %
convert(o, step, type)
changeso
in standard output format to TeX format and also adds the givenstep
number and type. This is useful if you want to create equations with given numbers or have the equation numbers correspond to the interpreterstep
numbers.
- display: % -> Void
display(t)
outputs the TeX formatted codet
so that each line has length less than or equal to the value set by the system command spadsys{)set output length}.
- display: (%, Integer) -> Void
display(t, width)
outputs the TeX formatted codet
so that each line has length less than or equal to spadvar{width}.
- getDialect: () -> Symbol
getDialect()
return current dialect setting.
- latex: % -> String
from SetCategory
- new: () -> %
new()
create a new, empty object. Use setPrologue!, setTex! and setEpilogue! to set the various components of this object.
- setDialect: Symbol -> Symbol
setDialect(d)
setss
as current dialect and returns previous setting. Possible values aretex
meaning using mostly plain TeX constructs andlatex
which means more idiomatic LaTeX.
- setEpilogue!: (%, List String) -> List String
setEpilogue!(t, strings)
sets the epilogue section of a TeX formt
to strings.
- setPrologue!: (%, List String) -> List String
setPrologue!(t, strings)
sets the prologue section of a TeX formt
to strings.