Theory of capillary formation in alginate gels