1

I posted a semi similar question a while ago where I asked about why the ы character did not appear correctly at all on TNR with the acute accent when using \'ы. I have a Chromebook and have downloaded the (seemingly) latest version (7.05) of Times New Roman, which also looks to be the same versions that Windows 11 uses, since the version I have now supports small caps and more glyphs that didnt work before for me.

With TNR 7.05, when using , it will sometimes have the accent put in the right spot, but when using it in a sentence, it seems to not work. It has the right position in the first part of my example, but I'm not sure why its so unconsistent. This doesn't only apply to TNR, since in my example, STIX Two Text is also affected.

\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}

enter image description here

I believe that if you have Windows, my \setmainfont code should work regardless of if you have downloaded the files for the TNR variants through the web or somewhere else.

Its weird that it will look different depending on where it is placed, can someone please help with this? I would greatly appreciate it.

10
  • tex.stackexchange.com/a/708196/1090 Commented Feb 8 at 10:01
  • @DavidCarlisle i added the windows version to my overleaf setup by looking up the latest version online. That works even on a chromebook. That's why I have different code. Commented Feb 8 at 14:55
  • Well, I don't own/have windows, so it wouldn't be a problem, right? @DavidCarlisle Commented Feb 8 at 15:07
  • @DavidCarlisle asked about the font license. That is not a silly comment, it is important. Many fonts that come with a system or softwar may only be used with that system or software, and perhaps may not be used in digital publications (only print to paper).
    – user287367
    Commented Feb 8 at 18:04
  • @rallg if I found it online and its not taking profits away (TNR IS free on windows, after all), then I should be able to use it. I dont plan to make any material using it for profit. Commented Feb 8 at 19:02

3 Answers 3

3

There is an alternative approach, which has the advantage hyphenation points aren’t dropped (sadly, HarfBuzz in hyphenated languages doesn’t always work as expected). It’s based on a transform:

\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}

Of course, it’s just a workaround. It gives: enter image description here

3
  • seeing this suggested an alternative of adjusting the patterns rather than post processing the resulting list (I posted an answer) Commented Feb 8 at 16:39
  • @JavierBezos I honestly feel overloaded with the two options that you and David provided, is there a use case for one and another? Is yours better? Commented Feb 8 at 18:28
  • @FelixMaldonado Mine is more general. It works in your case and in many others (including Greek and Latin scripts), at the cost of a (very small) speed penalty. Davis’s is ad hoc: it works in your case, but if you also use, say, the combining diaeresis, then the corresponding pattern must be added. Which is better is relative. Commented Feb 10 at 6:22
4

The problem is hyphenation, see also https://tex.stackexchange.com/a/340164/2388 and https://github.com/latex3/luaotfload/issues/267.

The issue should really be resolved generally. Until then if you use the harfbuzz-Renderer the problem disappears:

\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}

gives

enter image description here

3

enter image description here

You can add a pattern to prevent hyphenation before the combining character as shown below the rule in this example

A better babel interface, to be used in the preamble would be

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

But here, just in the test example, I use a lower level \patterns form so I can demonstrate with and without this pattern switching mid document.

\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}
4
  • Another option, indeed (and faster), provided 9 is not used and the pattern doesn’t exist (fortunately, that's not the case). There is a command in babel to (re)define patterns: \babelpatterns[russian]{8^^^^0301}. If the pattern exists, it gets replaced. Commented Feb 8 at 16:50
  • @JavierBezos ah thanks I thought there would be, I'll change to use that. Yes it's a shame the highest even number isn't quite high enough but it is what it is:-) (presumably the standard patterns could have such a clause for all combining accents?) Commented Feb 8 at 16:53
  • @DavidCarlisle I hate to ask the same damn thing over and over again, but is this method you did better than what Bezos did? You seem to imply you wanted to improve upon his method with your comment on his reply. Commented Feb 8 at 18:26
  • @FelixMaldonado this method could (potentially) be upstreamed to be added to the default patterns so it worked out of the box, Javier's is slower but potentially more complete as someone could over-ride my answer with a value 9 forcing hyphenation trumping my value 8, short form: my answers are natuarally always the best;-) Commented Feb 8 at 19:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .