News for hackers. Stuff that matters.
Re:ASCII and Unicode quotation marks by gbacon on Wednesday September 13, 2017 @03:44PM (#15241892)
Another giveaway of a TeX-savvy writer out of water is when you see --- for em-dash, i.e., ‘—’.
Re:ASCII and Unicode quotation marks by gbacon on Wednesday September 13, 2017 @03:47PM (#15241919)
Does HN markdown understand — or ‘?

EDIT: Nope.

Re:ASCII and Unicode quotation marks by koolba on Wednesday September 13, 2017 @03:57PM (#15241996)
It doesn't need to. You can put the mdash directly in comments: —

As opposed to regular dash: -

Re:ASCII and Unicode quotation marks by PeterisP on Wednesday September 13, 2017 @04:11PM (#15242127)
Well, since my keyboard doesn't have an mdash key, if there's no support for something like — or --- then I can't use mdashes.
Re:ASCII and Unicode quotation marks by SaladFork on Wednesday September 13, 2017 @04:15PM (#15242165)
At least on the US keyboard, Mac OS lets you input all three dash types.

Hitting the button to the right of [0] outputs a hyphen ("-"). Holding alt/option when hitting it will output an en dash ("–"), holding both alt/option and shift will output an em dash ("—").

- = -

⌥- = –

⇧⌥- = —

Re:ASCII and Unicode quotation marks by pluma on Thursday September 14, 2017 @06:16AM (#15246466)
If you're on Linux (maybe macOS supports this too?) you can open the keyboard settings and turn one of several keys into the Compose/Multi key (I picked CapsLock because I rarely hit it on accident and don't use it). Then you can type all kinds of weird combinations:

https://www.x.org/releases/X11R7.7/doc/libX11/i18n/compose/e...

For example, em dash is Compose+minus+minus+minus, en dash is Compose+minus+minus+period.

It's also useful for foreign glyphs like Compose+a+a for the Nordic å, Compose+s+s for German ß (with Shift it becomes ẞ, which the new German orthography rules officially recognise!), Compose+quote+<vowel> for the various umlauts and Compose+i+period for the dotless ı (with Shift it becomes the dotted İ).

Re:ASCII and Unicode quotation marks by yorwba on Thursday September 14, 2017 @07:18AM (#15246789)
The best way to enter arbitrary Unicode characters on Linux I have found is fcitx's https://fcitx-im.org/Unicode

Just press Ctrl-Alt-Shift-U, type (part of) the name of the character and select from the list of results.

— (em dash), ︱ (presentation form for vertical em dash), ⤐ (rightwards two-headed triple-dash arrow), ﷽ (arabic ligature bismillah ar-rahman ar-raheem) are all easy to enter.

Re:ASCII and Unicode quotation marks by Tomte on Thursday September 14, 2017 @03:05AM (#15245558)
I'm using AutoHotKey on Windows. Not only for this, but for other things, as well.

For example (<^>! means the AltGr key):

  <^>!4::Send „
  <^>!5::Send “
  <^>!2::Send ‚
  <^>!3::Send ‘
  <^>!+6::Send “
  <^>!+7::Send ”
  <^>!+8::Send ‘
  <^>!+9::Send ’
  <^>!-::Send –
  <^>!.::Send …
Also to use Caps Lock as another Control key:

  Capslock::Ctrl
Or make windows stay on top of others, if even they lose focus:

  <^>!t::Winset, Alwaysontop, TOGGLE, A
Re:ASCII and Unicode quotation marks by dghf on Wednesday September 13, 2017 @05:29PM (#15242891)
Fire up vim, use a digraph (^K followed by the two relevant characters -- I believe em dash is -M -- in insert mode), copy & paste.
Re:ASCII and Unicode quotation marks by leephillips on Wednesday September 13, 2017 @04:28PM (#15242267)
Nobody's keyboard had an em-dash key (well, maybe some compositor keyboards...). It's well worth the time to figure out how to enter at least the most useful Unicode characters. See, here's an em-dash: —.
Re:ASCII and Unicode quotation marks by Symbiote on Wednesday September 13, 2017 @05:27PM (#15242868)
Linux users should enable the compose key, it's very useful.

Test it with:

  setxkbmap -option compose:menu
Then press the menu/compose key (next to right control), then C, then =. You get €.

Try compose, 1, 2 for ½.

Compose, ^, 3 for ³.

Compose, A, : for Ä.

It's pretty intuitive for the most useful characters, and easily the fastest way I have of typing the ö, ñ and å in various colleagues' names.

Re:ASCII and Unicode quotation marks by jgtrosh on Wednesday September 13, 2017 @06:09PM (#15243195)
Actually, A: is not valid with the default compose bindings (it is however valid with vim digraphs). In general umlauts or trémas are inserted with the double quote (A").
Re:ASCII and Unicode quotation marks by YSFEJ4SWJUVU6 on Wednesday September 13, 2017 @05:40PM (#15242985)
Worth noting that international layouts (with dead keys) support many of those without the use of compose key (for obvious reasons not your first example – but the € symbol has its own key combination at least where it's commonly used). I admit it might be hard to adjust to caret being a dead key, though.
Re:ASCII and Unicode quotation marks by Symbiote on Thursday September 14, 2017 @03:13AM (#15245586)
Dead keys support accents, and a few symbols printed on the keyboard are discoverable, but I find the Compose key is much more intuitive for occasional use.

I don't yet speak the language of my adopted country, so it's better for me to keep []{} etc where I like them in the British layout, and use three keypresses for typing the ø in a (place) name like København.

If I do end up typing lots of Danish, I'll probably map AltGr+A,E,O to Å, Æ, Ø. É is rare, so I'll still use the Compose key for that and German / Swedish names.

Re:ASCII and Unicode quotation marks by pluma on Thursday September 14, 2017 @06:19AM (#15246475)
I use the default German keyboard layout. Even with dead keys I wouldn't have Nordic characters or the Turkish dotless i and dotted I. I love the Compose key. It's actually making me consider using the US layout because the lack of German glyphs was what was keeping me back.
Re:ASCII and Unicode quotation marks by ComputerGuru on Wednesday September 13, 2017 @09:17PM (#15244239)
I use the code behind this web app: http://latex2unicode.herokuapp.com/

It converts latex to unicode where possible. It's pretty impressive how much of Latex can be replaced with Unicode today.

This program translates LaTeX markup to human-readable Unicode when possible.

Here's the default text from that webapp:

Basic math notations: ∵ A͡B + B͡C ≠ A͡C ∴ ∬∜x̅ ξᶿ⁺¹ - ⅜ ≤ Σ ζᵢ ∴ ∃x∀y x ∈ Â

Easily type in hundreds of other symbols and special characters: , ℵ, Œ, ⇊, etc.

Font styles support: 𝔹𝕝𝕒𝕔𝕜 𝔹𝕠𝕒𝕣𝕕 𝔹𝕠𝕝𝕕, 𝔉𝔯𝔞𝔨𝔱𝔲𝔯, 𝐁𝐨𝐥𝐝 𝐅𝐚𝐜𝐞, 𝓒𝓪𝓵𝓵𝓲𝓰𝓻𝓪𝓹𝓱𝓲𝓬, 𝐼𝑡𝑎𝑙𝑖𝑐, 𝙼𝚘𝚗𝚘𝚜𝚙𝚊𝚌𝚎.

Now type in this box and try it yourself. ⌣̈

Re:ASCII and Unicode quotation marks by alanh on Wednesday September 13, 2017 @09:37PM (#15244359)
Careful — some of the Unicode pseudoalphabets won't render on mobile.
Re:ASCII and Unicode quotation marks by ComputerGuru on Friday September 15, 2017 @12:42PM (#15258537)
No problem on iOS; I see the same thing that I see on my Windows desktop.
Re:ASCII and Unicode quotation marks by mark-r on Wednesday September 13, 2017 @04:38PM (#15242380)
If I need a special character, I find a web page or document that has it and use copy/paste.
Re:ASCII and Unicode quotation marks by jiggunjer on Thursday September 14, 2017 @06:43AM (#15246612)
I have an A4 pinned next to me with all the windows Alt codes. Old-school methods are fastest and I subconsciously learn them by heart over the years.
Re:ASCII and Unicode quotation marks by mark-r on Thursday September 14, 2017 @09:18AM (#15247663)
Nice idea. I don't need them often enough to bother. Do you have a source for the chart?
Re:ASCII and Unicode quotation marks by devindotcom on Wednesday September 13, 2017 @05:30PM (#15242898)
Yeah. Can't count how many times I've just googled "yen" or "e with accent" because I can't remember the shortcut.
Re:ASCII and Unicode quotation marks by fish_fan on Wednesday September 13, 2017 @04:50PM (#15242523)
Even then the character pallete built into MacOS is much more convenient for searching, saving, and inputting.
Re:ASCII and Unicode quotation marks by mark-r on Wednesday September 13, 2017 @06:21PM (#15243283)
The character palette built into Windows uses too small a font, I find it almost useless. And the size is not adjustable. I've been tempted on more than one occasion to write my own.
Re:ASCII and Unicode quotation marks by jiggunjer on Wednesday September 13, 2017 @10:01PM (#15244473)
Keyboards and typing aids can enter any character if you configure them properly.
Re:ASCII and Unicode quotation marks by alanh on Wednesday September 13, 2017 @09:39PM (#15244371)
not that HN needs more pedantry, but HN’s lightweight markup format is not in any sense a Markdown. I believe that literally the only thing they have in common is that a single set of asterisks yields italics. Bolding, headings, code, lists, quotes, links, etc. don’t transfer from one to the other.