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}


cjk.pdf output



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?










share|improve this question
















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 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} 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

















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}


cjk.pdf output



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?










share|improve this question
















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 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} 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















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}


cjk.pdf output



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?










share|improve this question















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}


cjk.pdf output



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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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 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} 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




















  • 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} 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


















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












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}





share|improve this answer























  • 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











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















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

























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}





share|improve this answer























  • 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















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}





share|improve this answer























  • 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













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}





share|improve this answer














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}






share|improve this answer














share|improve this answer



share|improve this answer








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


















  • 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


















 

draft saved


draft discarded



















































 


draft saved


draft discarded














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





















































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







Popular posts from this blog

Accessing regular linux commands in Huawei's Dopra Linux

Can't connect RFCOMM socket: Host is down

Kernel panic - not syncing: Fatal Exception in Interrupt