# How to change between languages without using a command?

I am using LaTeX to produce texts containing both English and Greek characters, with the aid of the `babel` package. My approach up to now, in declaring the use of another language, is to use a shortened self-defined command (e.g. `\gr{}`). Though effective, this has become quite cumbersome, and I would be interested to be able to switch between the two languages without having to declare this every time. Is there a relatively short solution to this problem?

• Hi, please always show an MWE to start with. If you need some functions of babel for your text, you will always have to tell LaTeX which language you are using at the moment. You could just change languages with out any support from babel, of course. The only solution would be to have an automatic language recognizing system... Which is neither easy nor short. So the answer would be "no". – LaRiFaRi Sep 16 '14 at 9:17
• while a unicode font (with xetex or luatex) will allow Greek and English text to be typeset with no commands, you will still need a command to switch languages so that you get correct hyphenation – David Carlisle Sep 16 '14 at 9:56

In that example, I use the `\textgreek` command, however, that's only necessary to allow automatic font switching.
If you go this path, you will need to switch to `polyglossia`, rather than `babel`.
• Many thanks! `fontspec` and `ucharclasses` are really designed to do exactly what I was looking for. @Javier: Hahaha, true! – Koul Sep 18 '14 at 9:59
There is `auto-greek`, a package which allows this exactly. I have tested some years ago, but I haven't used it; it was difficult in collaboration to use a package that cannot be installed automatically. You can review and download it here