Kinsoku are typographic conventions for line breaking in Japanese typesetting.
| Class | Can't begin a line | Can't finish a line |
|---|---|---|
| Small kana | ぁぃぅぇぉっ... | N/A |
| Parentheses | )〉》】... | (〈《【... |
| Quotations | 」』”... | 「『“... |
| Punctuation | 、。・!?... | N/A |
makefile: Compiles the document to a PDF with XeLaTeX, links references with BibTeX and compiles again to make sure references are correct. XeLaTex is required for thexeCJKpackage to work.main.tex: A minimal LaTeX document to compile withmake.cjk_support.tex: Loads thexeCJKpackage to support Japanese input and inputsno_breaks.tex.no_breaks.tex: Sets a fontface and new character classes for the relevant characters. Inputs the penalties defined below.no_break_before.texandno_break_after.tex: Define characters that should not be begin/end lines and add penalties to line breaking as appropriate. Uncomment a line to highlight the relevant characters in red/blue.
Simply copy and paste cjk_support.tex, no_breaks.tex, no_break_before.tex and no_break_after.tex into the same directory as your main LaTeX file and put \input{cjk_support} into the preamble.
As an example, we use Google's Noto Sans CJK JP and Noto Sans Mono CJK JP, but if these are not installed on your system simply change the fonts set in cjk_support.tex and no_breaks.tex to one you prefer.
Since cjk_support.tex also imports xeCJK, you may want to comment this line out if you are already importing it or just \input{no_breaks} in your preamble. LaTeX will justify lines as needed, so you won't need to do any manual adjustment.
Add a line of the following form to the relevant file with the other definitions.
\XeTeXcharclass`<new_char>=\noBreakBefore % no_break_before.tex
\XeTeXcharclass`<new_char>=\noBreakAfter % no_break_after.texThanks to Cicada and Hironobu YAMASHITA who helped me in this thread. The main idea was Cicada's.