28

My standard procedure for writing mathematical email has been to use pidgin-LaTeX for some time now, and many of those I communicate with do the same. However, someone I know has recently started a few Unicode symbols for standard operations (arrows, etc) into the mix and this seems to greatly improve the readability.

When I've tried to do this, I spent a lot of time opening webpages looking for appropriate Unicode symbols and copy-pasting them. This roughly doubles my writing time. In an ideal world I could hit some kind of conversion button, or in a less ideal world I could put together a toolbar of commonly-used symbols.

Are there any methods for easily looking up some standard LaTeX symbols as Unicode, and further for doing so in an easily-accessible manner?

6
  • 4
    This is one of the reason why I use the Neo keyboard layout which has Greek letters and all kinds of mathematical symbols on it (e.g. →,∞,⊗,∫,ℝ, etc.).
    – Caramdir
    Commented Feb 19, 2011 at 22:02
  • One might perhaps write a short search-replace script for doing so.
    – ipavlic
    Commented Feb 19, 2011 at 22:04
  • @Caramdir, is it complicated to install this Neo layout? How would you do it in a GNU/Linux system, like Ubuntu or Fedora?
    – alfC
    Commented Apr 16, 2014 at 19:25
  • @alfC: It should come pre-installed. Just go to the keyboard settings in your desktop environment and you should find it under GermanNeo 2 (or something similar). For use in the shell directly (without X running) look up in the documentation of your distribution how to change the keyboard layout.
    – Caramdir
    Commented Apr 17, 2014 at 16:23
  • @alfC: If you can read German you'll find more information on their official site (neo-layout.org). Also be aware that a standard English (physical) keyboard will have the right Mod3 button in the wrong location and is missing the left Mod4 button altogether.
    – Caramdir
    Commented Apr 17, 2014 at 16:28

9 Answers 9

9

Following on from ipavlic's comment to the main question, here's a script that I threw together for almost exactly this purpose:

https://github.com/loopspace/latexToUTF

(My old PHP-enabled website has gone so I no longer have a "live" version, just the code on github. One day when I have a moment I will try to get it back up again.)

It was actually for typing unicode into webpage text boxes rather than email.

There is allegedly an extension to detexify that will give you the unicode instead of the LaTeX symbol, but I haven't seen a working version of it so can't comment further.

3
  • Thanks! One minor thing: I get an XML parse error for certain elements. It looks like the code on line 2248 should maybe end in symbols_one[$i] rather than symbols_one? Commented Feb 20, 2011 at 2:23
  • @coarsemoduli: Absolutely correct - thanks for the bug report. Just shows how often I use that for things like \nabla! (I use it mainly for accented characters) (Fixed now) Commented Feb 20, 2011 at 14:39
  • You link has become broken.
    – Ruslan
    Commented Mar 15, 2016 at 5:34
8

You may hit M-x describe-input-method RET TeX RET in Emacs. Here is a fragment of what you get:

\"x ẍ    \^h ĥ    \~e  ẽ    \=\AE Ǣ    \euro €    \doteq ≐    \square  □    \spadesuit  ♠    \vartriangleleft     ⊲
\"y ÿ    \^i î    \~i  ĩ    \=\ae ǣ    \e{e} ė    \equiv ≡    \subset  ⊂    \subseteqq  ⊆    \circlearrowright    ↻
\'A Á    \^j ĵ    \~n  ñ    \={A} Ā    \flat ♭    \frac1 ⅟    \succeq  ≽    \subsetneq  ⊊    \downrightharpoon    ⇂
\'C Ć    \^o ô    \~o  õ    \={E} Ē    \flqq «    \frown ⌢    \supset  ⊃    \supseteqq  ⊇    \ntrianglerighteq    ⋭

(By the way, this input method might be a nice way to actually type your emails - you type the TeX way, Emacs converts it to Unicode on the fly. And you don't have to use Emacs as your email client - even though it's a reasonable option - since you may configure it as an external editor in your MUA)

6
  • 1
    For the record, this is what I ended up using: a combination of the "It's All Text" extension for Firefox with Emacs set up to input text files in TeX mode. It works well. I wish I still had AUCTeX shortcuts, and there are a few symbols that I miss (the \Bbb array of characters is a little thin). Commented Nov 22, 2013 at 23:11
  • Nice. Why not use AUCTeX then? It's Emacs, after all, and you can configure it to your taste. You may either (a) assign some key binding to LaTeX-mode (which starts AUCTeX), or (b) configure "It's All Text" so that it starts Emacs in AUCTeX mode (I think at least that it should be possible, I don't use it (yet)).
    – mbork
    Commented Nov 23, 2013 at 9:47
  • And yet another thought: it's quite possible that Org-mode can export LaTeX markup to Unicode. And Org-mode is pretty awesome for lightweight markup (I personally use it sometimes to write emails, which I then copy to my email client. It' probably a shame I don't use Gnus, but I only have this much time to configure my stuff...).
    – mbork
    Commented Nov 23, 2013 at 9:50
  • So you can certainly turn AUCTeX mode on (I tried), but it turns out that, if you're not actually inputting the keystrokes, the shortcuts for \alpha etc don't have their text interpreted by tex-input-mode. This I'm less sure how to fix (I also only have so much time to configure my stuff). Commented Nov 23, 2013 at 14:15
  • so far as Org-mode, I use that too. But my personal experience is that as the number of tools needed to write the email increases, the chance that I'll actually use them drops off sharply. Commented Nov 23, 2013 at 14:17
4

For Gmail users, the quickest way to convert LaTeX to a mixture of unicode + html must be the following addon called "GmailTeX":

http://alexeev.org/gmailtex.html

It is currently available for Chrome, Firefox, Safari and Opera. Once installed, you can simply type $G\rtimes_\phi H$ to obtain G ⋊φ H, with φ displayed as a subscript via html markup.

4

Here's yet another option: unicode it.

1
  • Somewhat works, but translates e.g. \left to łeft or \implies to ℹmplies.
    – Ruslan
    Commented Mar 15, 2016 at 5:37
4

TeX to Unicode, a Chrome extension.

Convert TeX to Unicode by pressing Alt + w in input boxes.

https://golopot.github.io/tex-to-unicode/

(I am the author.)(Github)

1
  • Super! This is very handy. There is now also a Firefox add-on version.
    – Algernon
    Commented May 4 at 9:19
2

Here's another Unicode <-> LaTeX conversion tool

http://www.johndcook.com/unicode_latex.html

Courtesy of John D. Cook

2

You might find this tool handy:

http://latex2unicode.herokuapp.com/

It relies on an explicitly defined PEG grammar, and is probably more sophisticated and more robust than most other similar tools. It's also used by JabRef.

1

MacOSX answer for simple substitutions, not complicated equations.

Set up some replacement rules in System Preferences | Keyboard | Text. Then you can set \alpha to automatically change to α, etc. Other non-TeX substitutions like => to ⇒ can also be useful.

This is similar in scope to mbork's answer for emacs, but with rules that apply across many applications on one platform... but you have to set up the rules yourself.

I believe that this only works in applications that use the built-in MacOSX text-editing functionality. e.g. on my machine, it works in Apple Mail, Safari, TextEdit, TeXshop, but doesn't work in Firefox, BBEdit.

Fortunately it is per application, so it isn't available in Terminal, and you can turn it off in TeXshop!

On my last machine I used this sporadically for web forums, LMSs and e-mail, but I haven't set them up on my current machine, so I guess I haven't found them that useful.

1

Another option - I also made a little app. Initially based on the XML document described in this answer, but supports more commands.

https://digitalheir.github.io/latex-to-unicode-converter/

Especially useful if you're looking for a JavaScript API to parse / convert LaTeX.

You must log in to answer this question.

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