We compute the entropy of entanglement in the ground states of a general class of quantum spin-chain Hamiltonians --- those that are related to quadratic forms of Fermi operators --- between the first $N$ spins and the rest of the system in the limit of infinite total chain length. We show that the entropy can be expressed in terms of averages over the classical compact groups and establish an explicit correspondence between the symmetries of a given Hamiltonian and those characterizing the Haar measure of the associated group. These averages are either Toeplitz determinants or determinants of combinations of Toeplitz and Hankel matrices. Recent generalizations of the Fisher-Hartwig conjecture are used to compute the leading order asymptotics of the entropy as $N\rightarrow\infty$. This is shown to grow logarithmically with $N$. The constant of proportionality is determined explicitly, as is the next (constant) term in the asymptotic expansion. The logarithmic growth of the entropy was previously predicted on the basis of numerical computations and conformal-field-theoretic calculations. In these calculations the constant of proportionality was determined in terms of the central charge of the Virasoro algebra. Our results therefore lead to an explicit formula for this charge. We also show that the entropy is related to solutions of ordinary differential equations of Painlev\'e type. In some cases these solutions can be evaluated to all orders using recurrence relations.