The usual way of working with formulas that will be part of another document, e.g. a text document, is to start in the main document and create the formula as an object in that document, using Insert > Object > Formula. That will invoke OOo Math to create the formula, but the result will be a formula object embedded in the parent document.