The modulation of the band gap in the two-dimensional carbon materials is of importance for their applications as electronic devices. By first-principles calculations, we propose a model to control the band gap size of γ-graphyne. The model is named as p-n codoping, i.e., using B and N atoms to codope into γ-graphyne. After codoping, the B atom plays the role of p dopant and the N atom acts as n dopant. The Fermi energy level returns around the forbidden zone and the band gap of γ-graphyne becomes bigger or smaller. Moreover, the gaps exhibi...