1

So I am doing some paper for school and I've been struggling to find how to do Cyrillic in LaTeX, now I cracked that part, but still can not find a way to write names of chapters, section etc. in Cyrillic... I am only getting error in form of latex log(i.e. open latex log)

Anyway, here is what I did:

\documentclass[a4paper, 12pt]{report}

%% Language and font encodings
\usepackage[T2A]{fontenc}
\usepackage[utf8x]{inputenc}
\usepackage[serbianc]{babel}

%% Sets page size and margins
\usepackage[a4paper,top=2.5cm,bottom=2.5cm,left=3cm,right=2cm]{geometry}

%% Useful packages
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage[colorinlistoftodos]{todonotes}
\usepackage[colorlinks=true, allcolors=blue]{hyperref}


\begin{document}
\fontencoding{T2A}\selectfont

\tableofcontents
\thispagestyle{empty}
\cleardoublepage

\pagestyle{plain}
\chapter{Увод}
%%...
\end{document}
  • Your code compiles for me without an error. What is your problem exactly? – bmv Dec 27 '17 at 19:55
1

Your code is essentially fine, but there are two fixes to be done.

  1. Don't use utf8x, but utf8 for inputenc.
  2. Add the unicode option for hyperref, in order to get good bookmarks.
  3. Issuing \fontencoding{T2A}\selectfont is not necessary.

Here's the fixed code.

\documentclass[a4paper, 12pt]{report}

%% Language and font encodings
\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc} % <--- not utf8x
\usepackage[serbianc]{babel}

%% Sets page size and margins
\usepackage[a4paper,top=2.5cm,bottom=2.5cm,left=3cm,right=2cm]{geometry}

%% Useful packages
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage[colorinlistoftodos]{todonotes}
\usepackage[
  colorlinks=true,
  allcolors=blue,
  unicode, % <-- for correct bookmarks
]{hyperref}

\begin{document}

\tableofcontents
\thispagestyle{empty}
\cleardoublepage

\pagestyle{plain}

\chapter{Увод}

%%...

\end{document}

enter image description here

  • Thank you very much! It works, it actually works, finally, woah. Thank you, really! :-) – Zadaci Aops Dec 28 '17 at 22:42

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.