31
$\begingroup$

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: image

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.

$\endgroup$
  • 2
    $\begingroup$ Nice work! I was playing around with it, and it seems that <kbd>:</kbd>+<kbd>1</kbd> (\Colon) does not render with MathJax. $\endgroup$ – apnorton Sep 14 '14 at 20:28
  • 1
    $\begingroup$ Err... :+1. I thought <kbd> was a tag we recognized in comments... $\endgroup$ – apnorton Sep 14 '14 at 20:34
  • 3
    $\begingroup$ @anorton No HTML in comments at all, only mini-markdown: bold, italics, links. $\endgroup$ – user147263 Sep 14 '14 at 20:57
  • $\begingroup$ 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. $\endgroup$ – d80d2729a352b1366139fc119d3345 Sep 15 '14 at 6:24
  • 1
    $\begingroup$ @anorton thanks, fixed that now ! $\endgroup$ – Kasper Sep 15 '14 at 13:07
  • $\begingroup$ @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. $\endgroup$ – Kasper Sep 15 '14 at 13:09
  • $\begingroup$ @Kasper: no, I meant typing on a normal keyboard. $\endgroup$ – d80d2729a352b1366139fc119d3345 Sep 15 '14 at 14:10
  • $\begingroup$ @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 ? $\endgroup$ – Kasper Sep 15 '14 at 14:16
  • $\begingroup$ @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. $\endgroup$ – d80d2729a352b1366139fc119d3345 Sep 15 '14 at 14:32
  • $\begingroup$ @Moron Ah okay, I understand I guess. What I could do is, maybe open the popup menu with some trigger key $\endgroup$ – Kasper Sep 15 '14 at 14:34
  • $\begingroup$ Sadly, I cannot seem to make it work in Chrome. Wait. I did. Kind of, I think. $\endgroup$ – Emily Sep 16 '14 at 19:28
  • 2
    $\begingroup$ This is amazing! What you should add is, if you can, other scripts, such as \mathscr, etc. $\endgroup$ – user122283 Sep 19 '14 at 1:07
  • $\begingroup$ Awesome. I bookmarked it and will use it often. Do you plan to expand it? $\endgroup$ – Hal Sep 22 '14 at 15:17
  • $\begingroup$ On my AZERTY keyboard this breaks the ^ key ! $\endgroup$ – Hippalectryon Sep 22 '14 at 17:18
  • $\begingroup$ @Hal surely, if you have feedback how to expand, improve it, you can leave a message at github: github.com/kasperpeulen/PressAndHold/issues $\endgroup$ – Kasper Sep 22 '14 at 17:18

You must log in to answer this question.

Browse other questions tagged .