![土耳其语.ldf 和使用 lualatex 的字体替换](https://linux22.com/image/399633/%E5%9C%9F%E8%80%B3%E5%85%B6%E8%AF%AD.ldf%20%E5%92%8C%E4%BD%BF%E7%94%A8%20lualatex%20%E7%9A%84%E5%AD%97%E4%BD%93%E6%9B%BF%E6%8D%A2.png)
参考这个帖子: Xelatex 与 Lualatex 以及字体替换 下面的代码
\documentclass[a4paper,12pt]{article}
\usepackage{ifxetex,ifluatex}
\usepackage{fontspec}
\ifluatex
\usepackage[turkish,italian]{babel}
\babelfont[italian]{rm}[Ligatures=TeX]{FreeSerif}
\babelfont[turkish]{rm}[Ligatures=TeX]{FreeSerif}
\fi
\ifxetex
\setmainfont[Ligatures=TeX]{FreeSerif}
\usepackage{polyglossia}
\setmainlanguage[babelshorthands=true]{italian}
\setotherlanguage{turkish}
\fi
\begin{document}
\selectlanguage{turkish}
\verb!\MakeUppercase{aabbccddiixx}! \MakeUppercase{aabbccddiixx}
\verb!\MakeUppercase{aabbccddııxx}! \MakeUppercase{aabbccddııxx}
\verb!\MakeLowercase{AABBCCDDİİ}! \MakeLowercase{AABBCCDDİİ}
\verb!\MakeLowercase{AABBCCDDII}! \MakeLowercase{AABBCCDDII}
fi ffi
\end{document}
如果我使用 lualatex 进行编译,会出现一些错误:
(/usr/local/texlive/2019/texmf-dist/tex/generic/babel/locale/tr/babel-turkish.t
ex
! LaTeX Error: Can be used only in preamble.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.13 \StartBabelCommands
*{turkish}{}
?
! Undefined control sequence.
l.14 \SetCase
?
! Missing number, treated as zero.
<to be read again>
\relax
l.15 {\uccode`i=
`İ\relax
?
! Missing number, treated as zero.
<to be read again>
\relax
l.16 \uccode`ı=
`I\relax}
?
! Missing number, treated as zero.
<to be read again>
\relax
l.17 {\lccode`İ=
`i\relax
?
! Missing number, treated as zero.
<to be read again>
\relax
l.18 \lccode`I=
`ı\relax}
?
! Undefined control sequence.
l.19 \SetHyphenMap
{%
?
! LaTeX Error: Can be used only in preamble.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.22 \EndBabelCommands
您可以在此处查看 .log 文件: 土耳其语.log
我的发行版是 Texlive 2019,一直在升级。事实上,我拥有 turkish.ldf 的最新版本(2019/07/05 v1.4)