12

I was looking for an Latex editor that has an auto completion function. Is there any available?

I thought about auto complete suggestion for common commands like for example defining chapters and sections etc.

5
  • 1
    TeXworks, Kile, WinEdt, VIM, Emacs and many others.
    – Leo Liu
    Mar 10, 2011 at 10:24
  • 1
    List of LaTeX IDEs
    – Seamus
    Mar 10, 2011 at 13:20
  • @Leo Editting any file not with vim would be a pain. How does vim achieve the autocompletion?
    – Covi
    Mar 11, 2011 at 10:57
  • @Thanks for all the answers. I realized now that I should have asked how does autocompletion work in TexWorks ad not which IDE supports autocompletion. Mar 11, 2011 at 11:50
  • For mathematical formula auto-complete in Tex, you can use mathcha.io Its an online editor and easy to use for folks who dont understand much Math Tex Aug 22, 2021 at 12:05

6 Answers 6

11

Here is a list of LaTeX IDEs

While emacs+AucTeX doesn't have "autocompletion" per se but it does have something that performs the same role, and performs it better (obviously).

Let's take the example of adding section headings. With autocompletion I start writing \sec... and then press TAB or some such autocomplete key.

With emacs, you press Ctrl+C and then Ctrl+S and emacs asks you what level of sectioning you want. You type sec... and then TAB to autocomplete. Then emacs asks you how you'd like to label that section (I want to call this section foo). It automatically adds a \label{sec:foo} below your \section command.

Fine. But here's the really useful part. Let's say you want an environment: Ctrl+C then Ctrl+E. Then emacs asks you what kind of environment you want. And if you tell it you want an environment emacs understands, like minipage it will ask you for its compulsory arguments (width, for minipage). It will then create the environment and put you between the \begin and \end tags.

More cool features of emacs: abbrev-mode which is basically auto-complete on magic!

And the smart ` : Typing ` then a gives you \alpha likewise for other greek letters. ` then pressing the right arrow key gives you \rightarrow Likewise for other arrow directions...

Also, you get like, 100 geek points just for using emacs. Fact.

4
  • 1
    It's worth mentioning that emacs's abbrev mode (ie. autocompletion) will complete any word, not just LaTeX macros, which is very handy if you use a lot of long words. Its sibling, dabbrev mode, can automatically fix typos like "teh" and do other useful and fully automatic text replacement. Mar 11, 2011 at 14:16
  • @Ross Thats a good point. I don't use abbrev mode much myself...
    – Seamus
    Mar 11, 2011 at 15:10
  • 1
    in emacs [Ctrl+c] then [Ctrl+m] will prompt you for the name of a macro, hit tab, and it will autocomplete (in the minibuffer). There is probably a way to add this directly to the [tab] key after typing ``.
    – Mortimer
    Mar 11, 2011 at 15:19
  • 1
    It's not nearly as well-developed as AucTeX, but Ultra-TeX mode for Emacs does autocompletion: hit the backslash key, and it starts completing on TeX commands, using a list constructed by the user (although Ultra-TeX comes with a starter list) and also from "newcommands", etc., in the current document. Mar 11, 2011 at 19:48
5

TeXworks has some builtin autocompletion, but take a look at the script autocompleteForTexworks. The script can perform completion on long words earlier used in your document, labels and filenames for \input, \include and \includegraphics macros.

There is a video of it in action on youtube.

Guide to use.

  1. start typing the long word that should be autocompleted
  2. press Crtl + M and the autocompleter will complete the word or at least make a suggestion for a completion.
  3. if not satisfied with the suggestion press Crtl + M until the correct word is found.

Disclaimer: I'm author of the autocomplete script.

1
  • I can't use the scripts. I copied the files based on the instruction, but as I hit the Reload button, it does not recognize the two JS files. Any idea why? Thank you.
    – Vahid
    Jan 24, 2013 at 18:37
4

TexnicCenter in windows also has a completion function with Ctrl+space and additional custom commands can be added in xml files in the TexnicCenter program folder

0
3

You did not specify your OS, but if you're running GNU/Linux, you should have a look at Kile, which does that to some extent. Here's a screenshot illustrating that feature.

2
  • Kile theoretically can be compiled and run on Windows as well.
    – David Z
    Mar 11, 2011 at 19:55
  • "To some extent"? Kile is amazing in that it even recognizes macros I defined myself and knows how many parameters they take. ... sometimes at least, so ... yeah, maybe "to some extent" was accurate.
    – Christian
    Jan 24, 2013 at 19:37
3

Multiplatform TeXworks has autocomplete (using tab). Texmaker and TeXlipse (Ctrl+space) have it and are multiplatform as well. I am hard pressed to think of any that do not offer it.

0

Atom is a text editor that can be extended with packages. People have made a wide range of these, giving you latex compilation, syntax highlighting, autocompletion and practically anything else that might be useful.

Plus, if it doesn't exist already, there's always the option to write the package yourself. You can then publish it, so everyone can access it.

Edit: I wrote an autocomplete package for it. It's highly customisable, and suggestions for features / improvements are welcome.

You must log in to answer this question.

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