I've used TeXnicCenter almost exclusively over the rather short amount of time I've been using LaTeX. I like it quite a bit, except that wrapped parts of long lines are not indented at all. I would prefer for long lines to soft-wrap to the same indentation as the beginning of the line so that I can easily see the structure of my document.

Are there any good LaTeX IDEs out there that preserve the indentation of a line when word-wrapping?

Note the following:

  • To me, hard word wrapping is unacceptable.
  • I'm using Windows (obviously, given that I use TeXnicCenter).
  • I don't have any desire to learn Emacs or Vim at the moment, although I suspect they have ways to do this. Their learning curves are too steep for my current situation.
  • I think WinEdt has this feature, but it's not free.

Edit: This feature is now available in the current version of TeXnicCenter under view --> Same Indent for Wrapped Lines, so that's what I use. I've also become moderately proficient with Vim since I asked this question, but have never been able to find a good/simple way of preserving indentation for wrapped lines in Vim.


Did you try out TexMakerX http://texmakerx.sourceforge.net/? It is free, has a very, very powerful editor, is available for different platforms and it should do what you want (if I understood your question correctly, see example screenshot). enter image description here

| improve this answer | |
  • 2
    Note that this fork has been renamed to TexStudio, in case the link ever stops redirecting. – Sean Allred Sep 20 '13 at 22:35

Disclaimer, it doesn't answer the question. But I think is fine to have this info here.

And yet another one: TextMate.

Here is the question in Superuser.SX and here the link to the list.


Note: This applies only to TextMate 2.

  1. On the menu bar, select Bundles › Edit Bundles.

  2. Within the Bundle Editor display, select LaTeX › Settings. Once here, a list of preferences indicated by a white P on a gray circle is seen.

  3. On the menu bar again, click on New or press command-N. From the Bundle Editor display, TM will prompt you to choose what to create: bundle, command, setting, grammar, etc.

  4. Click setting. An untitled setting will appear in the Bundle Editor window.

  5. Name the new setting. I used Soft-wrap indent.

  6. Select the new setting if not already selected.

  7. In the text field, paste

    {   indentedSoftWrap = {
            match = '\A[ \t]*';
            format = '$0';

    This enables soft-wrap indent + 1 extra tab.

  8. If you wish to restrict this to a certain scope, it can be done in the drawer next to "scope selector." Leaving it blank will enable soft-wrap indentation for any text file.

  9. Save the setting by pressing command-S and close the Bundle Editor.

  10. Make sure soft wrap is enabled. (View › Soft Wrap). It might be necessary to reload any open files for the setting to take effect.

| improve this answer | |

Kile has this feature in Linux, and the authors claim that it can be run under Windows. I find this feature important as well!

| improve this answer | |
  • Kile runs (without any significant bug) in Windows using KDEWin, – fabikw May 27 '11 at 21:50
  • Yup, KDEwin + Kile also seems to work well for this. +1 – Brandon Jun 1 '11 at 19:40

Edit: This is now a part of the current version of TeXnicCenter, so there's no longer any need to build it from source.

After looking around some, I noticed that this feature has been requested and implemented for TeXnicCenter. However, there have not been any official releases of TeXnicCenter since it got implemented. The most recent release (TeXnicCenter 2 alpha 3) was put out about a month before it got implemented.

Since it's an important feature to me and I'm not very patient, I just got the source code to TeXnicCenter and built the tip of the stable branch myself, which was actually quite easy to do (for someone who programs and is familiar with version control software). However, it requires that you have Visual Studio 2010. Here's what I did:

  1. Download TortoiseHg and install it (TeXnicCenter uses Mercurial for version control, and TortoiseHg seems like the easiest way to use Mercurial on Windows).
  2. Clone the TeXnicCenter repository to your computer from the URL they list on sourceforge (http://texniccenter.hg.sourceforge.net:8000/hgroot/texniccenter/texniccenter).
  3. Update the working directory to the most recent commit in the stable branch.
  4. Open the Visual Studio 2010 solution, switch to the win32 Release configuration, and build it.
  5. Find and run TeXnicCenter from the exe in the newly created "Output" folder in the working directory.
  6. Under the "View" menu in TeXnicCenter, check the "Same Indent for Wrapped Lines" option.

This works for me, at least until the next version of TeXnicCenter is officially released.

| improve this answer | |

For the sake of completeness (the OP explicitly ruled out Vim...):

Vim does not (!!) provide indentation for soft-broken lines, which, honestly, is kind of ridiculous! As much as I like Vim, I also consider hard line breaks as totally unacceptable for LaTeX documents. Luckily, user eudoxos maintains a patch that adds this feature to Vim.

I have applied his patch successfully to MacVim a couple of years ago and since ever then it works like a charm.

Edit April 2017

Recent versions of vim (beginning with 8.x) now include the mentioned patch out of the box, thus, support indentation for wrapped lines with set breakindent.

| improve this answer | |
  • It is now possible with vanilla vim with the boolean option set breakindent. – marsupilam Apr 23 '17 at 19:09
  • @marsupilam: Indeed! Because of the patch I didn't update my vim installation for quite a while, but with vim8 the patch has been integrated. – Daniel Apr 23 '17 at 20:30
  • This answer has become kind of obsolete and could be deleted one day. I prefer to keep it for a while as many people still use vim < 8.0. – Daniel Apr 23 '17 at 20:36

It's seems this feature is being worked on for Gedit (see also Text Wrapping in Gedit).

| improve this answer | |

Sublime Text does it as well. Together with the LaTeXing or LaTeXTools packages, you have an IDE.


| improve this answer | |

Your Answer

