4

A good translitteration method from cyrillic to latin characters using XeLaTeX is discussed in Using XeTeX for automatic transliteration of cyrillic letters

Actually I'm using LuaLaTeX. the translitteration can be done by the use of \directlua as suggested by @DavidCarlisle in this post, Create a mapping for transliteration from cyrillic to latin in LuaLaTeX, which is actually the root post of this Question.

The present Question discuss the problems of the method suggested by @DavidCarlisle in this post, Create a mapping for transliteration from cyrillic to latin in LuaLaTeX, which uses \directlua.

General problems arise from the fact that Unicode system does not provide acute accented vowels, which are formed by the use of the "combining acute accent" character (\char"0301).

1. General accentuation problem

Both XeTeX and LuaTeX print in a wrong manner non translitterated acute accented capital cyrillic letters, because of a bug in the font I used (Linux Libertine O). This maybe fixed as posted in this Answer: Misplaced Accents in Cyrillic Text, but it forces to modify the text manually replacing, for example, Е́ with \'{E}.

2. Translitteration of acute accented Э́

The combination of "combining acute accent" and Ė it seems a hard work to get!

3. The true problem: translitteration of a predefined text string

It seems\directlua translitteration does not apply to a text defined in the preamble.

All of these problems are shown in the following code:

\documentclass{article}
\usepackage{fontspec}

\setmainfont{Linux Libertine O}

\setlength{\parindent}{0pt}
\def\textsample{Здравствуй, Мир} 


\begin{document}

    \textsample \par
    Здравствуй, Мир \par
    Э э    Э́ э́ \par \vspace{\baselineskip}

    \directlua{require("cyrtr2")}
    Translitteration by \verb\directlua\ \vspace{\baselineskip} 

    \textsample \par
    Здравствуй, Мир \par
    Э э    Э́ э́ \\    %problems if translitterated with 'Ė ė'

\end{document}

enter image description here

5

the problem with accents on capital letters is apparently a problem with the libertine font, as noted in your other question.

The transliteration would apply to the preamble if you did

\directlua{require("cyrtr2")}

earlier.

Probably you are looking for

\directlua{luatexbase.remove_from_callback(
"process_input_buffer",
"cyrillic transliteration")

to turn it off as well as

\directlua{
luatexbase.add_to_callback(
"process_input_buffer",
cyrtr,
"cyrillic transliteration")}

to turn it back on (you don't need to input the file with the big mapping each time)

  • The suggestion was clear and efficient. Thank you, @DavidCarlisle. As you can understand from my problems, I'm not expert in lua! I actually found another problem with the transliteration method involving acute accented letter 'и' 'i'. I put the Question here: tex.stackexchange.com/questions/286112/… – Paolo Polesana Jan 5 '16 at 15:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.