# Bookmarklet plugin to speed up LaTeX macro typing

I've developed a little tool that assists in writing LaTeX macros. It works the same as the OSX press and hold accent picker. You press a key, and then there will appear a pop menu, with symbols related to that key. For example if you press and hold =, you will get the following pop-up:

You can then select the symbol, press the number associated with the key, or tab to the right symbol by pressing the key again. After the symbol is selected, it will convert the symbol to the LaTeX macro.

For every key, there are some LaTeX macros related to it, for example the letter 'a' relates to \alpha or \angle or \land or \mathfraktur{a} etc. So I've tried to order the LaTeX macros, by relating them to a key you can type.

In this way, you can write quite fast, for example, just by pressing two keys (= and 6) you can get a macro like \Longleftrightarrow.

Anyway, I hope this tool can be useful for people. You can use it at MSE using a bookmarklet (similar to chatjax), that you can find here: http://kasperpeulen.github.io/PressAndHold/index.html

Edit: The bookmarklet didn't work in firefox, but this is now fixed.

• Nice work! I was playing around with it, and it seems that <kbd>:</kbd>+<kbd>1</kbd> (\Colon) does not render with MathJax. – apnorton Sep 14 '14 at 20:28
• Err... :+1. I thought <kbd> was a tag we recognized in comments... – apnorton Sep 14 '14 at 20:34
• @anorton No HTML in comments at all, only mini-markdown: bold, italics, links. – user147263 Sep 14 '14 at 20:57
• While I appreciate the initiative, I think there should be some change regarding the trigger that invokes the menu. Current method i.e., holding down a key is very difficult for people who touch type fast. Frankly, I can't think about any other method. – d80d2729a352b1366139fc119d3345 Sep 15 '14 at 6:24
• @anorton thanks, fixed that now ! – Kasper Sep 15 '14 at 13:07
• @Moron Do you mean typing on an ipad or something? The menu now popups if you press a key longer than 200 ms, I could shorten that time, but I think that this will maybe trigger the menu too much. – Kasper Sep 15 '14 at 13:09
• @Kasper: no, I meant typing on a normal keyboard. – d80d2729a352b1366139fc119d3345 Sep 15 '14 at 14:10
• @Moron Oh, I thought you meant typing on a touch device, but now I see what touch typing en.wikipedia.org/wiki/Touch_typing means, but what is the problem with holding down a key then ? Does it takes too long before the pop up appears ? – Kasper Sep 15 '14 at 14:16
• @Kasper: not really. I leave the key as soon as I feel the tactile feedback. I mean, I'm used or trained to leave the key as fast as possible which makes holding difficult. – d80d2729a352b1366139fc119d3345 Sep 15 '14 at 14:32
• @Moron Ah okay, I understand I guess. What I could do is, maybe open the popup menu with some trigger key – Kasper Sep 15 '14 at 14:34
• Sadly, I cannot seem to make it work in Chrome. Wait. I did. Kind of, I think. – Emily Sep 16 '14 at 19:28
• This is amazing! What you should add is, if you can, other scripts, such as \mathscr, etc. – user122283 Sep 19 '14 at 1:07
• Awesome. I bookmarked it and will use it often. Do you plan to expand it? – Hal Sep 22 '14 at 15:17
• On my AZERTY keyboard this breaks the ^ key ! – Hippalectryon Sep 22 '14 at 17:18
• @Hal surely, if you have feedback how to expand, improve it, you can leave a message at github: github.com/kasperpeulen/PressAndHold/issues – Kasper Sep 22 '14 at 17:18