Compact and solid-state CW terahertz sources based on stacks of intrinsic Josephson junctions of high-T c superconductors are interested in both scientific and industrial fields. In this study, we focus on the effect of the mesa sidewalls associated with variation in characteristics of the stacked junctions. We implement an effective laser lithography to pattern two neighboring mesas with varying sidewall angles on the identical superconducting crystal base. The intense radiation is observed only from the mesas with rather vertical sidewalls, suggesting that the distribution uniformity is a key ingredient to promote the spontaneous synchronization among thousands of intrinsic junctions.