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.

=: (%, %) -> Boolean

from BasicType

~=: (%, %) -> Boolean

from BasicType

coerce: % -> OutputForm

from CoercibleTo OutputForm

coerce: OutputForm -> %

coerce(o) changes o in the standard output format to TeX format.

convert: (OutputForm, Integer) -> %

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: (OutputForm, Integer, OutputForm) -> %

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: % -> Void

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 spadsys{)set output length}.

display: (%, Integer) -> Void

display(t, width) outputs the TeX formatted code t so that each line has length less than or equal to spadvar{width}.

epilogue: % -> List String

epilogue(t) extracts the epilogue section of a TeX form t.

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.

prologue: % -> List String

prologue(t) extracts the prologue section of a TeX form t.

setDialect: Symbol -> Symbol

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!: (%, List String) -> List String

setEpilogue!(t, strings) sets the epilogue section of a TeX form t to strings.

setPrologue!: (%, List String) -> List String

setPrologue!(t, strings) sets the prologue section of a TeX form t to strings.

setTex!: (%, List String) -> List String

setTex!(t, strings) sets the TeX section of a TeX form t to strings.

tex: % -> List String

tex(t) extracts the TeX section of a TeX form t.

BasicType

CoercibleTo OutputForm

SetCategory