  In THz wave emission from intrinsic Josephson junctions in in-plane magnetic
fields, emission intensity strongly depends on the surface impedance $Z$
similarly to the case without external magnetic fields. Cavity resonance modes
are stabilized for $Z \ge 3$, and the fundamental mode gives the strongest
emission. As the in-plane magnetic field increases for a fixed number of
junctions, dynamical phase transitions seem to occur between the
$\pi$-phase-kink state, various incommensurate phase-kink states, and in-phase
state. As $Z$ varies, a crossover of the field profile of maximum intensity
takes place for $Z \approx 50$ between characteristic peaks for smaller $Z$
(typically $Z \approx 30$) and monotonic decrease for larger $Z$ (typically $Z
\approx 70$). The double-peak structure reported in experiments can be
explained for Z=30 by finite-size analysis with respect to number of junctions.
