[texhax] On the \\ problem

Michael Barr barr at math.mcgill.ca
Mon Mar 25 16:42:55 CET 2013


Let me start by saying that I am not interested in a flame war over my OS 
or editor.  My editor is one I have been using since 1984 and I will not 
change it.  My OS is windows and I will not change that either.  I did try 
Linux for a few years, but gave up since I could not find an editor that 
suited me.  Emacs is unquestionably powerful, but I could not use it.  I 
could not figure out even the magic incantation that enabled word wrap. 
(I had a .emacsrc file from an earlier version that did enable word wrap, 
but failed with this version.)  I am accustomed to this editor I have been 
using for over 28 years and will not, at my age, change.

On failing of this editor, despite its unquestioned power, is the 
inability to search across line breaks.  It does regular expression 
searches and has other powerful features, but not that.  It includes a 
scripting language that would work, but I have forgotten how to use it and 
it just wasn't worth it to change.  So here is how I solved my problem. 
First I changed all instances of .\\ to .  Ditto for $\\ since only 
paragraph ends could appear after formulas.  There were still quite a few 
\\, mostly correct.  So I asked the editor to display all lines and only 
those lines that contained a string "\\ [lots of blanks]". 
along with one line below (and, unfortunately, one above) each of them.  I 
then eyeballed all of the them and deleted by hand the \\ that were 
followed by a blank line.  It took me much less time than it would have to 
relearn the scripting language and infinitely less that to learn a whole 
nother editor.

Michael

On Fri, 22 Mar 2013, Robert Wilson wrote:

> Don't replace \\<NL><NL> with \\<NL>, replace it with <NL><NL> LaTeX basically ignores whitespace, so 5
> consecutive new lines is equivalent to 2 (but different than a single new line).
> 
> The \\ is the problem; that's what you need to get rid of. As Pierre mentioned, the substitution is
> straightforward in emacs, but as far as I know can't be done in, e.g. MS notepad. What text editor are you
> using?
> 
> And yes, it's likely you will have to spot check to verify you didn't replace anything you didn't mean to.
> (This is what grad students do best :-)
> 
> -Bob
> 
> 
> On Fri, Mar 22, 2013 at 6:10 PM, Michael Barr <barr at math.mcgill.ca> wrote:
>       To all those who suggested changing \\<NL><NL> to \\<NL> it doesn't and really cannot work.  I
>       got some mysterious error messages (mostly owing to \\ followed by a blank line inside xy-pic
>       constructions, although one I couldn't track down).  But I fixed that and compiled the
>       document.  The trouble is that now the entire article (or, to be precise, each chapter) is now
>       a single paragraph and set that way.  Thus there are no \parskip and no \parindent and, while
>       you could omit either one, you cannot omit both and have a readable document.
>
>       Thanks for trying.
>
>       Michael
>
>       --
>       The modern conservative is engaged in one of man's oldest exercises in
>       moral philosophy--the search for a superior moral justification
>       for selfishness.  --J.K. Galbraith
>       _______________________________________________
>       TeX FAQ: http://www.tex.ac.uk/faq
>       Mailing list archives: http://tug.org/pipermail/texhax/
>       More links: http://tug.org/begin.html
>
>       Automated subscription management: http://tug.org/mailman/listinfo/texhax
>       Human mailing list managers: postmaster at tug.org
> 
> 
> 
>

-- 
The modern conservative is engaged in one of man's oldest exercises in
moral philosophy--the search for a superior moral justification
for selfishness.  --J.K. Galbraith


More information about the texhax mailing list