Expex is now "color safe". The developer has kindly added multiple ways of dealing with colors starting with version 5.1.
The \textcolor
command can now be used anywhere in any of the lines.
An option xyzcolor=colorname
, where "xyz"
is the name of the gloss line (such as gla
, glb
, or glpreamble
) has also been provided whereby an entire line can be set to a given color (for example [glacolor=red]
), globally or locally.
See below for some fairly self-explanatory examples of use. (The documentation hasn't been updated yet.)
\documentclass{article}
\usepackage{expex}
\usepackage{xcolor}
\begin{document}
\ex[glccolor=red]
\begingl
\glpreamble \textcolor{cyan}{Comparison of numerals in various languages.}//
\gla \textcolor{blue}{English} one two three//
\glb \textcolor{blue}{German} ein zwei drei//
\glc \textcolor{blue}{Sanskrit} \'e-ka dv\'a tr\'\i//
\glb \textcolor{blue}{Irish} {a haon} {a d\'o} {a tr\'\i}//
\glft \textcolor{cyan}{This is where a free translation could go, if desired.}//
\endgl
\xe
\ex[glstyle=nlevel,glneveryline=,glspace=1.2em,glnlinecolors={,,red}]
\begingl
\glpreamble Comparison of numerals in various languages.\endpreamble
\textcolor{blue}{English}[\textcolor{blue}{German}/\textcolor{blue}{Sanskrit}/
\textcolor{blue}{Irish}]
one[eins/\'e-ka/a haon]
two[zwei/dv\'a/a d\'o]
three[drei/tr\'\i/a tr\'\i]
\glft This is where a free translation could go, if desired.
\endgl
\xe
\lingset{glftpos=right,glneveryline=}
\ex[glspace=1.2em,glccolor=red,everygla=]
Comparison of numerals in various languages.
\bigskip
\begingl
\gla \textcolor{blue}{English} one two three//
\glb \textcolor{blue}{German} ein zwei drei//
\glc \textcolor{blue}{Sanskrit} \'e-ka dv\'a tr\'\i//
\glb \textcolor{blue}{Irish} {a haon} {a d\'o} {a tr\'\i}//
\glft This is where a free translation could go, if desired.//
\endgl
\xe
\ex[glstyle=nlevel,glnlinecolors={,,red}]
Comparison of numerals in various languages.
\bigskip
\begingl[glnlinecolors={red,magenta,blue,green}]
\textcolor{blue}{English} [\textcolor{blue}{German}/\textcolor{blue}{Sanskrit}/ \textcolor{blue}{Irish}]
one[eins/\'e-ka/a haon]
two[zwei/dv\'a/a d\'o]
three[drei/tr\'\i/a tr\'\i]
\glft \textcolor{orange}{This is where a free translation could go, if desired.}
\endgl
\xe
\end{document}
color
package. Also, I don't use pdftex as suggested there. I've edited the question. (Do you think it's still a duplicate? And, if so, how would I "add" my case to the other question?) – jan Mar 29 '16 at 4:33