all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Bug: ODT export of Chinese text inserts spaces for line breaks
@ 2021-06-29  3:47 James Harkins
  2021-06-29  4:43 ` tumashu
  0 siblings, 1 reply; 7+ messages in thread
From: James Harkins @ 2021-06-29  3:47 UTC (permalink / raw)
  To: emacs-orgmode

Consider the following org document.

* Test
1本人不想亲自拿到学历学位证书、急于离校者,可书面委托他人代领学历学位证
书,29日起即可离校;2本人想亲自领取学历学位证书者,按学校规定的程序及有关
要求办理离校手续,领取相关证书后离校;

This was produced by pasting in a single, long line, and then using alt-Q (a normal thing to do, and good for readability, because org-mode doesn't wrap lines by default).

Exporting to ODT produces the following (body text, omitting titles, headers and such).

1本人不想亲自拿到学历学位证书、急于离校者,可书面委托他人代领学历学位证 书,29日起即可离校;2本人想亲自领取学历学位证书者,按学校规定的程序及有关 要求办理离校手续,领取相关证书后离校;

Between 证 and 书, and between 关 and 要, there is a space. Chinese typography does not allow for spaces mid-sentence.

So, it would make sense to add a rule to the exporter: if one of the characters before or after a source-text line break is a Chinese, Japanese or Korean character, do not add a space. (The space is valid, of course, if the characters on either side of the line breaks are Roman or [I would guess] Cyrillic as well.)

(Side note: Exporting to a LaTeX buffer shows that the line breaks have been copied into the .tex document as is -- but, provided that you have a `usepackage{xeCJK}` in the preamble, LaTeX produces correct, space-free output. So -- Org "gets away with it" because of LaTeX's handling of CJK text. It seems for ODT, Org needs to handle the spacing within its own logic.)

This is org 9.1.9... bit old, I know, but I'm gonna take a wild guess that this has not been a high-visibility issue.

hjh


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

end of thread, other threads:[~2022-10-21  5:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-29  3:47 Bug: ODT export of Chinese text inserts spaces for line breaks James Harkins
2021-06-29  4:43 ` tumashu
2021-06-29 17:01   ` Bug: " Maxim Nikulin
2021-06-29 18:19     ` Eric Abrahamsen
2021-06-30 12:22       ` Maxim Nikulin
2022-10-08 13:14         ` Ihor Radchenko
2022-10-21  5:38           ` Ihor Radchenko

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.