This paper presents the results of a comprehensive investigation of complex linear physical-layer network (PNC) in two-way relay channels (TWRC). In this system, two nodes A and B communicate with each other via a relay R. Nodes A and B send complex symbols, wA and wB, simultaneously to relay R. Based on the simultaneously received signals, relay R computes a linear combination of the symbols, wN = αwA + βwB, as a network-coded symbol and then broadcasts wN to nodes A and B. Node A then obtains wB from wN and its self-information wA by wB = β −1 (wN − αwA). Node B obtains wB in a similar way. A critical question at relay R is as follows: "Given channel gain ratio η = hA/hB, where hA and hB are the complex channel gains from nodes A and B to relay R, respectively, what is the optimal coefficients (α, β) that minimizes the symbol error rate (SER) of wN = αwA + βwB when we attempt to detect wN in the presence of noise?" Our contributions with respect to this question are as follows: (1) We put forth a general Gaussian-integer formulation for complex linear PNC in which α, β, wA, wB, and wN are elements of a finite field of Gaussian integers, that is, the field of Z[i]/q where q is a Gaussian prime. Previous vector formulation, in which wA, wB, and wN were represented by 2-dimensional vectors and α and β were represented by 2 × 2 matrices, corresponds to a subcase of our Gaussian-integer formulation where q is real prime only. Extension to Gaussian prime q, where q can be complex, gives us a larger set of signal constellations to achieve different rates at different SNR. (2) We show how to divide the complex plane of η into different Voronoi regions such that the η within each Voronoi region share the same optimal PNC mapping (αopt, βopt). We uncover the structure of the Voronoi regions that allows us to compute a minimum-distance metric that characterizes the SER of wN under optimal PNC mapping (αopt, βopt). Overall, the contributions in (1) and (2) yield a toolset for a comprehensive understanding of complex linear PNC in Z[i]/q. We believe investigation of linear PNC beyond Z[i]/q can follow the same approach.