4

I'm editing .tex files in Texshop, that others are editing in Vim or Emacs.

However, when I open their files, I only get 10-12 words per line, so that there are very frequent line breaks. I believe this has to do with the window size in their editors, and Texshop is honoring those linebreaks.

This is very obnoxious because I get weird
blocks of text that read like this. Which
is very jarring. I find it difficult to
follow the writing and read things properly
when each line is only a handful of words.
I'm trying to write prose, not a poem.

Is there anything I can do so that I can have Texshop show nice, full lines of text in the editor? Currently, I have to delete the linebreak/return and respace, but that's obviously a terrible solution.

4
  • 1
    It's not about their window size but habits. As a program I cut every line to have less than 80 chars/line. LaTeX should not insert newline without two linebreaks. I think it's just visual I think no? Oct 15, 2015 at 16:08
  • 1
    These linebreaks are added by the editors of your coworkers. The feature is called wrapping. For vim it's described here: vim.wikia.com/wiki/Word_wrap_without_line_breaks, for emacs here: emacswiki.org/emacs/LineWrap Sadly there is no chance for you to distinguish between the linebreaks added by wrapping and those "real" linebreaks you want Oct 15, 2015 at 16:12
  • Related: tex.stackexchange.com/q/54140/36686 I favour the style of your colleagues when using version control. Also, if you do it properly, it may increase readability by breaking the lines in semantically meaningful places.
    – Bordaigorl
    Oct 15, 2015 at 16:45
  • It is just visual. If the line breaks were semantically meaningful, I wouldn't be concerned. However, the hard-wrapping (thanks for the explanation) is semantically arbitrary and leads to these vertical columns of text that aren't really conducive to writing and comprehension.
    – Daniel
    Oct 16, 2015 at 15:34

1 Answer 1

1

It's not the editors per-se but an habit of your coauthors of using hard-wrapping, i.e. the practice of inserting new line characters to manually wrap code.

This of course will not make a difference for TeX (in common contexts, not in verbatim for example).

The clear disadvantage is that if their line length is longer than your view and you have soft-wrapping enabled you would get very hard to read text.

The advantages can be many:

  1. if you are using version control like git or hg breaking lines can help keep the diffs small and readable.

  2. When done properly it can increase readability:

    When hard-wrapping is done properly,
      like for example in this very paragraph,
    it can convey meaning and structure to your text.
    

See the related question.

If you are keen on starting a whitespace war you can always use search/replace with a regex to remove the hard-wraps in very short lines: search for

^(.{1,50})\n(?!\n)

and replace with $1 (the regex syntax follows the one used by Sublime Text).

2
  • I don't like to think of this as starting a "white space war." Particularly when one persons habit and preferred style negatively impacts others (who, then, really started the war? :)) Thanks for the regex tip, but I think the general suggestion of following some semantic rules when breaking lines will help everyone the most!
    – Daniel
    Oct 16, 2015 at 15:41
  • :) by whitespace war I meant the result of changing back and forth between hard and soft wars, of course agreement after negotiation is much better!
    – Bordaigorl
    Oct 16, 2015 at 15:42

You must log in to answer this question.

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