I'm using the taggedline
environment from the tagpair
package for source attributions in my examples. By default, these get printed in the document font. For less visual clutter, I had considered printing them at, say, \footnotesize
. However, I haven't been able to find out how to patch the corresponding line in the environment definition with etoolbox
or xpatch
without redefining the whole environment in my document in order to change one line. Is this possible at all?
The taggedline
environment takes the attribution tag as a parameter which is internally handled as \savebox{\t@g}{#2}
. Basically, I want to place a formatting option like \footnotesize
before the #2
part or do something to that effect, anyway.
\documentclass{article}
\usepackage{tagpair}
\usepackage{gb4e}
% Copied & adjusted from
% /usr/local/texlive/2021/texmf-dist/tex/latex/tagpair/tagpair.sty
\makeatletter
\renewenvironment{taggedline}[2][0.75]%
{\def\linewidthfactor{#1}%
% \savebox{\t@g}{#2}%
\savebox{\t@g}{\footnotesize#2}% <- can this be done by etoolbox/xpatch?
\ignorespaces}%
{\unskip%
\hfil\penalty0%
\hskip1em%
\hbox{}%
\nobreak%
\hfill%
\begin{varwidth}[t]{\linewidthfactor\linewidth}
\narrowraggedleft\strut\unhbox\t@g
\end{varwidth}}
\makeatother
\begin{document}
\begin{exe}
\ex
\begin{taggedline}{(Example 2021: 123)}
\gll Dies ist ein Beispiel \\
this is an example \\
\glt `This is an example.'
\end{taggedline}
\end{exe}
\end{document}