preprocess_math_text Subroutine

public subroutine preprocess_math_text(input_text, result_text, result_len)

Escape '^'/'' outside math so they render literally, and pass the '$' delimiters through so the parser can toggle math mode (and tag math runs italic). Only content between '$...$' is treated as math, matching matplotlib: bare '^'/'' outside dollars stay literal. UTF-8 aware: multi-byte characters are copied as intact sequences

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: input_text
character(len=*), intent(out) :: result_text
integer, intent(out) :: result_len