
我有文字和我自己的連字符表
\hyphenation{al-a ko-ta mie-ć mu-si}
如何禁用連字符並仍然使用自己的連字符?我不僅添加連字符。我必須刪除所有連字符,然後添加我自己的連字符。
也許我必須創建自己的連字符文件?新的定義語言?
\documentclass[a4paper, 12pt]{article}
\usepackage{fontspec}
\usepackage{polyglossia}
\setotherlanguage{polish}
\begin{document}
\hyphenation{al-a ko-ta mie-ć mu-si}
Tu sa inne zdania i nawet bardzo długaśne. Łojej, Ala żółtego kota mieć musi, a nie żabę.
\end{document}
我用 編譯xelatex
,但我的問題是針對任何 tex/latex/lualatex 等 –
答案1
如果您的語言不是波蘭語,則不要載入該語言。
只需啟動nohyphenation
即可完成。在範例中,\parbox{0pt}
強制 TeX 盡可能使用連字號。
\documentclass[a4paper, 12pt]{article}
\usepackage{fontspec}
\usepackage{polyglossia}
\begin{document}
\hyphenrules{nohyphenation}
\hyphenation{al-a ko-ta mie-ć mu-si}
\lefthyphenmin=1 \righthyphenmin=1
\parbox{0pt}{Tu sa inne zdania i nawet bardzo długaśne.
Łojej, Ala żółtego kota mieć musi, a nie żabę.}
\end{document}
如果您需要支援其他語言,方案如下:
\documentclass[a4paper, 12pt]{article}
\usepackage{fontspec}
\usepackage{polyglossia}
\setmainfont{Linux Libertine O} % a font with support for Greek
\setmainlanguage{english}
\setotherlanguage{polish}
\setotherlanguage{greek}
\newenvironment{fantasylanguage}
{\hyphenrules{nohyphenation}\lefthyphenmin=1 \righthyphenmin=1 }
{}
\begin{hyphenrules}{nohyphenation}
\hyphenation{al-a ko-ta mie-ć mu-si}
\end{hyphenrules}
\begin{document}
\begin{fantasylanguage}
\parbox{0pt}{\hspace{0pt}Łojej, Ala żółtego kota mieć musi, a nie żabę.}
\end{fantasylanguage}
\medskip
\begin{greek}
θaλb εcπdδ
\end{greek}
\end{document}