MacroInfo: {
    argumentParser?: ArgumentParser;
    escapeToken?: string;
    renderInfo?: {
        breakAfter?: boolean;
        breakAround?: boolean;
        breakBefore?: boolean;
        hangingIndent?: boolean;
        inMathMode?: boolean;
        inParMode?: boolean;
        namedArguments?: (string | null)[];
        pgfkeysArgs?: boolean;
        tikzPathCommand?: boolean;
    };
    signature?: string;
}

Type declaration

  • Optional argumentParser?: ArgumentParser

    Custom argument parser. If present, function overrides the default argument parsing of signature. An array of nodes is passed as well as the position of the first node after the macro. This function is expected to mutate the input array, removing any nodes that are part of the macro's argument.

    This function will only be called on a macro if it has no existing args.

    Note: for stability when printing/accessing a node's arguments, this function should always return an argument array of the same length, regardless of whether optional arguments are present. For example, if this function parses a node with signature o m, it should ways return a length-two array of arguments. A "blank" argument (one that does not show up during printing) can be created with args([], { openMark: "", closeMark: "" }), using the unified-latex-builder package.

  • Optional escapeToken?: string

    Some special macros like ^ and _ don't use an escape token. When matching against these macros, care must be taken to match the macro contents and the macro's escape token.

  • Optional renderInfo?: {
        breakAfter?: boolean;
        breakAround?: boolean;
        breakBefore?: boolean;
        hangingIndent?: boolean;
        inMathMode?: boolean;
        inParMode?: boolean;
        namedArguments?: (string | null)[];
        pgfkeysArgs?: boolean;
        tikzPathCommand?: boolean;
    }
    • Optional breakAfter?: boolean

      Whether there should be line breaks after the macro (e.g., like the \\ command.)

    • Optional breakAround?: boolean

      Whether there should be line breaks before and after the macro (e.g., like the \section{...} command.)

    • Optional breakBefore?: boolean

      Whether there should be line breaks before the macro.

    • Optional hangingIndent?: boolean

      Whether the arguments should be rendered with a hanging indent when the wrap (like the arguments to \item in an enumerate environment.)

    • Optional inMathMode?: boolean

      Whether the contents of the macro should be assumed to be in math mode.

    • Optional inParMode?: boolean

      Whether the macro's contents wraps along with the current paragraph or displays as it's own block.

    • Optional namedArguments?: (string | null)[]

      A list of names to be given to each argument when processing. This list should be the same length as the number of arguments. null can appear any number of times for "un-named" arguments.

      This allows a consistent reference to macro arguments even if the macro signatures are redefined between packages.

    • Optional pgfkeysArgs?: boolean

      Whether the arguments should be processed as pgfkeys-type arguments.

    • Optional tikzPathCommand?: boolean

      Whether the macro represents a tikz path command (e.g. \draw (0,0) -- (1,1);).

  • Optional signature?: string

    The macro signature as an xparse argument specification string.

Generated using TypeDoc