Adding spaces in xeCJK for Chinese, Japanese, Korean doesn't work
up vote
1
down vote
favorite
I followed the answers given in various related questions but none of them solve the problem of adding spaces in xeCJK package.
documentclass{article}
usepackage[CJKspace,space,CJKspace=true]{xeCJK}
usepackage{xunicode}
setCJKmainfont{Batang}
renewcommandCJKglue{}
makeatletter
letxeCJK@ignorespacesrelax
makeatother
ExplSyntaxOn
int_step_inline:nnnn { "AC00 } {1} { "D7A3 } { char_set_catcode_letter:n {#1} }
ExplSyntaxOff
begin{document}
CJKspace
一二三四五
一 二 三 四 五
あいうえお
あ い う え お
일이삼사오
일 이 삼 사 오
end{document}
None of the Chinese, Japanese, or Korean add any spaces.
the output is as follows:
xelatex cjk.tex
This is XeTeX, Version 3.14159265-2.6-0.99996 (TeX Live 2016) (preloaded format=xelatex)
restricted write18 enabled.
entering extended mode
(./cjk.tex
LaTeX2e <2016/03/31>
Babel <3.9r> and hyphenation patterns for 3 language(s) loaded.
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
...
*** Reloading Xunicode for encoding 'EU1' ***
) (/usr/share/texlive/texmf-dist/tex/xelatex/xecjk/xunicode-extra.def)
(/usr/share/texlive/texmf-dist/tex/xelatex/xecjk/xeCJK.cfg))
*************************************************
* fontspec warning: "script-not-exist"
*
* Font 'Batang' does not contain script 'CJK'.
*************************************************
(./cjk.aux) (/usr/share/texlive/texmf-dist/tex/latex/tipa/t3cmr.fd) [1]
(./cjk.aux) )
Output written on cjk.pdf (1 page).
Transcript written on cjk.log.
Here are what I think are some relevant lines from cjk.log:
. Defining command xeCJKShipoutHook with sig. '' on line 148.
g__xeCJK_spacefactor_int=count116
l__xeCJK_begin_int=count117
l__xeCJK_end_int=count118
. Defining command normalspacedchars with sig. 'm' on line 618.
. Defining command xeCJKOffVerbAddon with sig. '' on line 3443.
l__xeCJK_verb_exspace_skip=skip54
. Defining command CJKspace with sig. '' on line 3753.
. Defining command CJKnospace with sig. '' on line 3754.
. Redefining command nobreakspace with sig. '' on line 3910.
I am using Fedora 27 texlive-2016 and other stock packages that come with the repo. What am I missing?
spacing xetex texlive cjk xecjk
bumped to the homepage by Community♦ 20 hours ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
|
show 1 more comment
up vote
1
down vote
favorite
I followed the answers given in various related questions but none of them solve the problem of adding spaces in xeCJK package.
documentclass{article}
usepackage[CJKspace,space,CJKspace=true]{xeCJK}
usepackage{xunicode}
setCJKmainfont{Batang}
renewcommandCJKglue{}
makeatletter
letxeCJK@ignorespacesrelax
makeatother
ExplSyntaxOn
int_step_inline:nnnn { "AC00 } {1} { "D7A3 } { char_set_catcode_letter:n {#1} }
ExplSyntaxOff
begin{document}
CJKspace
一二三四五
一 二 三 四 五
あいうえお
あ い う え お
일이삼사오
일 이 삼 사 오
end{document}
None of the Chinese, Japanese, or Korean add any spaces.
the output is as follows:
xelatex cjk.tex
This is XeTeX, Version 3.14159265-2.6-0.99996 (TeX Live 2016) (preloaded format=xelatex)
restricted write18 enabled.
entering extended mode
(./cjk.tex
LaTeX2e <2016/03/31>
Babel <3.9r> and hyphenation patterns for 3 language(s) loaded.
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
...
*** Reloading Xunicode for encoding 'EU1' ***
) (/usr/share/texlive/texmf-dist/tex/xelatex/xecjk/xunicode-extra.def)
(/usr/share/texlive/texmf-dist/tex/xelatex/xecjk/xeCJK.cfg))
*************************************************
* fontspec warning: "script-not-exist"
*
* Font 'Batang' does not contain script 'CJK'.
*************************************************
(./cjk.aux) (/usr/share/texlive/texmf-dist/tex/latex/tipa/t3cmr.fd) [1]
(./cjk.aux) )
Output written on cjk.pdf (1 page).
Transcript written on cjk.log.
Here are what I think are some relevant lines from cjk.log:
. Defining command xeCJKShipoutHook with sig. '' on line 148.
g__xeCJK_spacefactor_int=count116
l__xeCJK_begin_int=count117
l__xeCJK_end_int=count118
. Defining command normalspacedchars with sig. 'm' on line 618.
. Defining command xeCJKOffVerbAddon with sig. '' on line 3443.
l__xeCJK_verb_exspace_skip=skip54
. Defining command CJKspace with sig. '' on line 3753.
. Defining command CJKnospace with sig. '' on line 3754.
. Redefining command nobreakspace with sig. '' on line 3910.
I am using Fedora 27 texlive-2016 and other stock packages that come with the repo. What am I missing?
spacing xetex texlive cjk xecjk
bumped to the homepage by Community♦ 20 hours ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
Have you tried with a different font? If I run your code I see spaces, but I don't have the Batang font so I have to comment out thesetCJKmainfont
line.
– erik
Mar 29 at 14:46
I just tried with the Batang font and I see spaces in the output. Can you post an image of your output?
– erik
Mar 29 at 14:59
I tried all different combinations of the preamble lines to no avail. I haven't touched anything except US letter instead of A4 using texconfig-sys paper letter.
– Yusuf N
Mar 29 at 15:39
Sorry but I can't reproduce the problem. My output has spaces. It also has spaces if I remove everything in the preamble exceptusepackage[CJKspace]{xeCJK}
andsetCJKmainfont{Batang}
. Is your package up to date?
– erik
Mar 29 at 15:52
Thank you erik for the informative answer. It definitely points to my own setup somehow. Now I have to figure out what is causing this. And it is up to date as of last night.
– Yusuf N
Mar 29 at 16:02
|
show 1 more comment
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I followed the answers given in various related questions but none of them solve the problem of adding spaces in xeCJK package.
documentclass{article}
usepackage[CJKspace,space,CJKspace=true]{xeCJK}
usepackage{xunicode}
setCJKmainfont{Batang}
renewcommandCJKglue{}
makeatletter
letxeCJK@ignorespacesrelax
makeatother
ExplSyntaxOn
int_step_inline:nnnn { "AC00 } {1} { "D7A3 } { char_set_catcode_letter:n {#1} }
ExplSyntaxOff
begin{document}
CJKspace
一二三四五
一 二 三 四 五
あいうえお
あ い う え お
일이삼사오
일 이 삼 사 오
end{document}
None of the Chinese, Japanese, or Korean add any spaces.
the output is as follows:
xelatex cjk.tex
This is XeTeX, Version 3.14159265-2.6-0.99996 (TeX Live 2016) (preloaded format=xelatex)
restricted write18 enabled.
entering extended mode
(./cjk.tex
LaTeX2e <2016/03/31>
Babel <3.9r> and hyphenation patterns for 3 language(s) loaded.
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
...
*** Reloading Xunicode for encoding 'EU1' ***
) (/usr/share/texlive/texmf-dist/tex/xelatex/xecjk/xunicode-extra.def)
(/usr/share/texlive/texmf-dist/tex/xelatex/xecjk/xeCJK.cfg))
*************************************************
* fontspec warning: "script-not-exist"
*
* Font 'Batang' does not contain script 'CJK'.
*************************************************
(./cjk.aux) (/usr/share/texlive/texmf-dist/tex/latex/tipa/t3cmr.fd) [1]
(./cjk.aux) )
Output written on cjk.pdf (1 page).
Transcript written on cjk.log.
Here are what I think are some relevant lines from cjk.log:
. Defining command xeCJKShipoutHook with sig. '' on line 148.
g__xeCJK_spacefactor_int=count116
l__xeCJK_begin_int=count117
l__xeCJK_end_int=count118
. Defining command normalspacedchars with sig. 'm' on line 618.
. Defining command xeCJKOffVerbAddon with sig. '' on line 3443.
l__xeCJK_verb_exspace_skip=skip54
. Defining command CJKspace with sig. '' on line 3753.
. Defining command CJKnospace with sig. '' on line 3754.
. Redefining command nobreakspace with sig. '' on line 3910.
I am using Fedora 27 texlive-2016 and other stock packages that come with the repo. What am I missing?
spacing xetex texlive cjk xecjk
I followed the answers given in various related questions but none of them solve the problem of adding spaces in xeCJK package.
documentclass{article}
usepackage[CJKspace,space,CJKspace=true]{xeCJK}
usepackage{xunicode}
setCJKmainfont{Batang}
renewcommandCJKglue{}
makeatletter
letxeCJK@ignorespacesrelax
makeatother
ExplSyntaxOn
int_step_inline:nnnn { "AC00 } {1} { "D7A3 } { char_set_catcode_letter:n {#1} }
ExplSyntaxOff
begin{document}
CJKspace
一二三四五
一 二 三 四 五
あいうえお
あ い う え お
일이삼사오
일 이 삼 사 오
end{document}
None of the Chinese, Japanese, or Korean add any spaces.
the output is as follows:
xelatex cjk.tex
This is XeTeX, Version 3.14159265-2.6-0.99996 (TeX Live 2016) (preloaded format=xelatex)
restricted write18 enabled.
entering extended mode
(./cjk.tex
LaTeX2e <2016/03/31>
Babel <3.9r> and hyphenation patterns for 3 language(s) loaded.
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
...
*** Reloading Xunicode for encoding 'EU1' ***
) (/usr/share/texlive/texmf-dist/tex/xelatex/xecjk/xunicode-extra.def)
(/usr/share/texlive/texmf-dist/tex/xelatex/xecjk/xeCJK.cfg))
*************************************************
* fontspec warning: "script-not-exist"
*
* Font 'Batang' does not contain script 'CJK'.
*************************************************
(./cjk.aux) (/usr/share/texlive/texmf-dist/tex/latex/tipa/t3cmr.fd) [1]
(./cjk.aux) )
Output written on cjk.pdf (1 page).
Transcript written on cjk.log.
Here are what I think are some relevant lines from cjk.log:
. Defining command xeCJKShipoutHook with sig. '' on line 148.
g__xeCJK_spacefactor_int=count116
l__xeCJK_begin_int=count117
l__xeCJK_end_int=count118
. Defining command normalspacedchars with sig. 'm' on line 618.
. Defining command xeCJKOffVerbAddon with sig. '' on line 3443.
l__xeCJK_verb_exspace_skip=skip54
. Defining command CJKspace with sig. '' on line 3753.
. Defining command CJKnospace with sig. '' on line 3754.
. Redefining command nobreakspace with sig. '' on line 3910.
I am using Fedora 27 texlive-2016 and other stock packages that come with the repo. What am I missing?
spacing xetex texlive cjk xecjk
spacing xetex texlive cjk xecjk
edited Mar 29 at 15:52
asked Mar 29 at 14:36
Yusuf N
162
162
bumped to the homepage by Community♦ 20 hours ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ 20 hours ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
Have you tried with a different font? If I run your code I see spaces, but I don't have the Batang font so I have to comment out thesetCJKmainfont
line.
– erik
Mar 29 at 14:46
I just tried with the Batang font and I see spaces in the output. Can you post an image of your output?
– erik
Mar 29 at 14:59
I tried all different combinations of the preamble lines to no avail. I haven't touched anything except US letter instead of A4 using texconfig-sys paper letter.
– Yusuf N
Mar 29 at 15:39
Sorry but I can't reproduce the problem. My output has spaces. It also has spaces if I remove everything in the preamble exceptusepackage[CJKspace]{xeCJK}
andsetCJKmainfont{Batang}
. Is your package up to date?
– erik
Mar 29 at 15:52
Thank you erik for the informative answer. It definitely points to my own setup somehow. Now I have to figure out what is causing this. And it is up to date as of last night.
– Yusuf N
Mar 29 at 16:02
|
show 1 more comment
Have you tried with a different font? If I run your code I see spaces, but I don't have the Batang font so I have to comment out thesetCJKmainfont
line.
– erik
Mar 29 at 14:46
I just tried with the Batang font and I see spaces in the output. Can you post an image of your output?
– erik
Mar 29 at 14:59
I tried all different combinations of the preamble lines to no avail. I haven't touched anything except US letter instead of A4 using texconfig-sys paper letter.
– Yusuf N
Mar 29 at 15:39
Sorry but I can't reproduce the problem. My output has spaces. It also has spaces if I remove everything in the preamble exceptusepackage[CJKspace]{xeCJK}
andsetCJKmainfont{Batang}
. Is your package up to date?
– erik
Mar 29 at 15:52
Thank you erik for the informative answer. It definitely points to my own setup somehow. Now I have to figure out what is causing this. And it is up to date as of last night.
– Yusuf N
Mar 29 at 16:02
Have you tried with a different font? If I run your code I see spaces, but I don't have the Batang font so I have to comment out the
setCJKmainfont
line.– erik
Mar 29 at 14:46
Have you tried with a different font? If I run your code I see spaces, but I don't have the Batang font so I have to comment out the
setCJKmainfont
line.– erik
Mar 29 at 14:46
I just tried with the Batang font and I see spaces in the output. Can you post an image of your output?
– erik
Mar 29 at 14:59
I just tried with the Batang font and I see spaces in the output. Can you post an image of your output?
– erik
Mar 29 at 14:59
I tried all different combinations of the preamble lines to no avail. I haven't touched anything except US letter instead of A4 using texconfig-sys paper letter.
– Yusuf N
Mar 29 at 15:39
I tried all different combinations of the preamble lines to no avail. I haven't touched anything except US letter instead of A4 using texconfig-sys paper letter.
– Yusuf N
Mar 29 at 15:39
Sorry but I can't reproduce the problem. My output has spaces. It also has spaces if I remove everything in the preamble except
usepackage[CJKspace]{xeCJK}
and setCJKmainfont{Batang}
. Is your package up to date?– erik
Mar 29 at 15:52
Sorry but I can't reproduce the problem. My output has spaces. It also has spaces if I remove everything in the preamble except
usepackage[CJKspace]{xeCJK}
and setCJKmainfont{Batang}
. Is your package up to date?– erik
Mar 29 at 15:52
Thank you erik for the informative answer. It definitely points to my own setup somehow. Now I have to figure out what is causing this. And it is up to date as of last night.
– Yusuf N
Mar 29 at 16:02
Thank you erik for the informative answer. It definitely points to my own setup somehow. Now I have to figure out what is causing this. And it is up to date as of last night.
– Yusuf N
Mar 29 at 16:02
|
show 1 more comment
1 Answer
1
active
oldest
votes
up vote
0
down vote
I finally found an alternate solution: use kotex package instead of xeCJK. It works perfectly for all Chinese, Japanese, and Korean. How do I get Korean (Hangul) characters to typeset in LaTeX ?
It also works perfectly in lyx.
Here is an example how to do all CJK with spacing. I changed the last character of Chinese to show that it works with Chinese too. That character doesn't seem to exist in Korean hanja, so I just set its font to Chinese, and now it shows.
documentclass{article}
usepackage{kotex}
usepackage[english]{babel}
setmainhangulfont{Batang}
setmainhanjafont{SimSun}
begin{document}
一二三四教
一 二 三 四 教
あいうえお
あ い う え お
일이삼사오
일 이 삼 사 오
abcde
a b c d e
end{document}
Wow, I didn't know Japanese also had characters that Korean and Chinese fonts don't include. I ended up mixing both xeCJK and kotex and now spacing works. I think it is a hack, but at least it works.
– Yusuf N
Mar 30 at 0:11
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
I finally found an alternate solution: use kotex package instead of xeCJK. It works perfectly for all Chinese, Japanese, and Korean. How do I get Korean (Hangul) characters to typeset in LaTeX ?
It also works perfectly in lyx.
Here is an example how to do all CJK with spacing. I changed the last character of Chinese to show that it works with Chinese too. That character doesn't seem to exist in Korean hanja, so I just set its font to Chinese, and now it shows.
documentclass{article}
usepackage{kotex}
usepackage[english]{babel}
setmainhangulfont{Batang}
setmainhanjafont{SimSun}
begin{document}
一二三四教
一 二 三 四 教
あいうえお
あ い う え お
일이삼사오
일 이 삼 사 오
abcde
a b c d e
end{document}
Wow, I didn't know Japanese also had characters that Korean and Chinese fonts don't include. I ended up mixing both xeCJK and kotex and now spacing works. I think it is a hack, but at least it works.
– Yusuf N
Mar 30 at 0:11
add a comment |
up vote
0
down vote
I finally found an alternate solution: use kotex package instead of xeCJK. It works perfectly for all Chinese, Japanese, and Korean. How do I get Korean (Hangul) characters to typeset in LaTeX ?
It also works perfectly in lyx.
Here is an example how to do all CJK with spacing. I changed the last character of Chinese to show that it works with Chinese too. That character doesn't seem to exist in Korean hanja, so I just set its font to Chinese, and now it shows.
documentclass{article}
usepackage{kotex}
usepackage[english]{babel}
setmainhangulfont{Batang}
setmainhanjafont{SimSun}
begin{document}
一二三四教
一 二 三 四 教
あいうえお
あ い う え お
일이삼사오
일 이 삼 사 오
abcde
a b c d e
end{document}
Wow, I didn't know Japanese also had characters that Korean and Chinese fonts don't include. I ended up mixing both xeCJK and kotex and now spacing works. I think it is a hack, but at least it works.
– Yusuf N
Mar 30 at 0:11
add a comment |
up vote
0
down vote
up vote
0
down vote
I finally found an alternate solution: use kotex package instead of xeCJK. It works perfectly for all Chinese, Japanese, and Korean. How do I get Korean (Hangul) characters to typeset in LaTeX ?
It also works perfectly in lyx.
Here is an example how to do all CJK with spacing. I changed the last character of Chinese to show that it works with Chinese too. That character doesn't seem to exist in Korean hanja, so I just set its font to Chinese, and now it shows.
documentclass{article}
usepackage{kotex}
usepackage[english]{babel}
setmainhangulfont{Batang}
setmainhanjafont{SimSun}
begin{document}
一二三四教
一 二 三 四 教
あいうえお
あ い う え お
일이삼사오
일 이 삼 사 오
abcde
a b c d e
end{document}
I finally found an alternate solution: use kotex package instead of xeCJK. It works perfectly for all Chinese, Japanese, and Korean. How do I get Korean (Hangul) characters to typeset in LaTeX ?
It also works perfectly in lyx.
Here is an example how to do all CJK with spacing. I changed the last character of Chinese to show that it works with Chinese too. That character doesn't seem to exist in Korean hanja, so I just set its font to Chinese, and now it shows.
documentclass{article}
usepackage{kotex}
usepackage[english]{babel}
setmainhangulfont{Batang}
setmainhanjafont{SimSun}
begin{document}
一二三四教
一 二 三 四 教
あいうえお
あ い う え お
일이삼사오
일 이 삼 사 오
abcde
a b c d e
end{document}
edited Mar 29 at 23:49
answered Mar 29 at 17:08
Yusuf N
162
162
Wow, I didn't know Japanese also had characters that Korean and Chinese fonts don't include. I ended up mixing both xeCJK and kotex and now spacing works. I think it is a hack, but at least it works.
– Yusuf N
Mar 30 at 0:11
add a comment |
Wow, I didn't know Japanese also had characters that Korean and Chinese fonts don't include. I ended up mixing both xeCJK and kotex and now spacing works. I think it is a hack, but at least it works.
– Yusuf N
Mar 30 at 0:11
Wow, I didn't know Japanese also had characters that Korean and Chinese fonts don't include. I ended up mixing both xeCJK and kotex and now spacing works. I think it is a hack, but at least it works.
– Yusuf N
Mar 30 at 0:11
Wow, I didn't know Japanese also had characters that Korean and Chinese fonts don't include. I ended up mixing both xeCJK and kotex and now spacing works. I think it is a hack, but at least it works.
– Yusuf N
Mar 30 at 0:11
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f423874%2fadding-spaces-in-xecjk-for-chinese-japanese-korean-doesnt-work%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Have you tried with a different font? If I run your code I see spaces, but I don't have the Batang font so I have to comment out the
setCJKmainfont
line.– erik
Mar 29 at 14:46
I just tried with the Batang font and I see spaces in the output. Can you post an image of your output?
– erik
Mar 29 at 14:59
I tried all different combinations of the preamble lines to no avail. I haven't touched anything except US letter instead of A4 using texconfig-sys paper letter.
– Yusuf N
Mar 29 at 15:39
Sorry but I can't reproduce the problem. My output has spaces. It also has spaces if I remove everything in the preamble except
usepackage[CJKspace]{xeCJK}
andsetCJKmainfont{Batang}
. Is your package up to date?– erik
Mar 29 at 15:52
Thank you erik for the informative answer. It definitely points to my own setup somehow. Now I have to figure out what is causing this. And it is up to date as of last night.
– Yusuf N
Mar 29 at 16:02