3

I am new in latex and trying to LH fonts for output different Cyrillic texts. Can someone help me, please!!! I need something like that

\documentclass[10pt,a5paper,draft]{book}
\usepackage[T2A]{fontenc}
\usepackage[utf8x]{inputenc}
\usepackage[russian, english]{babel}

\begin{document}

    Какой-то осмысленный текст1.

    Какой-то осмысленный текст2.

\end{document}

Now it is two the same fonts, but I want them to be different. I know, that I can use xetex to use different fonts, but I need latex, so I found that I can use lh fonts. But I do not know how to include them.

Maria
  • 145
  • Your example works fine for me, apart for the environment text1 and text2 that are not defined. What are these suppose to do? – Arthur Reutenauer May 27 '15 at 17:44
  • Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. – Sverre May 27 '15 at 17:54
  • I want them to show two different font types. I can have wrong style, but I do not know the right one. – Maria May 27 '15 at 17:55
  • 1
    Please explain in your question what the problem is, instead of just saying "help me". Removing your undefined environments, the document compiles just fine. – Sverre May 27 '15 at 17:56
  • @Sverre Ok, sorry. I will try – Maria May 27 '15 at 17:58
  • It's not quite clear to me why you are asking how to include the lh fonts. You are already using them in the document you're providing here. – Sverre May 27 '15 at 18:33
  • There is no obvious connection between your question and the answer you've accepted. You're asking how to use Cyrillic fonts with latex, but the answer you've accepted is telling you how to change from serif fonts to sans serif and typewriter fonts, and this has nothing to do with Cyrillic. I'm therefore voting to close as 'unclear what you're asking'. – Sverre May 28 '15 at 10:23
  • @Sverre That is not even a reason to close a question. You don't get to say which answer is to be accepted. It is an exclusive right of the asker. – percusse May 28 '15 at 12:05
  • @percusse That's not what I meant. I have no objections to the answer accepted or that the OP accepted it (nor did I say I did). My point was that it revealed (also from the comments to the accepted answer) that there is no obvious link between the original question and what the OP actually wanted to know. So the original question is simply very unclear, and that's why the three answers provided just guess what the OP wants. So that's why I've voted "unclear what you're asking". – Sverre May 28 '15 at 12:31
  • @Sverre Still it is pretty clear that it is a valid question. There might be only ambiguity of the intent but that is not enough to close valid questions. Closing a question is about its fit for the site not for the purpose. The reason why I'm engaging with this reason is that once you vote for it, it is almost 100% sure that the question will be closed because we have robo-reviewers and I think that's a shame. Hence please don't vote on valid questions for the sake of content. – percusse May 28 '15 at 12:34
  • @percusse I think we just have to agree to disagree on whether the question should be closed or not. – Sverre May 28 '15 at 12:39
  • @Sverre Not if there is a possibility if I can also vote for not closing and the system takes it into account. It only counts the close votes but not the leave open ones. Hence it is not that of a two-side argument which you skip your side. – percusse May 28 '15 at 12:44
  • @percusse I recommend you open a question on a meta site about the nature of the closing procedure. This doesn't really have anything to do with this specific question anymore (I think the question is too unclear, you don't), so we shouldn't continue this discussion here. – Sverre May 28 '15 at 12:55
  • @Sverre Have a look at meta. Clearly you haven't been there much lately. – percusse May 28 '15 at 12:56

3 Answers3

4

I think that does what you want:

\documentclass[10pt,a5paper,draft]{book}
\usepackage[T2A]{fontenc}
\usepackage[utf8x]{inputenc}
\usepackage[russian, english]{babel}

\begin{document}

\rmfamily
Какой-то осмысленный текст1.

\sffamily
Какой-то осмысленный текст2.

\ttfamily
Какой-то осмысленный текст3.

\end{document}

It produces

three different styles of font

Arthur Reutenauer
  • 2,920
  • 19
  • 17
  • Thank you so much! But where from did you get the names of the families? Like \sffamily1 and \ttfamily? – Maria May 27 '15 at 18:30
  • 1
    The line \fontfamily{lh}\selectfont shouldn't be used here. latex will just tell you that lh is undefined, and fall back on Computer Modern instead. It's best to just remove it. – Sverre May 27 '15 at 18:39
  • @Maria, see http://en.wikibooks.org/wiki/LaTeX/Fonts#Font_families – Sverre May 27 '15 at 18:41
  • @Maria These are the three types of fonts defined by LaTeX: Roman, Serif, Typewriter. See the link provided by Sverre for more detail. – Arthur Reutenauer May 27 '15 at 19:57
  • You of all people should post an answer that uses XeTeX and fontspec. :-) – Martin Schröder May 27 '15 at 23:36
  • @Sverre Thanks, fixed it. Note that the font it uses really are the LH fonts, actually; the families are called cmr, cmss, etc. but that’s because they’re the default names, and the font files called in the T2A encoding are the LH fonts. @Martin I was going to do it actually, but I was posting from my phone last night and it was not very convenient. – Arthur Reutenauer May 28 '15 at 16:24
3

You can use the lh fonts by adding \usepackage{lh-lcy}, but you also have to mark the places where Russian is to be used.

\documentclass[10pt,a5paper,draft]{book}
\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english,russian]{babel}
\usepackage{lh-lcy}

\begin{document}

Какой-то осмысленный текст1.

Какой-то осмысленный текст2.

\end{document}

enter image description here

Here the default language is Russian. If you switch the languages, the default one will be English and you can do

\documentclass[10pt,a5paper,draft]{book}
\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[russian,english]{babel}
\usepackage{lh-lcy}

\begin{document}

Some text in English.

\begin{otherlanguage*}{russian}
Какой-то осмысленный текст1.

Какой-то осмысленный текст2.
\end{otherlanguage*}

\end{document}

enter image description here

egreg
  • 1,121,712
2

If you want to use different fonts within a document, then you need to tell latex to switch to another font when you want this to happen, see How do I use a particular font for a small section of text in my document?

\documentclass{article}
\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}

\begin{document}
\noindent Какой-то осмысленный текст1.\\ % Computer Modern font
\fontfamily{fdr}\selectfont Какой-то осмысленный текст2. % Droid font
\end{document}

enter image description here

A list of available T2A Cyrillic fonts is given here.

Sverre
  • 20,729