I'm trying to typeset using UTF8 and use the answers package. However, compilation halts on \begin{sol}
, with
Kapitola 1.
! Missing \endcsname inserted.
<to be read again>
\IeC
l.20 \begin{sol}
If I switch to utf8x, the compilation halts even sooner on \Newassociation{sol}{Riešenie}{ans}
If I remove the \usepackage{inputenc}
line, document compiles, but of course some of my characters will be displayed incorrectly.
This is the code that is causing all the trouble:
\documentclass[12pt]{report}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[slovak]{babel}
\usepackage[a4paper]{geometry}
\usepackage[nosolutionfiles]{answers}
\Newassociation{sol}{Riešenie}{ans}
\newtheorem{ex}{Príklad}
\begin{document}
\Opensolutionfile{ans}[ans1]
\chapter{ľščťžýáí}
\begin{ex}
Hmm?\\
\begin{sol}
Tri.
\end{sol}
\end{ex}
Naucili sme sa ze odpoved je tri.
\begin{ex}
1+1?
\begin{sol}
Tiez tri.
\end{sol}
\end{ex}
\Closesolutionfile{ans}
%\section{Solutions}
%\input{ans1}
\end{document}
\Newassociation
is an environment name, so it can't have accented characters. – egreg Jul 8 '15 at 15:13