1

I have a problem with Greek in pdflatex. It appeared first time a few weeks ago when I updated Miktex using the package manager. Then after a new update it disappeared and finally after the last update (07 Sept 2016) it appeared again.

The minimum working example is the following:

\documentclass[11pt, a4paper]{article}
\usepackage[pdftex]{graphicx}
\usepackage[english,greek]{babel}
\newcommand{\en}{\selectlanguage{english}}
\newcommand{\gr}{\selectlanguage{greek}}
\usepackage[utf8]{inputenc}
\usepackage{Kerkis}
\usepackage[square,numbers]{natbib}

\title{ ΗΛΕΚΤΡΟΜΑΓΝΗΤΙΣΜΟΣ-ΟΠΤΙΚΗ}
\date{08 Σεπτεμβρίου 2016.}
\author{Ανδρέας Ζούπας}
\begin{document}
\maketitle
 Διάρκεια Εξέτασης \textbf{3.0} ώρες.

\end{document}

I had been working with it with no problem before the updates. Here's my log file:

! Missing $ inserted.
<inserted text>
                $
l.18 \maketitle
? r
OK, entering \nonstopmode...
LaTeX Warning: Command \textEpsilon invalid in math mode on input line 18.
LaTeX Warning: Command \textKappa invalid in math mode on input line 18.
LaTeX Warning: Command \textTau invalid in math mode on input line 18.
LaTeX Warning: Command \textRho invalid in math mode on input line 18.
LaTeX Warning: Command \textOmicron invalid in math mode on input line 18.
LaTeX Warning: Command \textMu invalid in math mode on input line 18.
LaTeX Warning: Command \textAlpha invalid in math mode on input line 18.
LaTeX Warning: Command \textNu invalid in math mode on input line 18.
LaTeX Warning: Command \textEta invalid in math mode on input line 18.
LaTeX Warning: Command \textTau invalid in math mode on input line 18.
LaTeX Warning: Command \textIota invalid in math mode on input line 18.
LaTeX Warning: Command \textMu invalid in math mode on input line 18.
LaTeX Warning: Command \textOmicron invalid in math mode on input line 18.
LaTeX Warning: Command \textOmicron invalid in math mode on input line 18.
LaTeX Warning: Command \textTau invalid in math mode on input line 18.
LaTeX Warning: Command \textIota invalid in math mode on input line 18.
LaTeX Warning: Command \textKappa invalid in math mode on input line 18.
LaTeX Warning: Command \textEta invalid in math mode on input line 18.
! Missing $ inserted.
<inserted text>
                $
l.18 \maketitle
! Missing } inserted.
<inserted text>
                }
l.18 \maketitle
! Extra }, or forgotten \endgroup.
\@maketitle ...note \thanks {\LARGE \@title \par }
                                                  \vskip 1.5em{\large \lines...
l.18 \maketitle
! Missing $ inserted.
<inserted text>
                $
l.18 \maketitle
LaTeX Warning: Command \ensuregreek invalid in math mode on input line 18.
LaTeX Warning: Command \acctonos invalid in math mode on input line 18.
LaTeX Warning: Command \textZeta invalid in math mode on input line 18.
LaTeX Warning: Command \textomicron invalid in math mode on input line 18.
LaTeX Warning: Command \ensuregreek invalid in math mode on input line 18.
LaTeX Warning: Command \acctonos invalid in math mode on input line 18.
! Extra }, or forgotten $.
<template> \unskip \hfil }
                          \hskip \tabcolsep \endtemplate
l.18 \maketitle
! Missing $ inserted.
<inserted text>
                $
l.18 \maketitle
! Missing } inserted.
<inserted text>
                }
l.18 \maketitle
! Missing $ inserted.
<inserted text>
                $
l.18 \maketitle
LaTeX Warning: Command \ensuregreek invalid in math mode on input line 18.
LaTeX Warning: Command \acctonos invalid in math mode on input line 18.
LaTeX Warning: Command \textomicron invalid in math mode on input line 18.
! Extra }, or forgotten $.
\@maketitle ...ar}\par }\vskip 1em{\large \@date }
                                                  \end {center}\par \vskip 1...
l.18 \maketitle
! LaTeX Error: Command \end{center} invalid in math mode.
See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...
l.18 \maketitle
! LaTeX Error: Something's wrong--perhaps a missing \item.
See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...
l.18 \maketitle
! LaTeX Error: Something's wrong--perhaps a missing \item.
See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...
l.18 \maketitle
! Missing $ inserted.
<inserted text>
                $
l.18 \maketitle
! Missing } inserted.
<inserted text>
                }
l.18 \maketitle
! Missing $ inserted.
<inserted text>
                $
l.19  \Delta
             \iota ά\rho \kappa \varepsilon \iota \alpha  Ε\xi έ\tau \alp...
LaTeX Warning: Command \ensuregreek invalid in math mode on input line 19.
LaTeX Warning: Command \acctonos invalid in math mode on input line 19.
LaTeX Warning: Command \textEpsilon invalid in math mode on input line 19.
LaTeX Warning: Command \ensuregreek invalid in math mode on input line 19.
LaTeX Warning: Command \acctonos invalid in math mode on input line 19.
LaTeX Warning: Command \ensuregreek invalid in math mode on input line 19.
LaTeX Warning: Command \acctonos invalid in math mode on input line 19.
! Missing $ inserted.
<inserted text>
                $


_____________________________________________________________________*

To make sure that I was not doing anything fundamentally wrong, I decided to use the same structure but with English. The working example is the following:

\documentclass[11pt, a4paper]{article}
\usepackage[pdftex]{graphicx}
\usepackage[english,greek]{babel}
\newcommand{\en}{\selectlanguage{english}}
\newcommand{\gr}{\selectlanguage{greek}}    
\usepackage[utf8]{inputenc}   
\usepackage{Kerkis}    
\usepackage[square,numbers]{natbib}

\title{\en ELECTROMAGNETISM-OPTICS}    
\date{\en 08 September 2016.}    
\author{\en Andreas Zoupas}
\begin{document}

\maketitle

\en
Exam Duration \textbf{3.0} hours.

\end{document}

However, this one runs with not problem at all.

I made changes suggested to me and run the code with shareLateX and it did run ok. I think it is a problem with the MiKTeX package babel-greek but I have no idea how to fix it.

  • Well, apart from the Kerkis package that I don't have, your example runs fine with me. So I assume that package might be conflicting in some way. Where can we get it? – Alenanno Sep 8 '16 at 15:48
  • 1
    Works fine for me (and I do have the Kerkis package), show the real log-file, not only the terminal output. – Ulrike Fischer Sep 8 '16 at 15:53
  • @UlrikeFischer Unrelated, but do you know why on earth MiKTeX has bblopts.cfg from arabi in runtime? – egreg Sep 8 '16 at 15:55
  • 1
    No error for me; however the package should be named kerkis (all lowercase) and the order of the packages is wrong: use the order inputenc, babel, kerkis, natbib, graphicx (and don't pass it the option pdftex). This doesn't affect the output, but is preferable for better organization of the input. Please, add \errorcontextlines=100 at the very beginning of the failing code and report the error message (not the full log, this time). – egreg Sep 8 '16 at 16:01
  • 4
    I'm voting to close this question as off-topic because it was due to wrong installation of some MiKTeX package – egreg Oct 14 '16 at 8:17
0

I think I found the root of the problem. In Winedt 10 there is ContribManager which allows users to install Macros or Programs. I had the MathGreek installed which apparently messed all my greek encoding up. I uninstalled it and everything runs ok now. The only problem is that in many latex files I use, I think that uninstalling MathGreek caused every greek character in the file to be substituted with the corresponding latex command. E.g. υ--> \upsilon..... This should be a lesson for the future for me. Thank you all!!

Not the answer you're looking for? Browse other questions tagged or ask your own question.