One-dimensional classical fluid with nearest-neighbor interaction in arbitrary external field