From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Re: \nbsp usage Date: Wed, 14 Jul 2010 00:23:18 -0400 Message-ID: <8625.1279081398@gamaville.dokosmarshall.org> References: <874og2x5jh.fsf@gollum.intra.norang.ca> Reply-To: nicholas.dokos@hp.com Return-path: Received: from [140.186.70.92] (port=37185 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OYtVP-0004m9-0l for emacs-orgmode@gnu.org; Wed, 14 Jul 2010 00:23:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OYtVN-0005QS-SV for emacs-orgmode@gnu.org; Wed, 14 Jul 2010 00:23:35 -0400 Received: from vms173003pub.verizon.net ([206.46.173.3]:61513) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OYtVN-0005QD-PQ for emacs-orgmode@gnu.org; Wed, 14 Jul 2010 00:23:33 -0400 Received: from gamaville.dokosmarshall.org ([unknown] [173.76.32.106]) by vms173003.mailsrvcs.net (Sun Java(tm) System Messaging Server 7u2-7.02 32bit (built Apr 16 2009)) with ESMTPA id <0L5J0074C5IVXWA0@vms173003.mailsrvcs.net> for emacs-orgmode@gnu.org; Tue, 13 Jul 2010 23:23:19 -0500 (CDT) In-reply-to: Message from Bernt Hansen of "Tue, 13 Jul 2010 20:37:06 EDT." <874og2x5jh.fsf@gollum.intra.norang.ca> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Bernt Hansen Cc: nicholas.dokos@hp.com, emacs-orgmode@gnu.org Bernt Hansen wrote: > Erik Butz writes: > > > Hi all, > > > > I have a somewhat stupid problem, but didn't find a solution in the > > manual or the list archive. > > I want to use the \nbsp macro to generate a '~' symbol for Latex, but > > I don't seem to get it to work correctly in my case. > > I want to write 200~m=C2=B2 > > > > If I do: 200\nbspm^2 > > it gets exported as: 200\nbspm$^2$, so the symbol is not recognized. > > > > If I do: 200\nbsp m^2 > > it gets exported as 198~ m$^2$, so in addition to the nbsp there is > > another space at which a linebreak can occur > > > > trying: 200\nbsp{}m^2 in analogy to other commands > > I get: 200~\{\}m$^2$, so the parentheses are not recognized as > > belonging to the command. > > > > I am using the latest org version (just did a git pull and checked > > that the behavior is still there) with emacs 23.1.1 > > > > Any hints appreciated. > > Hi Erik, > > This seems to work for me: > > ,----[ sample org file ] > | * nbsp > | If I do: one two three four five six seven eight nine ten eleven twelve 2= > 00\nbsp m^2 it gets exported > `---- > > this exports as=20 > > ,----[ latex output ] > | ... > | \label{sec-1} > |=20 > | If I do: one two three four five six seven eight nine ten eleven twelve 2= > 00~ m\^{}2 it gets exported > | \end{document} > `---- > > and when I look at that as a PDF it doesn't break between the 200 and > m^2. I tried adding x and xx before the 200 and it pushes the entire > thing to the next line. I can't make it break on a line so 200 is at > the end of one line and m^2 is on the following line. > > Does this work for you? > Bernt, I suspect that you cannot decide the question with a simple experiment like this, but I have no counterexample to offer. However, Knuth warns explicitly (p.91 of my version of the TeXbook, paperback 19th printing, Oct. 1990) that "...you shouldn't leave any blanks next to the ~, since they will count as additional spaces." It may well be that TeX's line-breaking algorithm does the right thing in the example, but when push comes to shove in a *really* complicated situation, it might be forced to choose the space after the tilde to break the line at. Regards, Nick