Skip to content

TemmlMacro

Namespace: Temml

public sealed class TemmlMacro

A macro definition: a string body, a token list, or a function. Maps to the values of upstream’s macros objects.

Inheritance: object

View source

TemmlMacro(Func<ITemmlMacroContext, TemmlMacro?>)

Section titled “TemmlMacro(Func<ITemmlMacroContext, TemmlMacro?>)”
public TemmlMacro(Func<ITemmlMacroContext, TemmlMacro?> function)

Initializes a new instance of the TemmlMacro class from a function. The function returns a string or token list macro, or null to leave the command unexpanded.

Parameters

Name Type Description
function Func<ITemmlMacroContext, TemmlMacro>

View source

public TemmlMacro(string body)

Initializes a new instance of the TemmlMacro class from TeX source.

Parameters

Name Type Description
body string

View source

public TemmlMacro(TemmlMacroExpansion expansion)

Initializes a new instance of the TemmlMacro class from a token list.

Parameters

Name Type Description
expansion TemmlMacroExpansion

View source

public string? Body { get; }

The TeX source, for a string macro.

Value: string

View source

public TemmlMacroExpansion? Expansion { get; }

The token list, for a token list macro.

Value: TemmlMacroExpansion

View source

public bool IsFunction { get; }

Whether this macro is a function.

Value: bool

View source

public override string ToString()

Returns the TeX source of a string macro.

Returns: string

View source

public static implicit operator TemmlMacro(string body)

Converts TeX source to a macro.

Parameters

Name Type Description
body string

Returns: TemmlMacro

View source

implicit operator TemmlMacro(TemmlMacroExpansion)

Section titled “implicit operator TemmlMacro(TemmlMacroExpansion)”
public static implicit operator TemmlMacro(TemmlMacroExpansion expansion)

Converts a token list to a macro.

Parameters

Name Type Description
expansion TemmlMacroExpansion

Returns: TemmlMacro

View source

MIT · Copyright 2020 Ron Kok · unofficial community port of Temml