I'm currently testing sublime text + latextools for my typing needs (I've been using emacs+auctex for quite a while). So far I think I can get used to it. But the one thing I can't get straight is how to keep my LaTeX code tidy. In emacs+auctex I just use hard wrap and easily reflow the text when it becomes untidy, by doing something like C-c,C-q,C-p.

I have googled this but I haven't found a good answer. I tried some of the wrapping packages but they don't seem to work nicely with LaTeX. Maybe it is better to just use soft wrapping?

BTW, part of my problem is that I often share LaTeX files with my coauthors, who mess with the format, so I like to have the option of easily tidying everything up from the editor (as in emacs+auctex).

  • 1
    Hello! What is your question here? Is it only "Maybe it is better to just use soft wrapping?" I don't think we can answer that kind of question here, except by giving opinions which is typically not going to lead to great answers. Can you please clarify your post to ask a specific question that we can answer without giving opinions? Thank you! – darthbith Mar 11 '15 at 14:45
  • That said, I will happily give you my opinion in a comment :-) My opinion is to use soft wrapping and enable auto-indent in Sublime Text. I use LaTeXing instead of LaTeX Tools, but I think they function similarly. The reason to use soft wrapping instead of hard wrapping is for version control. If you use soft wrapping with one sentence per line, then you can easily control your commits and see when a sentence changed and how it changed in the VC system. If you have hard wraps, this is more difficult to accomplish. – darthbith Mar 11 '15 at 14:49
  • Thanks darthbith. Maybe I didn't really phrase my question very clearly, but what I was looking for was something like your answer, basically an opinion on how to do things in a reasonable way. But then the other part of my question would be how to deal with indenting. I tried using the indentation rules in [gist.github.com/albertxing/5298255] but somehow it didn't work. Maybe I didn't put them in the right place, but I was wondering what other people do. Thanks again! – Muad Nu Mar 11 '15 at 21:32
  • I use the default auto-indent settings of Sublime Text (so far as I know), unless LaTeXing changes them. This means that every environment is indented by four spaces (I also prefer spaces to tabs, but that's because I work with Python). I'm also not very consistent with indentation, as I find it doesn't help readability that much in LaTeX :-) – darthbith Mar 11 '15 at 23:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.