[OS X TeX] line breaks \n vs. \r ???

Maarten Sneep maarten.sneep at xs4all.nl
Mon Dec 17 13:52:07 EST 2007

On 17 dec 2007, at 18:36, Aaron Jackson wrote:

> On Dec 17, 2007, at 12:05 PM, Steffen Wolfrum wrote:
>> Hi,
>> when editing in TextWrangler a line break is found when using Grep  
>> and search for \r.
>> In TeXShop  a line break is found when using Regular Expressions  
>> and searching for \n: \r gives no result!
>> Now, I thought there are "More Options" ... "Serach syntax" can be  
>> changed.
>> But when I change here also to "Grep" then \r doesn't find line- 
>> breaks but the letter r !!
>> Is this a bug in TeXShop 2.14 ?
> Not a bug.  In Mac text files lines end in \r.  In Unix text files  
> lines end in \n.  In windows text files lines end in \r\n.   
> TextWrangler must save files in mac format while TeXShop saves them  
> in Unix format.  You can do a search for (\r(\n)?|\n) and that will  
> find end of lines in all of the text file types.

Not quite: TextWrangler (and BBedit) will use \r for a linebreak, no  
matter what the file is set to use when saving. But the origin of the  
\r, \n, and \r\n is correct.


More information about the MacOSX-TeX mailing list