是否可以在 LuaLaTeX 中僅載入連字符,而不載入 babel 或 polyglossia?

是否可以在 LuaLaTeX 中僅載入連字符,而不載入 babel 或 polyglossia?

僅使用 lualatex,最新(2020 年後)版本。始終為 utf-8,始終為 OpenType 字體。語言將是主要的西歐語言之一,可能是拉丁字母的東歐語言,而不是其他語言。最重要的是:沒有數學!沒有蒂克茲!沒有桌子!沒有bibtex!只是普通的文學打字。

問題:是否可以載入和使用特定於語言的連字符,但同時不載入 babel 或 polyglossia?如果可以的話,需要什麼?文件將是單語的。

我問的原因:babel 和 polyglossia 都有大量選項和指令。這些包不僅載入連字符,還進行排版調整。我希望將可用的調整限制為少量(例如法語間距、引號樣式),我將以其他方式對其進行編碼。我的用戶群寫文學,不寫數學,也不寫專業文章。眾多宏命令序列中的某些會造成妨礙。

答案1

有一個用於此目的的短包,luahyphenrules.它讀起來language.dat就是這樣babel,僅此而已。這是一個例子:

\documentclass{article}

\usepackage{luahyphenrules}

\begin{document}

\HyphenRules{spanish}

\showhyphens{supercalifragilisticexpialidocious}

\HyphenRules{english}

\showhyphens{supercalifragilisticexpialidocious}

\end{document}

日誌顯示:

Underfull \hbox (badness 10000) in paragraph at lines 9--9
[] \TU/lmr/m/n/10 su-per-ca-li-fra-gi-lis-ti-cex-pia-li-do-cious

Underfull \hbox (badness 10000) in paragraph at lines 13--13
[] \TU/lmr/m/n/10 su-per-cal-ifrag-ilis-tic-ex-pi-ali-do-cious

答案2

我不確定我會推薦它,但你可以輸入模式

\documentclass{article}

\newlanguage\frfr
\language=\frfr
\input{loadhyph-fr}
\language=0

\begin{document}


\typeout{EN}
\showhyphens{quelques mots pas en anglais pour tester la césure}

\typeout{FR}
\language\frfr
\showhyphens{quelques mots pas en anglais pour tester la césure}

\end{document}

做一個日誌

EN

Underfull \hbox (badness 10000) in paragraph at lines 12--12
[] \TU/lmr/m/n/10 quelques mots pas en anglais pour tester la cé-sure
FR

Underfull \hbox (badness 10000) in paragraph at lines 16--16
[] \TU/lmr/m/n/10 quelques mots pas en an-glais pour tes-ter la cé-sure

顯示更改後的連字符。

相關內容