When using gb4e, is it possible to apply \let\eachwordone=\itshape to every \gll, and \let\eachwordtwo=\itshape to every \glll? In other words, is it possible to only italicize the phrase in latin script, and not the non-latin original script (if there is any)?
Asked
Active
Viewed 308 times
1 Answers
4
You can use the etoolbox package to include the font settings in the \gll and \glll commands instead of setting them globally. This package provides the command \pretocmd to modify a command such that the provided code is executed every time the command is called.
In the MWE below \def is used instead of \let for the double definition to prevent an error in the patching.
Code:
\documentclass{article}
\usepackage{fontspec}
\setmainfont{DejaVu Serif}
\usepackage{gb4e}
\usepackage{etoolbox}
\pretocmd{\gll}{\def\eachwordone{\itshape}\def\eachwordtwo{\normalfont}}{}{}
\pretocmd{\glll}{\let\eachwordtwo\itshape}{}{}
\begin{document}
\begin{exe}
\ex
\glll καλά Χριστούγεννα\\
kala christouiena\\
good christmas\\
\glt `merry Christmas'
\ex
\gll fijne Kerstdagen\\
nice {christmas days}\\
\glt `merry Christmas'
\end{exe}
\end{document}
Result:
Marijn
- 37,699
