Search code examples
asciistata

ASCII Code for Uppercase/Capital R with a Tilde Character Above


I am trying to get the equivalent of LaTeX's $\tilde R$ in a Stata graph axis label. I don't thinks there's a SMCL way of doing that, but it's possible to use ASCII characters. However, there does not seem to be an ASCII code for an uppercase/capital R with a tilde above it.

Is there any way around that? Is it possible to combine ASCII characters somehow?


Solution

  • In Stata 14, this can be accomplished with:

    `=ustrunescape("\u0052\u0303")'
    

    This combines the Unicode for capital R with the one for tilde.


    MVE:

    sysuse auto, clear
    tw scatter price mpg, title(`=ustrunescape("\u0052\u0303")')
    

    should produce something like this (modulo scheme):

    enter image description here