1

I am witing a document that is almost entirely in English but abstract will be in Czech as well as my name on the title page so I need the support of Czech characters. Until now I never had problems with this but now TeXmaker does not compile the characters the way it should. I tried \usepackage[czech,english]{babel} in combination with \selectlanguage{czech} but none of them is working as well. Here's the main body of the document, I further include external files:

\documentclass[a4paper,12pt]{report}
\usepackage[cp1250]{inputenc}
\usepackage[IL2]{fontenc}
\usepackage{epsf,graphics,amsmath,amsfonts,amssymb,amsthm}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{latexsym}
\usepackage{epsfig}
\usepackage{color}
\usepackage{enumitem}
\usepackage{array}
\usepackage{booktabs}
\usepackage{caption}
\usepackage{hyperref, color, xcolor}
\definecolor{grey}{RGB}{160,160,160}
\urlstyle{same}
\usepackage{acronym}
\usepackage[nottoc]{tocbibind}
\usepackage{tablefootnote}
\usepackage{eurosym}
\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\hypersetup{linkcolor = grey,citecolor = grey,    citebordercolor = grey, linkbordercolor = grey, urlbordercolor = grey
}
\renewcommand{\baselinestretch}{1.5}
\hoffset -1.54cm \voffset -0.04pt \evensidemargin 1.5cm%\hoffset -1.54cm \voffset -0.04pt \evensidemargin 1.5cm
\oddsidemargin 2.5cm \topmargin -0.6cm  %-1,6
\textheight 237mm \textwidth 150mm

\usepackage{chngcntr}
\captionsetup{aboveskip=4pt}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[L]{Top Left}
\fancyhead[R]{Top Right}
\renewcommand{\headrulewidth}{0.4pt}

\begin{document}\pagenumbering{roman}
\include{titlepage} 
\include{declaration}
\include{abstrakt} 
        \pagestyle{fancy}                                                           %headers style
\fancyhf{}
\fancyhead[L]{\textcolor{black} {\nouppercase  \leftmark}}
\fancyhead[R]{\textcolor{black} {\thepage}}
\renewcommand{\headrulewidth}{0.4pt}                                                        
\pdfbookmark[0]{Contents}{toc}   
\tableofcontents
\clearpage

\include{acronyms}
\include{listoffiguresandtables}

\clearpage
\pagenumbering{arabic}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[L]{\textcolor{black} {\nouppercase  \leftmark}}
\fancyhead[R]{\textcolor{black} {\thepage}}
\renewcommand{\headrulewidth}{0.4pt}

\include{maintext}
\bibliographystyle{acm}
\bibliography{Bibliography}
\include{references}
\include{appendixA}
\include{appendixB}
\end{document}

The title page looks like this:

\pagestyle{empty}
\begin{center}
\textbf{\LARGE{CHARLES UNIVERSITY IN PRAGUE}}\\
\Large{FACULTY OF SOCIAL SCIENCES}\\
\large{Institute of Economic Studies}\\
\vspace{11mm}
\includegraphics[scale=0.3]{karelII.pdf}\\
\vspace{12mm}
\Large{BACHELOR THESIS}\\
\vspace{12mm} 
\textbf{\LARGE{Predatory pricing in the airline industry}}\\
\end{center}
\vspace{55mm}

\noindent Author: \textbf{Široký}\\
\noindent Supervisor: \textbf{Name}\\
\noindent Year of defence: \textbf{2014}

Does someone know what could be the problem?

THANKS A LOT

  • 1
    Please always post a complete document that shows the problem, but first check that your document is encoded in cp1250 (not for example in utf8, which is how it is encoded on this web page) other unrelated comments don't load eps,epsfig or graphics packages load graphicx, no need to load color if you load xcolor, no need to load amsmath amsfonts twice, don't use \Large{BACHELOR THESIS} \Large does not take an argument so that makes the rest of the document large, use {\Large BACHELOR THESIS} so it is contained to that line (or better {\Large BACHELOR THESIS\\} – David Carlisle May 9 '14 at 13:37
  • The PDF file shows a clear symptom: your TeX file is UTF-8 and you have \usepackage[cp1250]{inputenc}. Change cp1250 into utf8. – egreg May 9 '14 at 14:01
  • 1
    @egreg oops I just said that in an answer. Still, you don't need the points:-) – David Carlisle May 9 '14 at 14:03
3

So my guess was right titlepage.tex is utf8 but you have declared

\usepackage[cp1250]{inputenc}

use [utf8]

| improve this answer | |
  • Woderful, now it's working perfectly. And it was such a stupid thing. THANK YOU Can I have one more question? How do I find what encoding was set when the document was created and is it possible to change it later? Because there is nothing explicitly declared in the titlepage.tex, is there? Probably a stupid question again but this is my first larger document and hopefully next time when I experience issues I'll be able to solve them on my own – clownp May 9 '14 at 14:12
  • @clownp most text editors let you save the file in another encoding. I sort of knew the answer without looking (it's not like you're the first person to describe that problem:-) but what I actually did was just download titlepage.tex and ran the (unix or cygwin) file command on it which said it was utf-8. But if you see weird accented A in a pdf file or web page or anywhere it is almost always that the multiple byte utf-8 encoding is being read as one byte per character, as European characters in UTF8 have an initial byte that is usually an accented A if read using an iso-8859 code page – David Carlisle May 9 '14 at 14:25

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.