In this paper, we show that the
$\gamma $-vectors of Coxeter complexes (of types A and B) and associahedrons (of types A and B) can be obtained by using derivative polynomials of the tangent and secant functions. We provide a unified grammatical approach to generate these
$\gamma $-vectors and the coefficient arrays of Narayana polynomials, Legendre polynomials and Chebyshev polynomials of both kinds.