We have investigated dilute aqueous solutions of an anionic polymer (carboxymethylcellulose) mixed with cationic surfactants of different chain lengths (dodecyl to octadecyl trimethylammonium bromides: DTAB, TTAB, CTAB and OTAB). The structures of the concentrated phases formed above the precipitation threshold were studied by X-ray diffraction. Different body-centred cubic structures with space groups Pm3n were observed in the presence of surfactant with a short aliphatic chain (DTAB), despite the fact that the polymer persistence length is comparable to the repeat distance of the structure (5 nm). For larger surfactant chain lengths (TTAB and CTAB), the structure of the precipitates can be either cubic (Pm3n) or 2D hexagonal depending on the initial surfactant and polymer concentrations. For still larger chain length (OTAB), the structure becomes lamellar. This structural evolution from micellar cubic towards 2D hexagonal and lamellar is attributed to the decrease of the local curvature of the surfactant aggregates, as observed for flexible synthetic polymers and short DNA fragments under similar conditions. Furthermore, the structure of the bulk complexes formed just below the precipitation threshold anticipates the structure seen in the precipitated phases.