希腊语问题

希腊语问题

我在 pdflatex 中遇到了希腊语问题。几周前,当我使用包管理器更新 Miktex 时,这个问题首次出现。然后在一次新更新后,这个问题消失了,最后在最后一次更新(2016 年 9 月 7 日)后,这个问题又出现了。

最小工作示例如下:

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

在更新之前,我一直使用它,没有任何问题。这是我的日志文件:

! 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>
                $


_____________________________________________________________________*

为了确保我没有做任何根本性的错误,我决定使用相同的结构,但使用英语。实际示例如下:

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

但是,这个运行起来没有任何问题。

我按照建议做了修改,并用 shareLateX 运行代码,它确实运行正常。我认为这是 MiKTeX 包 babel-greek 的问题,但我不知道如何修复它。

答案1

我想我找到了问题的根源。在 Winedt 10 中,有 ContribManager,它允许用户安装宏或程序。我安装了 MathGreek,显然弄乱了我所有的希腊语编码。我卸载了它,现在一切都运行正常了。唯一的问题是,在我使用的许多乳胶文件中,我认为卸载 MathGreek 导致文件中的每个希腊字符都被替换为相应的乳胶命令。例如 υ--> \upsilon..... 这应该是我未来的一个教训。谢谢大家!!

相关内容