4

I am trying to typeset a document using XeTeX that uses Tâi-lô (Taiwanese romanization), which separates syllables in a word with hyphens, meaning hyphens are very common. I am also using the paracol package to show the corresponding Chinese characters. I want to allow hyphenation line breaks only when the words have hyphens and disallow any other hyphenation.

Here's an example of my problem. This code:

\documentclass[12pt,oneside]{book}
\usepackage{xeCJK}
\usepackage{lettrine}
\usepackage{paracol}
\usepackage{fontspec}

\setlength{\columnsep}{25pt}
\setCJKmainfont{MOESongUN}
\setCJKmonofont{TW-Sung-Ext-B}
\setmainfont{Charis SIL}

%avoid overfull hbox with narrow columns
\tolerance=400      
\hbadness=399   
\setlength{\emergencystretch}{1em}

\newcommand{\ver}[1]{\textsuperscript{#1 }\nolinebreak}
\newcommand{\ch}[1]{\lettrine[lines=3,nindent=0em]{#1 }{\ver{1}}}
\newcommand{\they}{\texttt{𪜶}}
\newcommand{\paral}[2]{
\begin{column*}#1\end{column*}
\begin{column}#2\end{column}}
\newcommand{\nt}[1]{\mbox{-{}-#1}}

\begin{document}

\columnratio{0.4}
\footnotelayout{m}
\begin{paracol}{2}

\paral{\ch{3}耶和華上帝所造山野一切的活物,蛇是比\they 較狡譎。蛇對婦人人講:「上帝敢有影講園內一切的樹恁攏毋通食嗎?」\ver{2}婦人人對蛇講:「園內樹裡的果子阮通食,\ver{3}只有園中央彼欉樹的果子,上帝捌講:『恁毋通食伊,也毋通摸,驚了會死。』」}{\ch{3}Iâ-hô-hua Siōng-tè sóo tsō suann-iá it-tshè ê ua̍h-mi̍h, tsuâ sī pí in khah káu-khiat. Tsuâ tuì hū-jîn-lâng kóng: ``Siōng-tè kám ū-iánn kóng hn̂g-lāi it-tshè ê tshiū lín lóng m̄-thang tsia̍h\nt{mah}?'' \ver{2}Hū-jîn-lâng tuì tsuâ kóng: ``Hn̂g-lāi tshiū\nt{lí} ê kué-tsí guán thang tsia̍h, \ver{3}tsí-ū hn̂g tiong-ng hit tsâng tshiū ê kué-tsí, Siōng-tè bat kóng: `Lín m̄-thang tsia̍h\nt{i}, iā m̄-thang bong, kiann-liáu ē sí.'\thinspace''}

\end{paracol}

\end{document}

produces this:

output

At the end of verse 2, the "tsia̍h" splits into "tsi-a̍h", which would be wrong. I've tried using hyphenat, but that suppresses all hyphenation line breaks, even the ones with intended hyphens, like "suann-iá" and "hū-jîn-lâng".

Is there a way to only hyphenate when the hyphens are placed intentionally and not create any new hyphenations?

(I've fixed this with \setlength{\emergencystretch}{2em}, but this wouldn't fix a problem that might appear later in the text.)

3

You have two possibilities:

  1. declare to be using the fake language hyphenation rules nohyphenation

  2. set \hyphenpenalty to 10000, which disallows hyphenation except at explicit hyphens

In the code below I changed the font for the Chinese part; adding a definition for \languageshorthands is needed only if you follow method 1.

Once you have decided for a method, you can plug it into the definition of \paral.

\documentclass[12pt,oneside]{book}
\usepackage{xeCJK}
\usepackage{lettrine}
\usepackage{paracol}
\usepackage{fontspec}

\setlength{\columnsep}{25pt}
%\setCJKmainfont{MOESongUN}
%\setCJKmonofont{TW-Sung-Ext-B}
\setCJKmainfont{Hiragino Mincho Pro}
\setCJKmonofont{Hiragino Mincho Pro}
\setmainfont{Charis SIL}

%avoid overfull hbox with narrow columns
\tolerance=400      
\hbadness=399   
\setlength{\emergencystretch}{1em}

\newcommand{\ver}[1]{\textsuperscript{#1 }\nolinebreak}
\newcommand{\ch}[1]{\lettrine[lines=3,nindent=0em]{#1 }{\ver{1}}}
\newcommand{\they}{\texttt{𪜶}}
\newcommand{\paral}[2]{%
  \begin{column*}#1\end{column*}%
  \begin{column}#2\end{column}%
}
\newcommand{\nt}[1]{\mbox{-{}-#1}}

\providecommand{\languageshorthands}[1]{}

\begin{document}

\columnratio{0.4}
\footnotelayout{m}

\begin{paracol}{2}

\paral{\ch{3}耶和華上帝所造山野一切的活物,蛇是比\they 
較狡譎。蛇對婦人人講:「上帝敢有影講園內一切的樹恁攏毋通食嗎?」%
\ver{2}婦人人對蛇講:「園內樹裡的果子阮通食,\ver{3}只有園中央彼欉樹的果子,上帝捌講:%
『恁毋通食伊,也毋通摸,驚了會死。』」}{%
\hyphenrules{nohyphenation}%
\ch{3}Iâ-hô-hua 
Siōng-tè sóo tsō suann-iá it-tshè ê ua̍h-mi̍h, tsuâ sī pí in khah káu-khiat. Tsuâ tuì hū-jîn-lâng kóng: 
``Siōng-tè kám ū-iánn kóng hn̂g-lāi it-tshè ê tshiū lín lóng m̄-thang tsia̍h\nt{mah}?'' \ver{2}Hū-jîn-lâng 
tuì tsuâ kóng: ``Hn̂g-lāi tshiū\nt{lí} ê kué-tsí guán thang tsia̍h, \ver{3}tsí-ū hn̂g tiong-ng hit tsâng 
tshiū ê kué-tsí, Siōng-tè bat kóng: `Lín m̄-thang tsia̍h\nt{i}, iā m̄-thang bong, kiann-liáu ē 
sí.'\thinspace''}

\end{paracol}

\begin{paracol}{2}

\paral{\ch{3}耶和華上帝所造山野一切的活物,蛇是比\they 
較狡譎。蛇對婦人人講:「上帝敢有影講園內一切的樹恁攏毋通食嗎?」%
\ver{2}婦人人對蛇講:「園內樹裡的果子阮通食,\ver{3}只有園中央彼欉樹的果子,上帝捌講:%
『恁毋通食伊,也毋通摸,驚了會死。』」}{%
\hyphenpenalty10000
\ch{3}Iâ-hô-hua 
Siōng-tè sóo tsō suann-iá it-tshè ê ua̍h-mi̍h, tsuâ sī pí in khah káu-khiat. Tsuâ tuì hū-jîn-lâng kóng: 
``Siōng-tè kám ū-iánn kóng hn̂g-lāi it-tshè ê tshiū lín lóng m̄-thang tsia̍h\nt{mah}?'' \ver{2}Hū-jîn-lâng 
tuì tsuâ kóng: ``Hn̂g-lāi tshiū\nt{lí} ê kué-tsí guán thang tsia̍h, \ver{3}tsí-ū hn̂g tiong-ng hit tsâng 
tshiū ê kué-tsí, Siōng-tè bat kóng: `Lín m̄-thang tsia̍h\nt{i}, iā m̄-thang bong, kiann-liáu ē 
sí.'\thinspace''}

\end{paracol}

\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.