How does one write a unicode character in a discourse thread?
Copy-pasta: Ʀ, Ćø, ā°, ā¦
If there is no source where to copy from? What then?
I would argue that the glyph is THE source.
Copy paste from Julia REPL - I donāt know anything about scientific computing, I only really use Julia as a Unicode character creation machine
A few solutions that I tend to use:
- write (La)TeX (as in
$\alpha$
) - fire up a Julia REPL and auto-complete the unicode character from its TeX representation (
\alpha<TAB>
) and copy-paste it - get a nearby emacs window and use
M-x insert-char
to insert the unicode character and copy-paste it - there are tons of web sites where its easy to find unicode character by name and copy them to the clipboard. Here is an example
(I have to admit that Iām not always a big fan of unicode characters in source code, but typing unicode in a Julia REPL is so painless that I sometimes compose parts of my emails in the Julia REPL)
Then there will also be no internet where to write on discourse.
āThere is no sourceā simply means āI donāt know where to find the sourceā. Where is THE source of glyphs that you speak of?
And the other way around, I use Julia to find which is the LaTeX code that gives me some characters I donāt know how to type:
help?> ā°
"ā°" can be typed by \oiiint<tab>
If you want to find a convenient symbol to represent a closed volume integral, I bet you will search the internet and look how the glyph looks like. Let you guess from the hits that show up for unicode and glyph, which one is human readable and easier for copy-pasta into discourse.
For those who, like me, are looking for some forms of unicode characters, here is a good source: http://www.unicode-symbol.com/ . To include the characters in a discourse thread, use the html form.
On a related note, I highly recommend Detexify LaTeX handwritten symbol recognition which lets you draw a symbol then it uses ML to find possible latex matches. (or http://shapecatcher.com/ for unicode)
One more approach: from the REPL, you can use Juliaās clipboard
function, which copies a given string to the system clipboard:
julia> āĆ¢Ā²ā |> clipboard
This also enables the use of REPL history & search modes to quickly recover some commonly-used string (Iāve found it useful for marking up stacks of homework submitted through online portals during COVID).
If youāre on macOS, Iāve developed a custom āUS International - Scientificā keyboard layout that will let you type a very large number of math-unicode symbols directly.
It skews a little towards my personal use case of quantum physics, but it should cover Julia more broadly pretty well.
Presumably, the keyboard layout could be ported to Windows/Linux (not my using those, but they also have ways of setting up custom keyboard mappings)
If the Unicode character has a LaTeX command supported by the Discourse math engine (MathJax I think) then while writing your message you can write e.g. $\theta$
or $\iint$
and the math will be shown in the preview on the right side. You can copy the Unicode symbols from there.
For Windows and Linux you can use a compose key: Touch-Typing Unicode: How and Why
I get heavy mileage out of WinCompose, typing greek letters and symbols everywhere.