# Discourage a line break after a certain CJK character with babel

When I set Chinese using babel and LuaLaTeX, I often find a line break inserted after ：“. This looks weird to me and I'd prefer the break to come after the ： and before the “.

Can I tweak some babel option or TeX setting to discourage this behaviour?

Here's a MWE demonstrating the weird break in the first paragraph and how I'd like it to automatically look in the second paragraph (without manually inserting \break).

%! TeX Program = lualatex

\documentclass{article}

\usepackage{babel}
\babelprovide[import,main]{chinese-simplified}
\babelfont{rm}{Noto Serif CJK SC}

\begin{document}

\hsize 1.85in

\end{document}


I've edited the original answer because there is a better option:

\documentclass{article}

\usepackage{babel}
\babelprovide[import,main,intraspace=0 .15 0]{chinese-simplified}
\babelfont{rm}{NotoSerifCJKsc-Regular.otf}

\babelcharproperty{“}{linebreak}{op}


This sets the linebreak property of “ to ‘opening’, which forbids a line break after this character.

Perhaps the simplest way is with a transform. It requires a recent version and you may need to increase slightly the intraspace (the default value is 0 .1 0, which is in em units). The following preamble works for me:

\documentclass{article}

\usepackage{babel}
\babelprovide[import,main,intraspace=0 .15 0]{chinese-simplified}
\babelfont{rm}{NotoSerifCJKsc-Regular.otf}

\babelprehyphenation{chinese-simplified}{：“}{
{},  % Keep ：
{insert, penalty=-100},
{}   % Keep “
}


• Very nice (although I would never have got that from the babel docs). Is this something that should be set by default for Chinese in babel`? I notice XeLaTeX renders my first paragraph the same as the second. May 11 at 1:03
• @DavidPurton I've opened an issue: github.com/latex3/babel/issues/131 . May 11 at 11:51