2

I can't type latex on my laptop without sore hands. I use latex in org-mode to write math notes and my right pinky is always stretching for _, {, }, and \.

Does anyone advice for typing large amounts of latex? Alternative input methods or touch typing tips are welcome, as are obvious tips or alternatives. I can't understand how people do it.

skaffman
  • 398,947
  • 96
  • 818
  • 769
Natan Yellin
  • 6,063
  • 5
  • 38
  • 57
  • I switched to dvorak, (and then adjusted the layout for latex and programming) – aioobe Nov 08 '11 at 15:07
  • 2
    Should be moved to http://tex.stackexchange.com/ – Ocaso Protal Nov 08 '11 at 15:12
  • 1
    @OcasoProtal: No, this is not really a TeX-specific question, more about the used editor and keyboard. I think it could go to Super User. (Though in the current form it would be closed there as not constructive.) – Paŭlo Ebermann Nov 08 '11 at 17:37
  • @PaŭloEbermann I think it might make sense to keep it on SO since the SO seems to have a greater emacs community than SU. – N.N. Nov 08 '11 at 19:29

3 Answers3

6

Easing RSI is basically about

  1. typing as little as possible,
  2. typing as few commands that are trying on your hands as possible, and
  3. taking pauses so that your hands may rest.

The first point can obviously be taken care of by not writing when you don't have to. Technically the first point can be taken care of by reducing unnecessary input, e.g. by constructing your LaTeX code so that you have less redundancies, but overly doing this may obfuscate your code (you want it readable). Another way to technically take care of the first point is by using different tools such as the features of an editor or by configuring your environment. The second point may technically be taken care of the same way as the first. The third point may obviously taken care of by taking pauses which may be enforced by tools such as those in https://superuser.com/questions/305940/linux-software-for-periodical-work-break/306276#306276 but this point does not seem relevant if you're taking lectures notes or similar. Thus, I'll focus on technical solution to the first and the second point.

Snippets manager

To ease writing construct that you often write you could use a snippets manager/template system such as yasnippet. With such a solution you can create your own snippets to be more efficient and nicer to your fingers. For example you can make a snippet such that if you write align and press Tab it prints

\begin{align}

\end{align}

and places the cursor inside the environment.

AUCTeX's LaTeX-math-mode

Math symbols are often cumbersome to write because many of them starts with \. AUCTeX comes with functionality that makes it easier to type math symbols, see http://www.gnu.org/s/auctex/manual/auctex/Mathematics.html. To use it you press the key that calls (LaTeX-math-mode) (the default key is ` but that may not be optimal for your keyboard, so give it a good bind) and a defined key to write a math symbol, e.g. if you type ` and then f it prints \phi. Here's a reference for the default bindings ftp://ftp.gnu.org/gnu/auctex/11.82-extra/tex-ref.pdf.

Remapping

You could remap your keys so that the commands that hurts for you to type gets easier to type. If you're on Linux remapping can be done by xmodmap and XKB and you can also remap the keys internally in Emacs. For details on remapping specific to LaTeX see the following excellent answer https://tex.stackexchange.com/questions/1979/good-keyboard-layouts-for-typing-latex/1985#1985 (there's also a blog post introducing it http://tex.blogoverflow.com/2011/08/great-questions-i-save-your-fingers/) and note that the other answers to the linked question might interest you.

Community
  • 1
  • 1
N.N.
  • 8,336
  • 12
  • 54
  • 94
3

Auctex provides much better support for writing LaTeX than org-mode (as I recall, haven't used org-mode much). The most frequent LaTeX constructs that require _, {, } and \ are provided via more convenient keybindings: C-c C-e to add an environment, C-c C-m to add a macro etc. It also includes a whole suite of math-mode shortcuts too, so once you're familiar with it you'll be able to stay in "home position" more.

You can have the best of both - just bind a key to switch from org-mode to auctex if you want to use org-mode most of the time, and take advantage of Auctex only when adding specific LaTeX code.

Tyler
  • 9,872
  • 2
  • 33
  • 57
  • It looks like cdlatex mode (normally used with auctex, as I understand) is usable with org-mode: http://orgmode.org/manual/CDLaTeX-mode.html – Natan Yellin Nov 08 '11 at 18:34
2

You could try changing your keyboard layout. The qwerty layout was not designed to be ergonomic. It was designed to prevent the metal arms in typewriters from jamming, something that shouldn't be a problem on your laptop I think.

Dvorak is one possibility, where the characters are rearranged, so that the characters you type most often are on the home row, where little finger movement is needed.

Neo is another layout, which not only rearranges the characters. It also introduces two new modifier keys. Those modifiers make it possible to put all the characters you mention in good positions. One key used as a modifier is caps lock, so CAPS-a becomes \, CAPS-d {, CAPS-f } and CAPS-e _. Here is an image.

Neo is a German layout, so the first two layers (lowercase and uppercase characters) are not good for English text, but you can download the xmodmap and just use the third layer for "programming characters".

chrm
  • 1,258
  • 1
  • 11
  • 16
  • I thought about using Dvorak, but I'm not sure my brain can handle the intricacies of using vim mnemonic motions (like `dd`) with a Dvorak setup. (I use evil to emulate vim in emacs.) All the same, Neo is very cool. :) – Natan Yellin Nov 08 '11 at 20:08
  • If you don't want to change the complete layout, just change one key into a modifier and put the characters making problems on the home row, using the modifier key. This will work everywhere if you use xmodmap. – chrm Nov 08 '11 at 21:11