The \textgreek
macro only changes font encoding, not the language. Using \foreignlanguage{greek}
is preferred
(unless you are compiling with XeTeX and LuaTeX and using Unicode fonts but still want the Latin transliteration).
The dialytika is input with the ASCII "
(quotation mark) character.
The standard "monotonic" Greek orthography does not use the
perispomeni accent, therefore the tilde character ~
is kept at its default LaTeX function: insert a no-break space.
You can use a tilde accent command instead:
\usepackage[greek, english]{babel}
\foreignlanguage{greek}{'a, <a, >a, `a, a|, \~a, "i}
If you want to write "polytonic" Greek or "ancient" Greek, use the
"polutoniko" or "ancient" modifier respectively to tell Babel. Then, the ~
character changes its meaning in Greek text parts. E.g.
\usepackage[greek.ancient, english]{babel}
\foreignlanguage{greek}{'a, <a, >a, `a, a|, ~a, "i}
Caveat: Due to side effects, the re-definition of ~
is only done
with 8-bit TeX (pdftex) and only in text parts with the language Greek (i.e. not in the argument of \textgreek
inside an English text part).
Hint: after a first compilation, you can replace the Latin transliteration with the literal Greek characters copied from the output. Looks better, works better, is safe for use with Xe/LuaTeX.
For side-effects and details, see the babel-greek documentation.
http://mirrors.ctan.org/macros/unicodetex/latex/polyglossia/polyglossia.pdf