# Which is the appropriate inputenc option for Slovak?

I have written latex document in English. Now I want to rewrite the same document in Slovak.

What I found is this:

``````\usepackage[utf8]{inputenc}
``````

just use this:

``````\usepackage{ucs}
\usepackage[utf8x]{inputenc}
\usepackage[slovak,english]{babel}
\newcommand\sktxt[1]{\foreignlanguage{slovak}{#1}}
``````

Text written in Slovak would start: `\sktxt{<Slovak text>}`.

It simply doesn't work with this simple makeover. The pdf output doesn't build.

I'm using Windows/MiKTeX 2.9/TeXnicCenter and I usually build the Latex file (output as pdf) via shift-Ctrl-F5 or just simply in top panel - build.

-
Welcome to TeX.sx!. Try without `ucs` and `utf8x`-option in `inputenc`. And side question: Is this intentionally, that English is the main language and not Slovak? –  Speravir Jan 29 '13 at 18:20
Can you give an example of the `<Slovak text>` that fails? –  egreg Jan 29 '13 at 18:28
@egreg: simply the letters with the specific diacritic mark are missing. So something is wrong with the setting. –  Max Jan 29 '13 at 19:09
@Speravir: I'm using LaTex primarily (or actually only) with English text but this is first time I want to write something in Slovak. There is no specific intention why there should be English as the primary language for this particular document. It can be very much also in pure Slovak. –  Max Jan 29 '13 at 19:11
The language you use most should be obviously the main language. Another question: The document is saved in UTF-8? So you use a UTF8-aware version of TeXnicCenter? And provide, please, a minimal (not) working example (MWE) with some Slovak text, as also requested by egreg. –  Speravir Jan 29 '13 at 19:36

``````\usepackage[slovak]{babel}
\usepackage[cp1250]{inputenc}
\usepackage[T1]{fontenc}
``````

Including the few lines above solved the problem. It is very likely that I had some contradictory commands in the preamble that it cased not to work. For other languages I assume simply swapping Slovak for e.g. German should work as well.

-
Actually this did solve the problem only partly. By installing newer version of TeXnicCenter2 and including the \usepackage[utf8x]{inputenc}, and \usepackage[slovak]{babel}, I was able to fully use the diacritics of Slovak. Also it is important that you save the file as UTF-8. This contribution is just to correct in case someone else is following similar problem. Thanks. –  Max Jan 30 '13 at 15:47
Max, sorry, but this is not an answer to your question or terribly wrong! The file must be saved in the encoding or a superset of, what you give in the argument of `inputenc`. From your “answer” I guess, you use version 1.0RC of TeXnicCenter, what is not UTF8-aware! You should install the recent beta-version or a different TeX editor, cf. also LaTeX Editors/IDEs. At first you could try with TeXworks, what is included both in MiKTeX and TeX Live. –  Speravir Jan 30 '13 at 16:22
@Max If an editor has no or partial support for UTF-8, then throw it away. UTF-8 is the way to go; and prefer the `utf8` option to `utf8x`: the former is more robust and supported than the latter. –  egreg Jan 30 '13 at 19:10
After the title edit your answer is not wrong anymore. But for German and other West-European languages in Windows the charset is “windows-1252”/“cp-1252”, and for this there’s also an alias `ansinew` as `inputenc` option. –  Speravir Feb 3 '13 at 23:21
Thank you. Yes I forgot apart of other things to mention that I have upgraded to TeXnicCenter Beta version and with that few lines added the issue has been sorted. Yes the utf8 is the way to go not utf8x, correct. –  Max Feb 4 '13 at 15:48