Template Function sequant::greek_characters_to_latex(const std::basic_string_view<Char, Traits>&)

Function Documentation

template<typename Char, typename Traits>
std::basic_string<Char, Traits> sequant::greek_characters_to_latex(const std::basic_string_view<Char, Traits> &str)

replaces certain greek characters in a string with their (math-mode) LaTeX equivalents

Warning

if str contains non-ASCII characters Char must be wchar_t

Template Parameters:
  • Char – character type

  • Traits – character traits type

Parameters:

str – input string

Throws:

std::invalid_argument – if Char is narrow and str contains non-ASCII characters

Returns:

string with greek characters contained within Unicode ranges [0x3B1,0x3C9] and [0391,03A9]replaced with their LaTeX equivalents