If you're willing to accept nanotechnology "magic" as an answer, then Feed (or later, Seed) technology as shown in Neal Stephenson's "Diamond Age" can do it. The premises are :
1 ) Nanotech building techniques allow you to create diamond shapes from pure carbon input. Shapes and mixtures of all other elements and compounds can be made given time, energy, templates for the building plans, computation, and other infrastructure considerations.
2 ) Perfect decomposition of garbage, sewage, and random seawater into perfectly segregated elemental lumps. For dangerous elements like fluorine, combine them into safe compounds. A sphere of diamond is probably the safest, most reliable carrying container.
3 ) Perfect pumping system of these lumps. Use spheres instead of cubes, for better pumping. Use pure, clean water as the carrying medium and heat sink. Tag each sphere with its payload lump, track it, and send it out from the decomposition center. Or, have a bunch of decomposition centers and use a system like TCP/IP to send lumps where needed. Either way, it looks like a vascular system pumping out in a Feed.
4 ) Matter compilers in every home, business, and street corner. These request data, power, and lumps of atoms from the Feed. The matter compiler builds physical objects according to the templates in memory or that it fetches from the Internet.
5 ) Each home, business, and street corner has a waste system. If the decomposition machines can be made small, then just have one in every home. If you need a big one, then have a traditional sewage system, which flushes every away to the decomposition machine.
6 ) Power generation from nuclear, geothermal, solar, wind, and/or other sources. Perfect decomposition can also be applied to mining, or seawater, so Uranium is easy to get and refine.
In this city, the population can be extremely dense, only limited by the heat generation of the machinery and people. If people decompose and compile the same atoms with minimal movement every day (food, drink, and clothes can be created from the same atoms discarded as waste earlier in the same building or even room) , then there's relatively little waste from transportation.
This may seem a little disgusting - yesterday's feces, urine, breath, skin flakes, clothes, etc, are all spun into today's consumption. But it's been what we've each been doing since before we were born. We're already part of the water cycle, carbon cycle, nitrogen cycle, and many other cycles of biology. If you're eating a strawberry today, some portion of it was manure a month ago.
The Decomposer/Feed/Compiler system merely speeds it up, minimizes movement of dumb atoms, and applies the idea of perfectly recreating the template that you want. If they figure out how to perfectly recreate the Best Strawberry, then you get that one whenever you want, without blemish, insect, or age since it was harvested. Better yet, given that scanning an object for a template takes time, and templates can be manually reviewed to take out imperfections, you can having a really perfect strawberry, something that could never be enjoyed in a real city.
Each city now resembles a flower taking in power from the Sun and other sources, and endlessly recycling and rejuvenating itself.