NatLatex: a system for dictating latex files using NaturallySpeaking(TM)

Note: while the NatLatex documentation is specific to NaturallySpeaking, very little of the system itself is. It should be possible to use NatLatex with other continuous speech recognition systems, as long as they allow you to define words with different written and spoken forms, and include a Vocabulary Builder-like utility to adapt their language models to your documents.

Introduction

For dictating latex documents, I created a system I call NatLatex. Basically, I dictate in a sort of pseudo-LaTeX English syntax which I made up. Then, I run the resulting file through a Perl script which translates it to true latex. Here is a sample of the pseudo-latex, from the paper I'm working on now:

$${d Greek Sigma sub X over dE} equals {1 over 4 Greek pi (1 plus z) to the power 3} integral with respect to l (thin space) n sub e squared {d Lambda (T sub e, E to the power prime) over dE to the power prime},$$
where "z" is the redshift of the cluster, "E" is the photon energy in
the observer's frame, "E to the power prime defined equal to E (1 plus
z)" is the rest frame photon energy, and "d Greek Lambda (T sub e, E to
the power prime) / dE to the power prime" is the X-ray spectral
emissivity.


(You'll notice that I use double quotes instead of \$ for inline equations, because "open-quote" and "close-quote" have the right spacing behavior.)

Having a separate translation phase isn't too big a deal, since you need to do that with latex anyway. The advantage is that, in the pseudo-latex form, latex macros are encoded as ordinary text without backslashes, so they can be dictated as ordinary NaturallySpeaking words. (Internally, NaturallySpeaking uses a backslash to separate the written and spoken forms of words, so it doesn't allow backslashes in either form). That way, you avoid using NaturallySpeaking macros, which would force you to pause between symbols.

Also, you can set it up so that "equals", "plus" get translated to "=", "+", etc. instead of having to say equal-sign or trying to train NaturallySpeaking to type "equals" as "=". And, you can allow for multiple different ways of saying the same symbol ("integral" or "integral sign") so you don't have to remember exactly which form you chose. I've added pseudo-latex forms for the latex macros I use frequently in astrophysics, but NatLatex is set up with configuration files so that you can add your own, or change the preferred pseudo-latex forms.

I define directives to tell the translator to leave certain sections of the pseudo-latex file untranslated. That way, I don't need to bothered to provide a complete Latex parser or translations for all latex macros. (Things outside the body of latex documents, like my Latex macro definitions, title page, etc. I usually just copy from my last paper and edit anyway.)

To increase accuracy, I add the pseudo-latex forms of my macros to NaturallySpeaking as vocabulary words. Also, I have a reverse translator to turn latex files into pseudo-latex, so that they can be run through the vocabulary builder to let NaturallySpeaking adapt its language model. (I suggest using a separate vocabulary or user, to avoid messing up the language model in use for ordinary dictation).

I dictate my pseudo-latex directly in the NaturallySpeaking editor, so that I can take advantage of the full correction-by-voice features. However, in principle, VR mode for Emacs would also provide full correction-by-voice.