# How to use foreign language in pdflatex?

I use pdflatex for my thesis which is written mostly in English. For that purpose I use \usepackage[english]{babel} in the preamble. However, I must provide also Czech version of the abstract. Even though the local characters are displayed well (such as "ěščř"), they can't be copied properly (after paste the result is "ˇeˇsˇcˇr").

Initially I tried \usepackage[czech]{babel} which lead to the following error:

! Package babel Error: Unknown option czech'. Either you misspelled it


What I intend to do is having the whole thesis in English style, i.e. using \usepackage[english]{babel} and mark my abstract as Czech like this:

\foreignlanguage{czech}{My long abstract...}


According to the first mentioned error, I assume that I haven't installed czech package yet (for pdflatex). I use Ubuntu.

\$ apt-cache search latex czech
texlive-lang-czechslovak - TeX Live: Czech/Slovak


However, the czechslovak language option doesn't work either. So the questions: How to achieve previously described behavior? What to install? How to enable it?

• As far as I know, the required package is named babel-czech. – Bernard May 14 '15 at 9:48
• czech works for me using TL on Linux. Usually, when you change the language a warning appears when you compile. Did you compile twice in a row? – Sigur May 14 '15 at 9:50
• babel-czech doesn't seem to exists (at least in standard ubuntu repository)... @Sigur I compile twice, however it isn't a warning but an error – petrbel May 14 '15 at 9:52
• @petrbel, are you using TL from the repository or did you install it from the iso image? – Sigur May 14 '15 at 9:53
• After you install texlive-lang-czechslovak you should still do \usepackage[czech]{babel}, what else? – egreg May 14 '15 at 9:53

First make sure you installed Tex Live properly, the command is

sudo apt-get install texlive-full


Then you can try setting your document as utf-8 with inputenc (compiled with pdflatex).

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[main=english,czech]{babel}

\begin{document}

This is some text in english.

\foreignlanguage{czech}{Český jazyk neboli čeština je západoslovanský jazyk, nejbližší slovenštině, poté polštině a lužické srbštině.}

\end{document}

• I have utf-8 set, thus the characters are displayed well. But it does not solve my problem with czech package that, apparently, is not present. – petrbel May 14 '15 at 9:54
• @petrbel How did you install the packages in Ubuntu? Did you do sudo apt-get install texlive-full? – Alenanno May 14 '15 at 9:56
• I think you want \usepackage[main=english,czech]{babel} and the Czech part in a \foreignlanguage`. – Andrew Swann May 14 '15 at 9:59
• @AndrewSwann If he installed the packages, he should be able to do it without any use of tags. – Alenanno May 14 '15 at 10:01
• @petrbel Try these questions (to see if they help): How do I install an individual package on a Linux system? and How to install a language package in Texmaker on Ubuntu 12.04? – Alenanno May 14 '15 at 10:02