As I am using version control (hg) it is convenient to have hard line breaks in my tex files.
Is there a way to set up TeXShop so that it automatically inserts line breaks? (For instance, as I am typing, at some fixed maximum width.)
If this is not possible, is there a convenient command line way to insert hard line breaks into a whole file automatically? (I tried, for instance, "cat longlines.tex | tr '\r' '\n' > shortlines.tex", but this does not work because TeXShop does not even put in Mac breaks '\r'.)
fmtprogram on unix. – Andrew Stacey May 09 '11 at 19:42fmtprogram? That inserts the line breaks for you (but I don't know how safe it is with regard to TeX - it might break some stuff in the preamble by inserting line breaks when there shouldn't be any). – Andrew Stacey May 11 '11 at 08:38-sflag to ensure that it only split lines. Also you should run it first with the options-p %to break comment lines and preserve the comment character (if you don't have long comment lines, this is unnecessary). Even so, I would re-tex the document after formatting it to ensure that it hasn't changed (doing adiffon the postscript is an easy way to check this - see the documentation on myfmtlatexprogram for comments on that). I'm still at a loss as to why you would want this, surely it makes a complete mess of the versioning! – Andrew Stacey May 11 '11 at 09:19