summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/substitutefont/cyrillic-lm-lgc.tex
blob: 2e68c7b876a29d0d058482d8d7099285b5d412dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
\documentclass[a4paper]{scrartcl}
\usepackage{fixltx2e} % LaTeX patches, \textsubscript
\usepackage[T2A, T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[russian,english]{babel}
\usepackage[colorlinks=true,linkcolor=blue,urlcolor=blue]{hyperref}
\usepackage{bookmark}
\usepackage{parskip}
\pagestyle{empty}

% Combine "Latin Modern" fonts for Latin and
% "CLG" fonts for Cyrillic.
\usepackage{substitutefont}
\usepackage{lmodern}
\substitutefont{T2A}{lmr}{fcm}
\substitutefont{T2A}{lmss}{fcs}
\substitutefont{T2A}{lmtt}{fct}

\begin{document}

\section*{Cyrillic fonts to match Latin Modern}

Declaring the font encoding T1 (by inclusion in the option list for fontenc)
is recommended, if the text contains accented Latin characters as is usual
in most European languages and even in some English words (e.g. \emph{Résumé
of Nathan Söderblom}). However, the original Computer Modern fonts (CM) are
not available in T1 encoding. There are two alternative CM-compatible vector
fonts supporting T1:

\begin{itemize}

\item The \href{http://www.ctan.org/pkg/cm-super}{CM-Super} package installes
      itself as CM substitute and is used for Cyrillic text, too. 

\item \href{http://www.ctan.org/pkg/lm}{Latin Modern} does not include Cyrillic
      fonts. The default substitution is CM, either CM-Super or
      \href{http://www.ctan.org/pkg/LH}{LH} bitmap fonts.
\end{itemize}

The preamble code of this document uses \emph{substitutefont} to set up the
vector-fonts from the \href{http://www.ctan.org/pkg/cm-lgc}{cm-lgc}
package as a Cyrillic replacement for Latin Modern.

\section{\foreignlanguage{russian}{Тест шрифтов}}

\newcommand{\teststring}{Hello world! 
	    \foreignlanguage{russian}{Здравствуй, мир!}}

\begin{description}
  \item [Normal:] \teststring

  \item [it:] \textit{\teststring}

  \item [sl:] \textsl{\teststring}

  \item [bf:] \textbf{\teststring}

  \item [bf it:] \textbf{\textit\teststring}

  \item [sc:] \textsc{\teststring}

  % \item [bf sc:] \textsc{\textbf\teststring} missing in Didot

  \item [sf:] \textsf{\teststring}

  \item [sf bf:] \textsf{\textbf\teststring}

  \item [sf sl:] \textsf{\textsl\teststring}

  \item [sf sc:] \textsf{\textsc\teststring}

  \item [tt:] \texttt{\teststring}

\end{description}

\selectlanguage{english}

The Russian language definition switches the font encoding from
\emph{cyrillicencoding} to \emph{latinencoding} when changing from Russian
to another language. Babel base sets the variable \emph{latinencoding} to T1
if this font encoding is declared and to OT1 else.

\selectlanguage{russian}

До свидания!

\end{document}