We provide ways to simulate fermions by qubits on 2d lattices using
$\mathbb{Z}_2$ gauge theories (stabilizer codes). By studying the symplectic
automorphisms of the Pauli module over the Laurent polynomial ring, we develop
a systematic way to increase the code distances of stabilizer codes. We
identify a family of stabilizer codes that can be used to simulate fermions
with code distances of $d=2,3,4,5,6,7$ such that any $\lfloor \frac{d-1}{2}
\rfloor$-qubit error can be corrected. In particular, we demonstrate three
stabilizer codes with code distances of $d=3$, $d=4$, and $d=5$, respectively,
with all stabilizers and logical operators shown explicitly. The syndromes for
all Pauli errors are provided. Finally, we introduce a syndrome-matching method
to compute code distances numerically.