I'm having a frustrating problem compiling a file with Czech diacritics.




% \includepdf{PDFs/Cover}





\mainsection{1}{Lecture title}{dd/mm/yyy}

Hello ř

When I do not put ř into the file, it compiles fine. When added, it ends on following error message I cannot understand:

(./main.equ) [1] (./lecture1.tex
! Missing $ inserted.
<inserted text> 
l.6 Hello ř

All files are saved in UTF-8 (shown by VS Code).

Could you help me please?

  • 2
    Welcome to TeX SX! Try adding \usepackage[T1]{fontenc} to your preamble. – Bernard Jul 13 at 16:21
  • Off-topic: Instead of \renewcommand{\thepage}{\roman{page}} \setcounter{page}{1} and \renewcommand{\thepage}{\arabic{page}} \setcounter{page}{1}, consider writing \pagenumbering{roman}` and \pagenumbering{arabic}, respectively. (The \pagenumbering directive resets the page counter to 1 automatically.) – Mico Jul 13 at 17:35
  • 1
    I cannot reproduce the issue with a standard class with any version of TeX Live I have. Of course, I don't have notes.cls. Can you please give a pointer to it? – egreg Jul 13 at 19:48
  • 1
    @Bernard could you reproduce the problem? I do not see how adding fontenc could change the behaviour here (but I don't see how the reported behaviour could occur either) – David Carlisle Jul 13 at 20:20
  • @DavidCarlisle: I thought maybe it used by default the OT1 encoding, and that was the cause of the problem, but I've just tested, and there's no problem. However, I had to modify the code, as I don't have the notes class installed (no idea where it comes from, so I replaced it with report), and of course, I don't have the pdf file included. Might having cm-unicode installed have helped my compilation? – Bernard Jul 13 at 21:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.