1

I'm writing a document in Greek language.

My problem is that the editor sometimes displays the greek acute next to the letter instead of above. This occurs when I change the language to English in my keyboard and then back to Greek but not always.

Example given for the right acute position

Οι προτάσεις που ικανοποιούνται από την $I$ είναι οι 
$\phi_1,\phi_2,\phi_3$.

Now if I change the language to English and write something and then try to rewrite the same sentence as above

Οι προτ´ασεις που ικανοποιο´υνται απ´ο την $I$ ε´ιναι οι
$\phi_1,\phi_2,\phi_3$.

If I compile the two sentences the result is the same but it is really annoying having this kind of code. The problem is solved if I restart TexMaker but usually reoccurs within minutes.

I'm using TexMaker in Debian 8.

Edit: MWE after request

\documentclass[12pt]{article}
\usepackage[english,greek]{babel}
\usepackage[utf8x]{inputenc}
\usepackage{enumitem}
\usepackage{ulem}
\usepackage{graphicx}
\graphicspath{ {images/} }

\title{Τεχνητή Νοημοσύνη}
\author{Εργασία 4\\ }
\date{}
\begin{document}
\maketitle
\begin{enumerate}[label={\arabic*.}]

\item
Χρησιμοποιώ τον όρο \textlatin{grufallo} για να 
περιγράψω τον  \textlatin{grufallo} της
εικόνας και την λέξη \textlatin{littlemouse} 
για να περιγράψω τον ποντίκι της εικόνας.
\begin{enumerate}[label={\roman*.}]
\item
Θα ορίσω μια ερμηνεία $I$ με βάση την οποία το λεξιλόγιο 
των παρακάτω προτάσεων περιγράφει
με ακρίβεια τον κόσμο της εικόνας.\\
\item Οι προτάσεις που ικανοποιούνται από την $I$ είναι οι 
$\phi_1,\phi_2,\phi_3$.
\end{enumerate}
\end{enumerate}
\end{document}
  • 1
    that's U+00B4 so this question is perhaps a duplicate of http://tex.stackexchange.com/questions/348155/using-utf-and-not-displaying-accent-marks/348182?noredirect=1#comment855299_348182 – David Carlisle Jan 15 '17 at 02:01
  • not a duplicate very similar though. I get the correct result in the .pdf the problem is the random behavior of the editor – Konstantinoscs Jan 15 '17 at 02:14
  • Welcome to TeX SX! Which font is used by TeXmaker for the code? – Bernard Jan 15 '17 at 02:23
  • Strange! It is a unicode font. I really have no idea of what happens. – Bernard Jan 15 '17 at 03:09
  • the editor can not be saving those characters into the file if pdftex is showing accented characters without further definitions. Odd. – David Carlisle Jan 15 '17 at 10:42
  • please show a complete small document with that text that typesets correctly, so we can see what packages are loaded – David Carlisle Jan 15 '17 at 10:43

1 Answers1

1

I can only reproduce the issue if I input the accented letter into two different ways:

\documentclass[12pt]{article}
\usepackage[english,greek]{babel}
\usepackage[utf8x]{inputenc}

\begin{document}

\textlatin{precomposed}: ώ

\textlatin{combining}: ώ

\end{document}

In the first case I typed directly ώ (U+03CE), in the second case I typed ω (U+03C9) followed by U+0301 (COMBINING ACUTE ACCENT). This site apparently does input normalization, so if you copy the second instance of ώ you get U+03CE).

However, utf8x and ucs raise an error message:

! Package ucs Error: Please activate option 'combine'.

See the ucs package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.9 \textlatin{combining}: ώ

Unfortunately, adding \usepackage[combine]{ucs} produces wrong output nonetheless (even worse).

Ensure you only use precomposed glyphs, never combining accents.

Also, it's better not using utf8x. With \usepackage[utf8]{inputenc} I get

! Package inputenc Error: Unicode char ́ (U+301)
(inputenc)                not set up for use with LaTeX.

See the inputenc package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.9 \textlatin{combining}: ώ

which informs you where finding the combining character, so to be able to fix it.

egreg
  • 1,121,712
  • Thanks! I also found your answer here http://tex.stackexchange.com/questions/13067/utf8x-vs-utf8-inputenc I changed to [utf8] instead of [utf8x] and I also changed the font to DejaVu Sans instead of DejaVu Sans Mono. This combination seems to work fine for the time being – Konstantinoscs Jan 15 '17 at 17:04
  • Why not to us XeLaTeX with a font that supports both latin and greek alphabet, like Artemisia, Linux Libertine,etc? I believe that xelatex and lualatex are more suitable when you have to deal with multilingual documents – Yorgos Jan 15 '17 at 22:06
  • @Yorgos The issue (I think) is editor-related rather than distribution-related. I have XeLaTeX, LuaLaTeX etc but I use pdftex for simplicity. – Konstantinoscs Jan 15 '17 at 22:10
  • with xelatex you can avoid \textlatin{} command if you have too many terms in english. Also note that your references will be presented in greek, since the main language of your document is greek – Yorgos Jan 15 '17 at 22:13
  • @egreg sorry for my unrealated to the question comments – Yorgos Jan 15 '17 at 22:15