1

Without hyperref loaded, LaTeX does hyphenation of Latin text. But with hyperref loaded this stops to work. enter image description here enter image description here

Is there a way to fix this?

\documentclass{scrbook}

\usepackage{xeCJK}
%\setCJKmainfont{SimSun}

\usepackage{natbib}
\bibliographystyle{unified}

\usepackage{hyperref}

\usepackage{filecontents}

\begin{filecontents}{bibliography.bib}
  @Book{          Grewendorf88a,
    address = {Tübingen},
    author  = {Günther Grewendorf},
    number  = {33},
    publisher   = {Gunter Narr Verlag},
    series  = {Studien zur deutschen Grammatik},
Langid = {german},
    title       = {{Aspekte der deutschen Syntax: Eine
    Rektions"=Bindungs"=Analyse}},
    year        = {1988}
}    \end{filecontents}


\begin{document}

除此除此除此之外,有些作者尝试将表中的中心语位置与特征值联系起来(如\citealp[52]{Grewendorf88a})。在德语中,带有介词和名词的结构,其中心语位于补语之前:

此除此除此之外,有些作者尝试将表中的中心语位置与特征值联系起来(如\citealp[52]{Grewendorf88a})。在德语中,带有介词和名词的结构,其中心语位于补语之前:

此除此之外,有些作者尝试将表中的中心语位置与特征值联系起来(如\citealp[52]{Grewendorf88a})。在德语中,带有介词和名词的结构,其中心语位于补语之前:


\bibliography{bibliography}
\end{document}

Edit: I found the difference and the reason: Without the hyperref package loaded the cite commands produce a space before the citation. Therefore xeCJK detects a separate Latin word and allows for hyphenation. With hyperref loaded, no space is inserted and no hyphenation takes place. Question: shouldn't both situations be the same? Is there a fix? CJK checks for Chinese/Latin characters and inserts space before Latin characters. I guess hyperref adds a link command around the name (e.g. Grewendorf in the example) and hence xeCJK cannot see the Latin characters any longer. Is this correct? If so, what can be done?

  • 1
    A workaround is to leave a space before the \citealp command. The output is the same without hyperref, but with hyperref you get line breaks. – moewe Apr 25 '18 at 12:38
  • Seems that in general xeCJK is quite good at automatically inserting spaces between CJK and Latin characters. But if hyperref gets involved, this ability is inhibited. I would say that in this case it is no problem to add the space yourself, after all you would do so in a text with Latin characters as well. – moewe Apr 25 '18 at 12:52

Your Answer

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

Browse other questions tagged or ask your own question.