I define a new environment \CCG
that takes two arguments (i.e. above and below texts) and an optional suffix.
I use \hrulefill
to make sure that horizontal line fills the space before a suffix.
This solution seems to be messed up by colortbl
package (e.g. when I use coloring a cell, for example).
How I can use colortbl
and still have the structure similar to CCG
?
Manually encoding \hrule
size is not a solution as CCG structures can be nested and length of texts can also vary.
MWE2 with nested structures:
\documentclass[10pt,a4paper]{article}
\usepackage{colortbl}
\newcommand{\CCG}[3][]{
\begin{tabular}[t]{@{\hspace{-3pt}}c@{\hspace{-3pt}}}
#2\\[-7pt]
\hrulefill\raisebox{-2.5pt}{\footnotesize{#1}}\\
\begin{tabular}[t]{@{}c@{}}
#3
\end{tabular}
\end{tabular}
}
\begin{document}
\CCG[suffix]{\cellcolor{green}above text}{below text}
%\hspace{2cm}
%\CCG[suffix]{above text}{below text}
\vspace{5mm}
\CCG[$<$]{
\CCG[$>$]{%
\CCG{some}{$NP/N$}
\CCG{man}{$N$}}
{$NP$}
\CCG{run}{$S\backslash NP$}}
{$S$}
\end{document}
\CCG
content can be more arbitrary, could you provide some examples of these? How should the nesting preserve colour changes if nesting occurs in the "above text" part?colortbl
with other tables not related to CCG. And forget about nesting. The two texts should be center aligned and a horizontal line+suffix filling the area between them (suffix is often one lettered).