emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* How to escape spaces after full stops?
@ 2012-06-23 19:06 Marius Hofert
  2012-06-24  9:17 ` Viktor Rosenfeld
  2012-06-24  9:48 ` Nicolas Goaziou
  0 siblings, 2 replies; 8+ messages in thread
From: Marius Hofert @ 2012-06-23 19:06 UTC (permalink / raw)
  To: emacs-orgmode

Dear org-mode experts,

If I create a .org file containing this line...

,----[ minimal_example.org ]
| This is just some text on p. 17. Some more text. 
`----

... and then export it to pdf via C-c C-e p, you can see from the output that
the space after "p." is too large. In a standard .tex file one would escape the
space via "p.\ 17". But this leads to a backslash in the .pdf (when
exported). How can this space be escaped?

Cheers,

Marius

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How to escape spaces after full stops?
  2012-06-23 19:06 How to escape spaces after full stops? Marius Hofert
@ 2012-06-24  9:17 ` Viktor Rosenfeld
  2012-06-24 12:36   ` Sebastien Vauban
  2012-06-24  9:48 ` Nicolas Goaziou
  1 sibling, 1 reply; 8+ messages in thread
From: Viktor Rosenfeld @ 2012-06-24  9:17 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

I typically use a non-breaking space in this case with C-x 8 <space>.
This also prevents a linebreak at this position. For this to work I have
to add the following line in the LaTeX preamble:

\DeclareUnicodeCharacter{00A0}{~}

Cheers,
Viktor

Marius Hofert wrote:

> Dear org-mode experts,
> 
> If I create a .org file containing this line...
> 
> ,----[ minimal_example.org ]
> | This is just some text on p. 17. Some more text. 
> `----
> 
> ... and then export it to pdf via C-c C-e p, you can see from the output that
> the space after "p." is too large. In a standard .tex file one would escape the
> space via "p.\ 17". But this leads to a backslash in the .pdf (when
> exported). How can this space be escaped?
> 
> Cheers,
> 
> Marius
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How to escape spaces after full stops?
  2012-06-23 19:06 How to escape spaces after full stops? Marius Hofert
  2012-06-24  9:17 ` Viktor Rosenfeld
@ 2012-06-24  9:48 ` Nicolas Goaziou
  2012-06-24 11:37   ` Marius Hofert
  1 sibling, 1 reply; 8+ messages in thread
From: Nicolas Goaziou @ 2012-06-24  9:48 UTC (permalink / raw)
  To: Marius Hofert; +Cc: emacs-orgmode

Hello,

Marius Hofert <marius.hofert@math.ethz.ch> writes:

> If I create a .org file containing this line...
>
> ,----[ minimal_example.org ]
> | This is just some text on p. 17. Some more text. 
> `----
>
> ... and then export it to pdf via C-c C-e p, you can see from the output that
> the space after "p." is too large. In a standard .tex file one would escape the
> space via "p.\ 17". But this leads to a backslash in the .pdf (when
> exported). How can this space be escaped?

You can use Org entities, i.e.:

  This is just some text on p.\nbsp{}17. Some more text.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How to escape spaces after full stops?
  2012-06-24  9:48 ` Nicolas Goaziou
@ 2012-06-24 11:37   ` Marius Hofert
  2012-06-24 12:12     ` Nicolas Goaziou
  0 siblings, 1 reply; 8+ messages in thread
From: Marius Hofert @ 2012-06-24 11:37 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

Dear Nicolas, many thanks for pointing this out.
\nbsp{} leads to ~, which is correct in this case. Is there also a way to get
"\"? [there is a slight but sometimes important difference].

Cheers,

Marius

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> Hello,
>
> Marius Hofert <marius.hofert@math.ethz.ch> writes:
>
>> If I create a .org file containing this line...
>>
>> ,----[ minimal_example.org ]
>> | This is just some text on p. 17. Some more text. 
>> `----
>>
>> ... and then export it to pdf via C-c C-e p, you can see from the output that
>> the space after "p." is too large. In a standard .tex file one would escape the
>> space via "p.\ 17". But this leads to a backslash in the .pdf (when
>> exported). How can this space be escaped?
>
> You can use Org entities, i.e.:
>
>   This is just some text on p.\nbsp{}17. Some more text.
>
>
> Regards,

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How to escape spaces after full stops?
  2012-06-24 11:37   ` Marius Hofert
@ 2012-06-24 12:12     ` Nicolas Goaziou
  2012-06-24 13:40       ` Marius Hofert
  0 siblings, 1 reply; 8+ messages in thread
From: Nicolas Goaziou @ 2012-06-24 12:12 UTC (permalink / raw)
  To: Marius Hofert; +Cc: emacs-orgmode

Hello,

Marius Hofert <marius.hofert@math.ethz.ch> writes:

> Is there also a way to get "\"? [there is a slight but sometimes
> important difference].

Do you mean "\ "?

Not out of the box, but you can add your own entities in
`org-entities-user'.

For example, you can have:

  (add-to-list 'org-entities-user '(spc "\\ " nil " " " " " " " "))

And then use

  p.\spc{}17


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How to escape spaces after full stops?
  2012-06-24  9:17 ` Viktor Rosenfeld
@ 2012-06-24 12:36   ` Sebastien Vauban
  0 siblings, 0 replies; 8+ messages in thread
From: Sebastien Vauban @ 2012-06-24 12:36 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hello,

Viktor Rosenfeld wrote:
> I typically use a non-breaking space in this case with C-x 8 <space>.
> This also prevents a linebreak at this position. For this to work I have
> to add the following line in the LaTeX preamble:
>
> \DeclareUnicodeCharacter{00A0}{~}

or use the `utf8x' (see the `x') inputenc.

Though, I do not no which solution is better...

Best regards,
  Seb

-- 
Sebastien Vauban

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How to escape spaces after full stops?
  2012-06-24 12:12     ` Nicolas Goaziou
@ 2012-06-24 13:40       ` Marius Hofert
  2012-06-24 13:52         ` Nicolas Goaziou
  0 siblings, 1 reply; 8+ messages in thread
From: Marius Hofert @ 2012-06-24 13:40 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode



Nicolas Goaziou <n.goaziou@gmail.com> writes:

> Hello,
>
> Marius Hofert <marius.hofert@math.ethz.ch> writes:
>
>> Is there also a way to get "\"? [there is a slight but sometimes
>> important difference].
>
> Do you mean "\ "?

yes.

>
>
> Not out of the box, but you can add your own entities in
> `org-entities-user'.
>
> For example, you can have:
>
>   (add-to-list 'org-entities-user '(spc "\\ " nil " " " " " " " "))
>
> And then use
>
>   p.\spc{}17

I have put the above line in ~/.emacs and restarted emacs. It writes now as "p.17",
so without space at all. Do you know why?

>
>
>
> Regards,

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How to escape spaces after full stops?
  2012-06-24 13:40       ` Marius Hofert
@ 2012-06-24 13:52         ` Nicolas Goaziou
  0 siblings, 0 replies; 8+ messages in thread
From: Nicolas Goaziou @ 2012-06-24 13:52 UTC (permalink / raw)
  To: Marius Hofert; +Cc: emacs-orgmode

Marius Hofert <marius.hofert@math.ethz.ch> writes:

> Nicolas Goaziou <n.goaziou@gmail.com> writes:

>> For example, you can have:
>>
>>   (add-to-list 'org-entities-user '(spc "\\ " nil " " " " " " " "))
>>
>> And then use
>>
>>   p.\spc{}17
>
> I have put the above line in ~/.emacs and restarted emacs. It writes now as "p.17",
> so without space at all. Do you know why?

Yes, that is a typo on my side: it should be "spc", not spc.


Regards,

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-06-24 13:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-23 19:06 How to escape spaces after full stops? Marius Hofert
2012-06-24  9:17 ` Viktor Rosenfeld
2012-06-24 12:36   ` Sebastien Vauban
2012-06-24  9:48 ` Nicolas Goaziou
2012-06-24 11:37   ` Marius Hofert
2012-06-24 12:12     ` Nicolas Goaziou
2012-06-24 13:40       ` Marius Hofert
2012-06-24 13:52         ` Nicolas Goaziou

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).