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
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | input_text | |||
| character(len=*), | intent(out) | :: | result_text | |||
| integer, | intent(out) | :: | result_len |