1

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

What I found is this:

instead:

\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.

lockstep
  • 250,273
Maximilian
  • 133
  • 1
  • 7

1 Answers1

1
\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.

Speravir
  • 19,491
Maximilian
  • 133
  • 1
  • 7
  • 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. – Maximilian Jan 30 '13 at 15:47
  • 2
    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
  • 2
    @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 03 '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. – Maximilian Feb 04 '13 at 15:48