We present a principled approach to the problem of connecting a controlled document authoring system with a knowledge base. We start by describingclosed-world authoring situations, in which the knowledge base is used for constraining the possible documents and orientingthe user's selections. Then we move to open-world authoring situations in which, additionally, choices made during authoring are echoed back to the knowledge base. In this way the information implicitly encoded in a document becomes explicit in the knowledge base and can be re-exploited for simplifying the authoring of new documents. We show how a Datalog KB is sufficient for the closed-world situation, while a Description Logic KB is better-adapted to the more complex open-world situation. All along, we pay special attention to logically sound solutions and to decidability issues in the different processes.