Shortcuts for Unicode Greek symbols
s.r.chinn
function UGreek() // LOWER CASE
String/G kAlpha = "\u03B1"
String/G kBeta = "\u03B2"
String/G kGamma = "\u03B3"
String/G kDelta = "\u03B4"
String/G kEpsilon = "\u03B5"
String/G kZeta = "\u03B6"
String/G kEta = "\u03B7"
String/G kTheta = "\u03B8"
String/G kIota = "\u03B9"
String/G kKappa = "\u03BA"
String/G kLambda = "\u03BB"
String/G kMu = "\u03BC"
String/G kNu = "\u03BD"
String/G kXi = "\u03BE"
String/G kOmicron = "\u03BF"
String/G kPi = "\u03C0"
String/G kRho = "\u03C1"
String/G kSigma = "\u03C3"
String/G kTau = "\u03C4"
String/G kUpsilon = "\u03C5"
String/G kPhi = "\u03C6"
String/G kChi = "\u03C7"
String/G kPsi = "\u03C8"
String/G kOmega = "\u03C9"
end
String/G kAlpha = "\u03B1"
String/G kBeta = "\u03B2"
String/G kGamma = "\u03B3"
String/G kDelta = "\u03B4"
String/G kEpsilon = "\u03B5"
String/G kZeta = "\u03B6"
String/G kEta = "\u03B7"
String/G kTheta = "\u03B8"
String/G kIota = "\u03B9"
String/G kKappa = "\u03BA"
String/G kLambda = "\u03BB"
String/G kMu = "\u03BC"
String/G kNu = "\u03BD"
String/G kXi = "\u03BE"
String/G kOmicron = "\u03BF"
String/G kPi = "\u03C0"
String/G kRho = "\u03C1"
String/G kSigma = "\u03C3"
String/G kTau = "\u03C4"
String/G kUpsilon = "\u03C5"
String/G kPhi = "\u03C6"
String/G kChi = "\u03C7"
String/G kPsi = "\u03C8"
String/G kOmega = "\u03C9"
end
When typing in an annotation entry, use the escape sequence
\{global_symbol_name}
. I anticipate some objections to using so manyglobal strings. Please suggest a better approach if you know of one.
The extension to other symbols is obvious. I found a useful UTF table at http://www.fileformat.info/info/charset/UTF-8/list.htm
Forum
Support
Gallery
Igor Pro 9
Learn More
Igor XOP Toolkit
Learn More
Igor NIDAQ Tools MX
Learn More
string latinChar
strswitch(tolower(latinChar))
case "a":
return "\u03B1"
// ...
endswitch
End
and then use
\{greek("a")}
. But it is not exactly short on the calling site.October 18, 2016 at 12:23 pm - Permalink
make/O/N=26/T wGK ={"\u03B1","\u03B2","\u03C7","\u03B4","\u03B5","\u03C6","\u03B3","\u03B7","\u03B9",\
"\u03D5","\u03BA","\u03BB","\u03BC","\u03BD","\u03BF","\u03C0","\u03B8","\u03C1","\u03C3","\u03C4",\
"\u03C5","\u03D6","\u03C9","\u03BE","\u03C8","\u03B6"}
end
//----------------------------------------------------------
function/T GK(char) // retrieve Unicode Greek LC symbol, with Latin character input, e.g. "a"
string char
WAVE/T wGK
variable CharNum = char2num(char)- 97 // subtract starting "a" value
return wGK[CharNum]
end
As before enter annotations as \{GK("LatinCharacter")} .
Added: I should have used
function/S GK(char)
, but interestingly the /T flag compiled and worked, even if not documented.Here is the History output for a simple test function (it is better aligned in monospaced font)
a b c d e f g h i j k l m n o p q r s t u v w x y z
October 20, 2016 at 04:49 am - Permalink