1

I would like to write a book with some pieces of poetry. This poems are writted in different languages (russian, hungrian...), with a french translation which is the main language of the book. If the text is copied directly with accentued letters, I obtain errors on the compilation. I didn't find trivial solution for a clean compilation. Thanks for your help. J-Y

By example, I have to write

Své{\~t}e  {\~t}íhiy s{\~v}{\t{ia}}tïya slávï {\~B}ess{\~m}értnago

I would like to write

Svét̃e t̃íhiy sṽi͡atïya slávï B̃essm̃értnago
  • 6
    As always on this site, you are much more likely to get help if you provide a full but minimal example that others can copy and test as is. It is also useful to know which engine you are using? – daleif Jan 03 '22 at 16:12
  • 3
    What language uses those strange accents? – egreg Jan 03 '22 at 16:14
  • 1
    @egreg It seems to be Church Slavonic (Свѣ́те ти́хїй ст҃ы́ѧ сла́вы, / безсме́ртнагѡ, ѻ҆ц҃а̀ нбⷭ҇нагѡ) but transcribed into Latin. – Marijn Jan 03 '22 at 16:47
  • @Marijn I found a table for romanization of Church Slavonic, but there's no tilde. – egreg Jan 03 '22 at 16:56

1 Answers1

1

You need to find a font with coverage of all the alphabets and accents, then select the font with the fontspec package and use XeLaTeX or LuaLaTeX to compile. One wide-coverage font is Noto (Sans or Serif) from Google.

MWE:

\documentclass{article}
\usepackage{fontspec}
\setmainfont{Noto Serif}
\begin{document}
Latin: Svét̃e t̃íhiy sṽi͡atïya slávï B̃essm̃értnago

Russian: Све́те ти́хий Святы́я сла́вы, безсме́ртнаго Отца́

Church Slavonic: Свѣ́те ти́хїй ст҃ы́ѧ сла́вы, / безсме́ртнагѡ, ѻ҆ц҃а̀ нбⷭ҇нагѡ \end{document}

Result:

enter image description here

As you see the Church Slavonic is not perfect (the бⷭ҇ character looks off) but overall it seems usable.

Marijn
  • 37,699
  • I added the answer here just to show a concrete example for the current use case, I also suggested a duplicate for the general question "how to print Unicode". – Marijn Jan 03 '22 at 17:14
  • Thanks for your answer. Noto fonts are downloaded and installed with the book fonts on my mac.

    With the xelatexe or lualatex I obtain this warning: LaTeX Font Warning: Some font shapes were not available, defaults substituted.

    – Jean-Yves L Jan 06 '22 at 07:31
  • @Jean-YvesL that warning should not be produced by my small example document above, do you mean it is produced by your full document? This usually means that you try to use a style that is not supported by the font, like bold monospace or italic smallcaps or something. The full log file should also contain more detailed warnings on which shape is undefined. If the appearance in the pdf is still acceptable you can just ignore the warning, otherwise you can try to find another font that defines the missing style/shape. – Marijn Jan 06 '22 at 07:47
  • thanks for your analyse --- I didn't use specific font, like bold monospace or italic smallcaps or something --- after looking in the log file in found some items like that: LaTeX Font Info: Trying to load font information for OT1+txr on input line 4 3. (/usr/local/texlive/2020/texmf-dist/tex/latex/txfonts/ot1txr.fd File: ot1txr.fd 2000/12/15 v3.1 ) LaTeX Font Info: Trying to load font information for U+txmia on input line 4 3. --- and also: LaTeX Font Warning: Font shape OML/NotoSerif(0)/m/n' undefined (Font) usingOML/txmi/m/it' instead on input line 9. ) – Jean-Yves L Jan 07 '22 at 11:07
  • @Jean-YvesL that is quite strange, m/n is medium (i.e., not bold) normal (i.e., upright, so not italics or smallcaps), this should be defined for any font except for special-purpose fonts like typewriter or calligraphy. You could ask a new question, with a full reproducible example that causes this warning, to check what the problem is (it is not directly related to the current question, which is how to input accented letters directly). – Marijn Jan 07 '22 at 12:33
  • Thanks for the proposal. At this time I'not allowed to post a new question. I'm a poor new member without credit to ask them... Be patient please :-) – Jean-Yves L Jan 07 '22 at 18:12