(Overleaf 和 LuaLaTeX) ы 具有急性壓力,有時只能正常工作(使用 Times New Roman 和 STIX 兩個文本)

(Overleaf 和 LuaLaTeX) ы 具有急性壓力,有時只能正常工作(使用 Times New Roman 和 STIX 兩個文本)

我不久前發布了一個半類似的問題,我問為什麼 ы 字元沒有正確顯示根本不在 TNR 上使用時帶有尖銳的重音符號\'ы。我有一台Chromebook,並下載了(看似)最新版本(7.05) 的Times New Roman,它看起來也與Windows 11 使用的版本相同,因為我現在的版本支援小型大寫字母和更多以前無法使用的字形為我。

使用 TNR 7.05 時,使用 時,有時會將重音放在正確的位置,但在句子中使用時,似乎不起作用。它在我的範例的第一部分中具有正確的位置,但我不確定為什麼它如此不一致。這不僅適用於 TNR,因為在我的範例中,STIX Two Text 也會受到影響。

\documentclass[letterpaper,12pt]{article}

\usepackage{microtype}
\usepackage{unicode-math} % loads fontspec
    \setmainfont[BoldFont=Timesbd.ttf, ItalicFont=Timesi.ttf, BoldItalicFont=Timesbi.ttf]{Times.ttf}
    \newfontfamily\secondfont[Ligatures=TeX]{STIX Two Text}
\usepackage[main=english,russian]{babel} 

\begin{document}

\foreignlanguage{russian}{
\'ы ы́ 
}

When the unstressed vowels come at the end (\foreignlanguage{russian}{Б\'ыло}), they sound like A.

When the unstressed vowels come at the end (\foreignlanguage{russian}{{\secondfont Б\'ыло}}), they sound like A.

\foreignlanguage{russian}{
ф\'ыф
}

\end{document}

在此輸入影像描述

我相信,如果您使用的是 Windows,那麼\setmainfont無論您是否透過網路或其他地方下載了 TNR 變體的文件,我的程式碼都應該可以運作。

很奇怪,根據放置的位置它看起來會有所不同,有人可以幫忙解決這個問題嗎?我將不勝感激。

答案1

還有一種替代方法,其優點是連字符點不會被刪除(遺憾的是,HarfBuzz在連字符語言中並不總是按預期工作)。它是基於一個轉換:

\documentclass[letterpaper,12pt]{article}

\usepackage{microtype}
\usepackage{unicode-math} % loads fontspec
    \setmainfont
     [BoldFont=Timesbd.ttf, ItalicFont=Timesi.ttf, BoldItalicFont=Timesbi.ttf]{Times.ttf}
    \newfontfamily\secondfont[Ligatures=TeX]{STIX Two Text}
\usepackage[main=english,russian]{babel} 

% Add this transform, which removes discretionaries
% before combining characters:
\babelposthyphenation{russian}{ |[{0300}-{036F}] }{ remove, {} }

\begin{document}

\foreignlanguage{russian}{
\'ы ы́ 
}

When the unstressed vowels come at the end (\foreignlanguage{russian}{Б\'ыло}), they sound like A.

When the unstressed vowels come at the end (\foreignlanguage{russian}{{\secondfont Б\'ыло}}), they sound like A.

\foreignlanguage{russian}{
ф\'ыф
}

\end{document}

當然,這只是一個解決方法。它給: 在此輸入影像描述

答案2

問題是連字符,另請參閱https://tex.stackexchange.com/a/340164/2388https://github.com/latex3/luaotfload/issues/267

這個問題確實應該要普遍解決。在此之前,如果您使用 harfbuzz-Renderer,問題就會消失:

\documentclass[letterpaper,12pt]{article}

\usepackage{microtype}
\usepackage{unicode-math} % loads fontspec
    \setmainfont
     [Renderer=Harfbuzz,BoldFont=Timesbd.ttf, ItalicFont=Timesi.ttf, BoldItalicFont=Timesbi.ttf]{Times.ttf}
    \newfontfamily\secondfont[Ligatures=TeX]{STIX Two Text}
\usepackage[main=english,russian]{babel} 

\begin{document}

\foreignlanguage{russian}{
\'ы ы́ 
}

When the unstressed vowels come at the end (\foreignlanguage{russian}{Б\'ыло}), they sound like A.

When the unstressed vowels come at the end (\foreignlanguage{russian}{{\secondfont Б\'ыло}}), they sound like A.

\foreignlanguage{russian}{
ф\'ыф
}

\end{document}

給出

在此輸入影像描述

答案3

在此輸入影像描述

您可以新增模式以防止組合字符前出現連字符,如本範例中的規則所示

一個更好的 babel 介面,在序言中使用的是

\babelpatterns[russian]{8^^^^0301}

但在這裡,就在測試範例中,我使用了較低等級的\patterns形式,這樣我就可以在使用和不使用此模式切換中間文件的情況下進行演示。

\documentclass[letterpaper,12pt]{article}

\usepackage{microtype}
\usepackage{unicode-math} % loads fontspec
    \setmainfont
     [BoldFont=Timesbd.ttf, ItalicFont=Timesi.ttf, BoldItalicFont=Timesbi.ttf]{Times.ttf}
    \newfontfamily\secondfont[Ligatures=TeX]{STIX Two Text}
\usepackage[main=english,russian]{babel} 

% Add this transform, which removes discretionaries
% before combining characters:
%\babelposthyphenation{russian}{ |[{0300}-{036F}] }{ remove, {} }

\begin{document}

\foreignlanguage{russian}{
\'ы ы́ 
}

When the unstressed vowels come at the end (\foreignlanguage{russian}{Б\'ыло}), they sound like A.

When the unstressed vowels come at the end (\foreignlanguage{russian}{{\secondfont Б\'ыло}}), they sound like A.

\foreignlanguage{russian}{
ф\'ыф
}

\bigskip
\hrule
\bigskip

\foreignlanguage{russian}{
  \patterns{8^^^^0301}
}


\foreignlanguage{russian}{
\'ы ы́ 
}

When the unstressed vowels come at the end (\foreignlanguage{russian}{Б\'ыло}), they sound like A.

When the unstressed vowels come at the end (\foreignlanguage{russian}{{\secondfont Б\'ыло}}), they sound like A.

\foreignlanguage{russian}{
ф\'ыф
}

\end{document}

相關內容