* \nbsp usage
@ 2010-07-13 16:16 Erik Butz
2010-07-14 0:37 ` Bernt Hansen
0 siblings, 1 reply; 10+ messages in thread
From: Erik Butz @ 2010-07-13 16:16 UTC (permalink / raw)
To: emacs-orgmode
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²
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.
Thanks,
Erik
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: \nbsp usage
2010-07-13 16:16 \nbsp usage Erik Butz
@ 2010-07-14 0:37 ` Bernt Hansen
2010-07-14 4:23 ` Nick Dokos
0 siblings, 1 reply; 10+ messages in thread
From: Bernt Hansen @ 2010-07-14 0:37 UTC (permalink / raw)
To: Erik Butz; +Cc: emacs-orgmode
Erik Butz <erik.butz@googlemail.com> 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²
>
> 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 200\nbsp m^2 it gets exported
`----
this exports as
,----[ latex output ]
| ...
| \label{sec-1}
|
| If I do: one two three four five six seven eight nine ten eleven twelve 200~ 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
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Re: \nbsp usage
2010-07-14 0:37 ` Bernt Hansen
@ 2010-07-14 4:23 ` Nick Dokos
2010-07-14 7:19 ` Sébastien Vauban
2010-07-14 11:54 ` Bernt Hansen
0 siblings, 2 replies; 10+ messages in thread
From: Nick Dokos @ 2010-07-14 4:23 UTC (permalink / raw)
To: Bernt Hansen; +Cc: nicholas.dokos, emacs-orgmode
Bernt Hansen <bernt@norang.ca> wrote:
> Erik Butz <erik.butz@googlemail.com> 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
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: \nbsp usage
2010-07-14 4:23 ` Nick Dokos
@ 2010-07-14 7:19 ` Sébastien Vauban
2010-07-14 8:55 ` Carsten Dominik
2010-07-14 11:54 ` Bernt Hansen
1 sibling, 1 reply; 10+ messages in thread
From: Sébastien Vauban @ 2010-07-14 7:19 UTC (permalink / raw)
To: emacs-orgmode-mXXj517/zsQ
Hi Nick, Bernt, Erik and the rest,
Nick Dokos wrote:
> Bernt Hansen <bernt-CNteSEi18yz3fQ9qLvQP4Q@public.gmane.org> wrote:
>> Erik Butz <erik.butz-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> writes:
>>>
>>> If I do: 200\nbspm^2
>>> it gets exported as: 200\nbspm$^2$, so the symbol is not recognized.
My solution is to insert a real non-breaking space (yes, it does exist, as a
different character from the space), almost invisible (light gray, by choice)
under Emacs, and correctly handled in LaTeX.
See http://comments.gmane.org/gmane.emacs.orgmode/24716
and http://article.gmane.org/gmane.emacs.orgmode/15116.
Best regards,
Seb
--
Sébastien Vauban
_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode-mXXj517/zsQ@public.gmane.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Re: \nbsp usage
2010-07-14 7:19 ` Sébastien Vauban
@ 2010-07-14 8:55 ` Carsten Dominik
2010-07-14 11:37 ` Erik Butz
0 siblings, 1 reply; 10+ messages in thread
From: Carsten Dominik @ 2010-07-14 8:55 UTC (permalink / raw)
To: Sébastien Vauban; +Cc: emacs-orgmode
Hi everyone,
20\nbsp{}m^2 should now work.
Thanks!
- Carsten
On Jul 14, 2010, at 9:19 AM, Sébastien Vauban wrote:
> Hi Nick, Bernt, Erik and the rest,
>
> Nick Dokos wrote:
>> Bernt Hansen <bernt@norang.ca> wrote:
>>> Erik Butz <erik.butz@googlemail.com> writes:
>>>>
>>>> If I do: 200\nbspm^2
>>>> it gets exported as: 200\nbspm$^2$, so the symbol is not
>>>> recognized.
>
> My solution is to insert a real non-breaking space (yes, it does
> exist, as a
> different character from the space), almost invisible (light gray,
> by choice)
> under Emacs, and correctly handled in LaTeX.
>
> See http://comments.gmane.org/gmane.emacs.orgmode/24716
> and http://article.gmane.org/gmane.emacs.orgmode/15116.
>
> Best regards,
> Seb
>
> --
> Sébastien Vauban
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
- Carsten
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Re: \nbsp usage
2010-07-14 8:55 ` Carsten Dominik
@ 2010-07-14 11:37 ` Erik Butz
2010-07-14 12:32 ` Bernt Hansen
0 siblings, 1 reply; 10+ messages in thread
From: Erik Butz @ 2010-07-14 11:37 UTC (permalink / raw)
To: Carsten Dominik; +Cc: emacs-orgmode
Hi Carsten,
unfortunately, after doing a 'git pull' and recompiling \nbsp{}m^2
still results in 200~\{\}m$^2$ for me.
Cheers,
Erik
2010/7/14 Carsten Dominik <carsten.dominik@gmail.com>:
> Hi everyone,
>
> 20\nbsp{}m^2 should now work.
>
> Thanks!
>
> - Carsten
>
> On Jul 14, 2010, at 9:19 AM, Sébastien Vauban wrote:
>
>> Hi Nick, Bernt, Erik and the rest,
>>
>> Nick Dokos wrote:
>>>
>>> Bernt Hansen <bernt@norang.ca> wrote:
>>>>
>>>> Erik Butz <erik.butz@googlemail.com> writes:
>>>>>
>>>>> If I do: 200\nbspm^2
>>>>> it gets exported as: 200\nbspm$^2$, so the symbol is not recognized.
>>
>> My solution is to insert a real non-breaking space (yes, it does exist, as
>> a
>> different character from the space), almost invisible (light gray, by
>> choice)
>> under Emacs, and correctly handled in LaTeX.
>>
>> See http://comments.gmane.org/gmane.emacs.orgmode/24716
>> and http://article.gmane.org/gmane.emacs.orgmode/15116.
>>
>> Best regards,
>> Seb
>>
>> --
>> Sébastien Vauban
>>
>>
>> _______________________________________________
>> Emacs-orgmode mailing list
>> Please use `Reply All' to send replies to the list.
>> Emacs-orgmode@gnu.org
>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>
> - Carsten
>
>
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Re: \nbsp usage
2010-07-14 4:23 ` Nick Dokos
2010-07-14 7:19 ` Sébastien Vauban
@ 2010-07-14 11:54 ` Bernt Hansen
1 sibling, 0 replies; 10+ messages in thread
From: Bernt Hansen @ 2010-07-14 11:54 UTC (permalink / raw)
To: nicholas.dokos; +Cc: emacs-orgmode
Nick Dokos <nicholas.dokos@hp.com> writes:
> Bernt Hansen <bernt@norang.ca> wrote:
>
>> Erik Butz <erik.butz@googlemail.com> writes:
>>
>> > 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.
>> >
>> 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.
>
> 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.
Ooops :) Thanks for the pointer to the docs!
-Bernt
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2010-07-15 12:00 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-13 16:16 \nbsp usage Erik Butz
2010-07-14 0:37 ` Bernt Hansen
2010-07-14 4:23 ` Nick Dokos
2010-07-14 7:19 ` Sébastien Vauban
2010-07-14 8:55 ` Carsten Dominik
2010-07-14 11:37 ` Erik Butz
2010-07-14 12:32 ` Bernt Hansen
2010-07-14 14:54 ` Nick Dokos
2010-07-15 12:00 ` Erik Butz
2010-07-14 11:54 ` Bernt Hansen
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).