I am using the package gb4e to gloss a number of linguistic examples. Its main feature, is that it aligns the words in the original language with glosses.
I would like to be able to change the font/colour of some parts of the text so as to highlight those that are more important in a particular context.
Example. In the following example, the first line is how I currently imagine my ideal solution. Unfortunately, it does not work. The second line, instead, is my current solution: this works, but I have to repeat the command for every gloss and makes the source code less readable. The third line is a failed attempt to dodge the issue: grouping together several words doesn't work because it makes them part of the same gloss.
\documentclass{report}
\usepackage{color}
\usepackage{gb4e}
\begin{document}
\begin{exe}
\ex \glll
a \color{blue} b c d \color{black} e f g\\
a {\color{blue} b} {\color{blue} c} {\color{blue} d} e f g\\
a {\color{blue} b c d} e f g\\
\end{exe}
\end{document}
output:
I am looking for a better solution which achieves the same result as the second line of the given example, but it does not make the source code so unreadable.
I am open to suggestions which do not involve the package gb4e, in case there exist better packages for dealing with this kind of situations.
edit: the ideal solution is something of the form
a \fromNowOnTextIsBlue b c d \fromNowOnTextIsBlackAgain e f g\\
that is, a way to change the colour "globally", so that it spans beyond the local scope. In fact, the package gb4e considers any command as a standalone gloss and thus it does not propagate its effect across subsequent words. Is that possible?



\newcommand. – AML May 25 '18 at 14:30\color{blue}because it's a bit long? Because you can define a\newcommandto shorten it. I have an answer ready that does it. – AML May 25 '18 at 14:42a \b{b} \b{c} \b{d} e f g? That's an improvement, but not really ideal. The ideal solution would bea \blue b c d \black e f g, a command that somehow changes text-colour at a global-scope level and that trespasses the local scope which I presume is attached to each individual gloss. The objective is to keep the source code aligned too, and mixing commands inside multiple lines which contain several languages makes it very difficult to read it. – Patrick Trentin May 25 '18 at 14:46\bfseriesneeds{ }. – AML May 25 '18 at 15:06LaTeXglobal (hidden?) state. Unfortunately, both of these are beyond my understanding of the language at the moment. If you don't mind, I'll leave the question open for a few days, in hope something new arrives. – Patrick Trentin May 25 '18 at 15:08gb4eglossing is provided bycgloss4e.sty, so if you're only interested in word- aligning you could simply\usepackage{cgloss4e}and call\gllor\glllwithout the example environment. – alexis May 26 '18 at 07:06