7
$\begingroup$

LaTeX has some handy macros that allow the insertion of diacritics and other special characters in text mode. Relevant tables from the Comprehensive LaTeX Symbol List:

#17 - Text-mode Accents

#5 - Non-ASCII Letters

These are handy since they don't require special input methods nor remembering unicode character numbers but, more importantly, mathematicians know and use them all the time. (I regularly get emails addressed "Dear Fran\c{c}ois"!) It would be nice if some useful subset of these were recognized on MathOverflow.

$\endgroup$
17
  • $\begingroup$ I'm suddenly ashamed that I put myself in this otherwise impressive list of mathematicians! (They were the first examples that came to mind...) $\endgroup$ Jun 29, 2013 at 16:15
  • $\begingroup$ This is a great suggestion. Also on MO not infrequently does one see LaTeX-style 'pseudo-diacritics'. Some even actually use MathJax to get them to print, which is however unfortunate due to different font, rendering time, and some other reasons. $\endgroup$
    – user9072
    Jun 29, 2013 at 16:18
  • $\begingroup$ Should we also expand the 'for example' list here. Accents grave and circonflexe spring to mind. Also the i without dot, I do not know how this is called, but I know of Yıldırım. Also one might want to be able to spell Gauß easily. $\endgroup$
    – user9072
    Jun 29, 2013 at 16:25
  • 3
    $\begingroup$ @FrançoisG.Dorais, I liked your list of the names better... :-) $\endgroup$ Jun 29, 2013 at 16:44
  • 1
    $\begingroup$ François, should we expect people to also write Андре́й Андре́евич Ма́рков, 姚期智, ஸ்ரீனிவாஸ ராமானுஜன், ... or is this expectation only for names in Latin based languages? If all names should be written in their original language please write my name as کاوه. :) $\endgroup$
    – Kaveh
    Jun 29, 2013 at 22:59
  • $\begingroup$ @Kaveh: I've never been asked about that. (I've also never saw anyone write write Ма́рков instead of Markov in an question or answer.) $\endgroup$ Jun 29, 2013 at 22:59
  • $\begingroup$ @François, I know that. Russian uses Cyrillic script so no surprise people write Ма́рков as Markov. My point is, IMHO, we shouldn't be too picky about names. There are many published articles that write Kurt Gödel as Kurt Godel. Almost none of my American/European colleagues can even pronounce my first name correctly let alone my last name. German and French share most of their symbols with English but the symbols used by these names are not on standard English keyboards that we use. And people with other native languages may not even notice the difference between symbols like è and é. $\endgroup$
    – Kaveh
    Jun 29, 2013 at 23:30
  • $\begingroup$ @Kaveh: I only relate what people ask me. I generally appreciate when people try since my name has a diacritic and I like it, but that has no bearing on whether I would request this on their behalf or not. [If you're asking me personally, if I were to cite a paper by کاوه from АЛГЕБРА и ЛОГИКА (the original, not the translation), I will try to keep the original names as such if possible, perhaps with a parenthetical translation/transliteration into whatever language I'm writing in.] $\endgroup$ Jun 29, 2013 at 23:31
  • $\begingroup$ @François, I understand. I am just saying that we should be tolerant to people whose native language is different from ours when they can't write our names properly. (I doubt it be straightforward to publish an article in say JSL with author name Алекса́ндр Алекса́ндрович Разбо́ров, not to even mention names in languages using right to left scripts like Hebrew.) $\endgroup$
    – Kaveh
    Jun 29, 2013 at 23:56
  • 1
    $\begingroup$ @Kaveh: The request was not for my name, though I suspect that's why people often ask me personally, my guess is that it's mostly for Erdős which is kind of a pain even for me to type. $\endgroup$ Jun 30, 2013 at 0:02
  • $\begingroup$ @François, I understand that this feature is what people request from you and I support this feature-request. Probably shouldn't have posted these under the question. Apologies. $\endgroup$
    – Kaveh
    Jun 30, 2013 at 0:24
  • $\begingroup$ @Kaveh: No problem. $\endgroup$ Jun 30, 2013 at 0:43
  • 1
    $\begingroup$ I should explain that this feature request was triggered by an answer of mine mathoverflow.net/a/135187/6794 (before it was edited), in which I wanted to put correct accents on the name of one of my teachers. I found that my computer and browser, though perfectly capable of putting an acute accent on various letters, balked at putting it on a c (they inserted a space and put the accent on that). I also found that I had no idea how to produce a the accents that TeX calls \v and \H . (I invited others to edit in the accents, and Mariano Suárez-Alvarez kindly did so.) $\endgroup$ Jun 30, 2013 at 1:26
  • 3
    $\begingroup$ @Kaveh, François is in no way propose to make it mandatory to write people name in their original scripts, he just wants to be able to do so. $\endgroup$ Jun 30, 2013 at 1:55
  • $\begingroup$ I'd even add to Mariano's comment that it's not about being able to do so, but making work what some people try already (but does not work). @Kaveh: there is a difference between using a (correct) transliteration and dropping diacritics. For example, on the Wiki page (the English one) it says Gödel, only this, on that of Markov one has Markov and the original. The correct way to write Gödel in English is like this; Godel is simply wrong (of course it is very minor error and should definitely be tolerated but it is still wrong) while using a correct transliteration is not wrong. $\endgroup$
    – user9072
    Jun 30, 2013 at 11:54

2 Answers 2

7
$\begingroup$

So you want to load even more javascript on us so that you don't have to remember how to input unicode characters?

I can write "François" by pressing Alt+c to get the ç on my keyboard.

If I forget the unicode, I can use a little PHP script that I wrote some time back to convert basic LaTeX accent code into unicode. You can find it at http://www.math.ntnu.no/~stacey/code/latexToUTF/utf.php

The above works on single commands. If you want to put in whole sentences, such as "Fran\c{c}ois Dorias asked for a way to type Erd\H{o}s", try http://www.math.ntnu.no/~stacey/PHPLaTeX/index.php which will yield:

François Dorais asked for a way to type Erdős

$\endgroup$
17
  • 2
    $\begingroup$ This wouldn't be JS, it would be server side. $\endgroup$ Jun 29, 2013 at 21:15
  • $\begingroup$ @Manishearth So you'd load it into the Markdown parser? Even so, it's not a great idea. How many different ways of entering unicode characters would you like to support? We already have direct unicode characters and entities. The more possibilities that you add in, then the more chance there is of bizarre behaviour. $\endgroup$ Jun 29, 2013 at 21:38
  • $\begingroup$ Not too bizarre an idea, other sites have similar site-specific syntax (check out Poker or Chess). As long as an important subset of the symbol list is supported, it ought to be fine. $\endgroup$ Jun 29, 2013 at 21:43
  • $\begingroup$ Actually, that script is exactly what the last user asked for! Thanks! $\endgroup$ Jun 29, 2013 at 21:47
  • $\begingroup$ Would it be hard to have it recognize more complex expressions? E.g. if I could type Erd\H{o}s to get Erdős. $\endgroup$ Jun 29, 2013 at 21:52
  • $\begingroup$ (By the way, this is not for me: I don't want anything of the kind, I just get tired of adding disclaimers all the time.) $\endgroup$ Jun 29, 2013 at 21:59
  • $\begingroup$ @Manishearth But where would you stop? There is a huge number of unicode characters with "simple" LaTeX macros. Would you support all of them? You may as well just run TeX on the user input and be done with it! $\endgroup$ Jun 29, 2013 at 22:42
  • $\begingroup$ @FrançoisG.Dorais Shouldn't be too hard to add. I'll consider that a feature request. $\endgroup$ Jun 29, 2013 at 22:42
  • $\begingroup$ Thanks Andrew ! $\endgroup$ Jun 29, 2013 at 22:44
  • 4
    $\begingroup$ People should explore their OSes and find out how to produce `weird' characters: it is surprisingly easy in most of them (and it does not involve remembering unicode point numbers in any OS I use, at least) $\endgroup$ Jun 30, 2013 at 1:58
  • $\begingroup$ +1 for Mariano's comment. Actually, even in LaTeX, I think \usepackage{inputenc} and native input is recommended over macros --- I recall reading on tex.se that there are some subtle hyphenation and pdf issues if one uses "the old way". $\endgroup$ Jul 2, 2013 at 9:13
  • 2
    $\begingroup$ @FedericoPoloni My reading of tex.stackexchange.com/a/44699/86 is that this is not the case. inputenc transforms the characters into their macro equivalents. It is fontenc that is crucial for hypenation. However, I agree with the endorsement of Mariano's comment. $\endgroup$ Jul 2, 2013 at 10:43
  • $\begingroup$ You are right, I mixed up the two packages. There is still a benefit in using real accented characters in your source rather than TeX macros though: they work with spellcheckers. $\endgroup$ Jul 2, 2013 at 11:13
  • $\begingroup$ @FrançoisG.Dorais See latest edit. I remembered why I wrote the utf.php script as a single command issue: parsing TeX in a non-TeX language is a nightmare. Fortunately, I also remembered that I'd already done it in PHP and that script works for more complex expressions. $\endgroup$ Jul 2, 2013 at 11:44
  • $\begingroup$ Thanks Andrew! It's a fantastic tool. $\endgroup$ Jul 3, 2013 at 3:35
5
$\begingroup$

HTML entities already work on Math Overflow, and the non-numeric ones are not too hard to remember

  • Eduard Čech / Eduard Čech
  • François G. Dorais / François G. Dorais
  • Kurt Gödel / Kurt Gödel
  • George Pólya / George Pólya

For example, the HTML entity for an accented letter (replacing - with the letter) is:

  • &-cedil;:Çedilla
  • &-uml:Ümlaut
  • &-caron: Čaron
  • &-acute: Ácute
  • &-grave: Gràve

I cannot find non-numeric entities for the others, though. This would be a nice feature.

I'll see if I can userscript a virtual keyboard that behaves similarly to this one

$\endgroup$
5
  • 2
    $\begingroup$ The idea is that mathematicians already have a way that they use all the time. Support for HTML entities is not uniform: čaron, çedil, ümlaut,... $\endgroup$ Jun 29, 2013 at 20:20
  • $\begingroup$ @FrançoisG.Dorais I know :) I'm not sure if this has a chance of being implemented. However, I will try to modify my IPA Keyboard script to fit this. $\endgroup$ Jun 29, 2013 at 20:23
  • $\begingroup$ It is slightly ironic that there are words with wrong diacritics in this answer (but I assume this is intentional). Otherwise, while it does not really answer the question, I think it could be useful for some to have the information around. My way of doing it is copying from somewhere else, typically Wikipedia, which works well for me. $\endgroup$
    – user9072
    Jun 29, 2013 at 20:53
  • $\begingroup$ @quid yeah, it was intentional, just to make it clear which accent is which. $\endgroup$ Jun 29, 2013 at 21:19
  • $\begingroup$ Character escapes are not recommended by the W3C (w3.org/International/questions/qa-escape). Our pages are encoded in UTF-8, so there's absolutely no reason to obfuscate text by using unnecessary character escapes! It's been a very long time since this was the correct way to handle "foreign" characters, so I don't think dredging it up now is useful. $\endgroup$ Jul 6, 2013 at 19:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .